Operation Modes
The operationMode option allows you to change the solver for either minimal run time or maximum accuracy.
There is a number of requirements and nuances that determine the performance or level of assumptions required from nanoFluidX. While it was always possible to tune the solver to meet your specific needs, doing so requires a level of user proficiency.
However, with the operationMode option you can choose between three modes: DESIGN, NORMAL and CONSERVATIVE. These modes tune the solver for either minimal run time or maximum accuracy.
Performance numbers between the DESIGN and CONSERVATIVE modes can differ significantly (depending on the case, more than 10x). The main differences in performance are caused by changing the core assumptions that you are willing to use. For example, do you run in single or multiphase, is your allowed fluid compressibility 1% or 3%, how many data reads (outputs) would you like to have and so on?
You are able to decide what set of assumptions is acceptable and to set up the solver accordingly.
As can be seen in Figure 1 and Figure 2, the differences caused by numerical changes in the code are not substantial, though again, depending on the purpose of the simulation, one might argue otherwise. Another important consideration is that this example case was run in single phase only, and that including the air phase in the normal mode would most likely immediately increase the run time by a factor of 2. This would bring run time comparison to 9h versus 59min, which is obviously a 9x speed up. What you have to ask yourself is: do you want or need to include multiphase flow phenomena, such as aeration or windage effects?
Operating in NORMAL mode (default) does not change anything, whereas operating in NORMAL mode will use all of parameters you have defined, giving you full flexibility.
simulationParameters
{
dt_factor 2.0
ns_phaseinfo 5
ref_vel_factor 1.0
transportvelocity false
}
phases
{
phase
{
rho_compr 0.03
}
}
The above commands imply that the time step will be 2x larger than the default. This is allowed in single phase, as single phase SPH simulations have a relaxed CFL condition with respect to multiphase simulations. It also implies that only five data samples will be collected between the phase information output, and that the maximum velocity in the domain is set as the reference velocity. The transport velocity formulation (which is also the recommended behavior for single phase simulations) is turned off, and the compressibility of the fluid phase is changed to 3% (instead of the default 1%). The last assumption reduces the numerical speed of sound in the simulation to help increase the time step further, at the expense of a slightly more compressible fluid.
simulationParameters
{
dt_factor 1.0
ns_phaseinfo 100
ref_vel_factor 2.0
transportvelocity true
}
phases
{
phase
{
rho_compr 0.01
}
}
With the above set parameters, CONSERVATIVE mode will likely be at least 5 to 10x slower than the DESIGN mode, even in single phase.