Simcenter STAR-CCM+ The Schmitt Trigger: Let Simcenter STAR-CCM+ remember things.

2021-09-06T13:32:56.000-0400
Simcenter STAR-CCM+ Simcenter STAR-CCM+ Virtual Reality Teamcenter Share Simcenter Cloud HPC Simcenter STAR-CCM+ Viewer Simcenter STAR-CCM+ Application Specific Solutions

Summary

Implementation of hysteretic effects with field functions.


Details

 

In 1937 appeared the first electronic circuit designed explicitly as a pulse-coded neural circuit. Its inventor Otto Herbert Arnold Schmitt described it in his 1937 PhD thesis: "An Electrical Theory of Nerve Impulse propagation". In 1938 he coined the name thermionic trigger for his invention, though at this time, it is best known as the Schmitt trigger. That circuit was built to study neural function better and test the "impulse propagation" theory in nerves. It behaves as a binary-output electrical circuit with a threshold function and can be considered the minimal building block for modelling hysteretic phenomena.

But let explain it better with a practical example: You have an environment that generates a contaminant (let´s call it SMOG). You accept a maximum (volume-averaged) concentration of 0.1. When that limit is reached, you inject clean air (10 m/s), and the injection takes place, so long as the SMOG concentration is below 0.07. The following diagram would represent that:

User-added image

In the horizontal axis, you keep track of the SMOG concentration, and in the vertical axis, you keep track of the injection velocity of clean air.

You can interpret the diagram as the transfer function of the trigger controlling the injection system. The horizontal and vertical axes are the input and output voltage, respectively, T and −T are the switching thresholds, and M and −M are the output voltage levels.

You see that the inlet velocity has different outputs in the interval (0.07,0.1) depending on past values. If the injection of clean air was on, it continues to remain on. And if no injection was taking place, it remains off. This dependence of a system on its past is called hysteresis. And therefore, the Schmitt trigger can be conceived as the circuit that simulates the minimal possible hysteretic effect.

You can quickly implement the Schmitt trigger in Simcenter STAR-CCM+. With it, you can implement hysteretic effects in the program. In other words: memory. Please note that the memory, in this case, is not a static procedure where we store data in the computer but a dynamical one where the data is memorized by endlessly repeating the previous value.


What are the main ingredients? You need to select your input. In our case, a report gives us the SMOG contaminant's volumetric average: the Vol.AverageSMOGReport in the attached simulation. You now define the output, which will be the InletVelocity. And finally, you need to store the previous values of the InletVelocity field function. This keeping is done with the field mean monitor oldInletVelocity (explained here).

You define the InletVelocity field function as:

  (${Vol.AverageSMOGReport} > 0.1)
              ? 10 
              : ( (${Vol.AverageSMOGReport} > 0.07)
                            ? ${oldInletVelocity} 
                            : 0 )


where you tell the program to use past values within the (0.07,0.1) interval.

You can now see the trigger in action here:

 

 

You can implement a generic Schmitt trigger by defining an OutputSignal as

  (${InputSignal} > T)
              ? M 
              : ( (${InputSignal} > -T)
                            ? ${oldOutputSignal} 
                            : -M)


Finally, a word of caution. The OutputSignal is defined in terms of its previous value. Therefore,
we recommend the following safety measure when defining the above functions.
To wrap them with the alternateValue keyword, which provides a default value if the program can not find a value for it. With the example above, you would define the InletVelocity field function as:

 alternateValue( 
           (${Vol.AverageSMOGReport} > 0.1)
              ? 10 
              : ( (${Vol.AverageSMOGReport} > 0.07)
                            ? ${oldInletVelocity} 
                            : 0 )
 ,0)


where 0 is the default value in this case.

You can find the example above in the simulation attached to this article. You can open the simulation with Simcenter STAR-CCM+ version 12.04 onwards. (Tested successfully till 2019.2)


See also:

Memorizing High Water Marks and High Water Times.
How to store and access results from the previous iteration or previous time step?
How to make your simulation setup more flexible with the alternateValue field function?

and previous Swiss Simcenter STAR-CCM+ Knife tools:

Swiss STAR-CCM+ Knife: [1] Big Sources: How to override equations and fix cell physical values.
Swiss STAR-CCM+ Knife: [2] Taming of the Courant Number: Automatic Time-Step Control.
Swiss STAR-CCM+ Knife: [3] Ignore box: Robin, Zero Pressure Gradient and Slip Flow boundary conditions.
Swiss STAR-CCM+ Knife: [4] Manual cosimulator: How to transfer information across multiple simulations via a macro.
Swiss STAR-CCM+ Knife: [5] Pixel comparison: Integrate image processing tools in your CFD workflow.
Swiss STAR-CCM+ Knife: [6] Streamline rider: Integrate scalar and vector fields along streamlines.
Swiss STAR-CCM+ Knife: [7] Command and conquer: How to pass command line parameters to your macros.

KB Article ID# KB000043163_EN_US

Contents

SummaryDetails

Associated Components

Design Manager Electronics Cooling In-Cylinder (STAR-ICE) Job Manager Simcenter STAR-CCM+