Runtime LogicΒΆ

This input section represents a UDF that evaluated once per time step. There are a number of functions that can be defined, which makes it a bit different than other UDFs in M-Star. These functions are callbacks that the solver invokes at different times that can be used to customize the solver behavior. Here are some practical examples of what can be done with this:

  • Implement PIV controller for impeller or inlet speed

  • Create a custom print statement to show at runtime

  • Change global variable values based on some customized function

  • Change output behavior based on global variables

Here is the boiler plate code that is provided for runtime logic sections:

// START of top area
// Use this area to define additional variables/classes/functions used in the runtime logic

// END of top area

// the solver executes this function every time step
void timestep(double t, double dt)
{

}

// the solver executes this function every at stats output interval
void stats(double t)
{

}

// use the do** functions to write out additional data at custom times
// note that these will create additional output to the configured output intervals
// (setting to false does not override the output interval)
bool doVolumeOutput(double t)
{
    return false;
}

bool doSliceOutput(double t)
{
    return false;
}

bool doParticleOutput(double t)
{
    return false;
}

bool doStatOutput(double t)
{
    return false;
}

bool doCheckpointOutput(double t)
{
    return false;
}