Using an expression for d in atmBoundaryLayerInlet results in incorrect description upon writing
Summary
As the displacement height d in atmBoundaryLayerInlet boundary conditions is a PatchFunction1 I would like to use it to describe the local ground slope using an expression. When writing the data, the entry for d is replaced by a subDict that is verbatim the original entry for the entire patch.
Not sure, if this is relevant, but it looked close to the following issue: #2101 (closed)
Steps to reproduce
Run a simpleFoam simulation with an expression for the d entry in an atmBoundaryLayerInlet type of boundary condition and look at the output (U, k and omega all had the same issue) at write time.
Example case
The example input and output are shown in the k files in this archive: example.zip
What is the current bug behaviour?
The entry for d gets replaced with a subDict instead of the original input upon writing:
0/k:
`
domain
{
type atmBoundaryLayerInletK;
flowDir ( -0.000000 -1.000000 0 );
zDir (0 0 1);
Uref 5.0;
Zref 60.0;
z0 uniform 1.6;
initABL true;
value $internalField;
d expression;
expression "(pos().x() > 0.0) ? 0.0 : (pos().x() < -500.0) ? -5 + 2.5*((-pos().x()-500)/1000) : pos().x()/200 ";
}
25/k:
domain
{
type atmBoundaryLayerInletK;
initABL 0;
kappa 0.41;
Cmu 0.09;
C1 0;
C2 1;
flowDir constant (0 -1 0);
zDir constant (0 0 1);
Uref constant 5;
Zref constant 60;
z0 constant 1.6;
d
{
type atmBoundaryLayerInletK;
flowDir ( 0 -1 0 );
zDir ( 0 0 1 );
Uref 5;
Zref 60;
z0 uniform 1.6;
initABL true;
value uniform 1.0511;
d expression;
expression "(pos().x() > 0.0) ? 0.0 : (pos().x() < -500.0) ? -5 + 2.5*((-pos().x()-500)/1000) : pos().x()/200 ";
}
value nonuniform List<scalar>
8400 (.... ....);
`
What is the expected correct behavior?
The entry for d should be kept verbatim from the input, so the output is:
25/k:
`
domain
{
type atmBoundaryLayerInletK;
initABL 0;
kappa 0.41;
Cmu 0.09;
C1 0;
C2 1;
flowDir constant (0 -1 0);
zDir constant (0 0 1);
Uref constant 5;
Zref constant 60;
z0 constant 1.6;
d expression;
expression "(pos().x() > 0.0) ? 0.0 : (pos().x() < -500.0) ? -5 + 2.5*((-pos().x()-500)/1000) : pos().x()/200 ";
value nonuniform List<scalar>
8400 (.... ....);
`
Relevant logs and/or images
Environment information
- OpenFOAM version : v2412
- Operating system : OpenSUSE LEAP 15.5
- Hardware info : 192GB Ram, 24 core intel i9-14900K
- Compiler : gcc