To test the directives and macro substitutions, backward facing step case is used as example.
Step Height: 0.1m
Inlet Height: 0.1m
Total length: 2m
Min cell size =1e-03m
Reference Velocity = 40m/s
Time step size = 1e-05
Step Height: 0.1m
Inlet Height: 0.1m
Total length: 2m
Min cell size =1e-03m
Reference Velocity = 40m/s
Time step size = 1e-05
First, test the #include and #inputMode.
A new file is created in the case file with:
touch 0/initialConditions
Write following lines in the file:
Velocity (40 0 0);
inOutBC zeroGradient;
#inputMode merge
In 0/U, we modify inlet and outlet BC using predefined values in 0/initialConditions.
dimensions [0 1 -1 0 0 0 0];
#include "initialConditions" //include initialConditions file
internalField uniform (0 0 0);
// a fixedValue;
boundaryField
{
INLET
{
type fixedValue;//$:a (: go to top level code)--------------------------->//$..a (go to 1 level up)
value uniform $Velocity; //read (40 0 0) in 0/initialConditions
}
OUTLET
{
type $inOutBC; //read zeroGradient in 0/initialConditions
}
WALL
{
type fixedValue;
value uniform (0 0 0);
}
frontAndBackPlanes
{
type empty;
}
}
Second, let's see how #codeStream and #calc work - - - - well, these are not supported in foam-extend- (openfoam for windows) which is the version I use. (if anyone know how to use it, please let me know)
Finally, let's see the results:
A new file is created in the case file with:
touch 0/initialConditions
Write following lines in the file:
Velocity (40 0 0);
inOutBC zeroGradient;
#inputMode merge
In 0/U, we modify inlet and outlet BC using predefined values in 0/initialConditions.
dimensions [0 1 -1 0 0 0 0];
#include "initialConditions" //include initialConditions file
internalField uniform (0 0 0);
// a fixedValue;
boundaryField
{
INLET
{
type fixedValue;//$:a (: go to top level code)--------------------------->//$..a (go to 1 level up)
value uniform $Velocity; //read (40 0 0) in 0/initialConditions
}
OUTLET
{
type $inOutBC; //read zeroGradient in 0/initialConditions
}
WALL
{
type fixedValue;
value uniform (0 0 0);
}
frontAndBackPlanes
{
type empty;
}
}
Second, let's see how #codeStream and #calc work - - - - well, these are not supported in foam-extend- (openfoam for windows) which is the version I use. (if anyone know how to use it, please let me know)
Finally, let's see the results:
Top: SSTKWSAS, Middle: LESdynamicKEqn, Bot: LESsmagorinsky.
SSTKWSAS (simulated using Ansys Fluent)