Wiki

Clone wiki

Simflowny / UserGuide_InitialConditions

Initial Conditions

The initial conditions are use to set the values for the fields and properties at the beginning of the simulation. They are set using Math Expressions. Furthermore, conditional statements can be applied to specific initializations.

For instance we may want to set an initial condition consisting on a field T that has a certain value when \(y=\pi\) and another otherwise. We would add an Apply If element to the Initial Condition. The value for Math would be y=pi. On the Math Expressions area we would add also a math with T=x. Then a second Initial Condition should be added and filled in a similar way with condition y!=π and mathematical expression T=0. The following image shows the result:


images/UserGuide/initialCondition.png

There is a possibility of getting the initial conditions externally to simflowny (for instance from LORENE [1] library). The option External Initial Condition must be selected instead of the Initial Condition seen before. Once the problem has been discretized and the code generated, two extra files will be expected at compilation time, ExternalInitialData.cpp and ExternalInitialData.h. The second one must define the interface for Simflowny to link the initial condition to the externally given one. That interface must be static void external_loadData(int vars, ...);. The first one is the current implementation of that interface. Some examples are given in the generated code.

Returning to Simflowny, a list of input variables must be filled for an external initial conditions. As can be deduced from the previously explained, the first expected from the source code is the number of variables provided. However, Simflowny will set that number automatically and it is not needed to be given in the problem. The following image shows an example of an external initial condition where a bunch of variables and parameters are set:


images/UserGuide/externalInitialCondition.png
[1]https://lorene.obspm.fr/

Updated