November 12, 2021, 04:37
|
Velocity profile using "wallDistance" in expression
|
#1
|
New Member
Join Date: Jan 2019
Posts: 12
Rep Power: 8
|
I want to set a velocity profile at the inlet boundary as a function of the vertical distance to the non-planar ground surface. I'm using OpenFOAM v2106. So far I've obtained a volScalarField of wallDistance using the checkMesh utility and setting in system/fvSchemes:
Code:
wallDist
{
method directionalMeshWave;
normal (0 0 1);
}
The volSacalarField is in 0/wallDistance and looks like this:
Code:
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object wallDistance;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 0 0 0 0 0];
internalField nonuniform List<scalar>
2610223
(
34.4376
36.2435
36.5364
...
In the 0/U file I want to set for the inlet boundary the x-component of U as a function of the wallDistance using an expression. (It works using the z-coordinate pos().z() but I need instead the wallDistance since the ground surface ist not planar):
Code:
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U;
}
// ============================================== //
dimensions [ 0 1 -1 0 0 0 0 ];
internalField uniform (7.9 0 0);
boundaryField
{
ground
{
type noSlip;
}
"(sides|top)"
{
type symmetry;
value $internalField;
}
inlet
{
type uniformFixedValue;
uniformValue
{
type expression;
variables
(
"z0 = 0.08" //[m] roughness length
"zRef = 4.5" //[m] reference height
"Uref = 7.9" //[m/s] wind speed @zRef
);
expression
#{
vector(Uref/log(zRef/z0)*log(wallDistance/z0), 0, 0) //[m/s] wind profile log-law
#};
}
}
outlet
{
type pressureInletOutletVelocity;
value $internalField;
}
}
However the Object wallDistance doesn't exist for the solver when I run the simulation. How can I use the volScalarField wallDistance in an expression for the inlet boundary? Should I read it before?
I've tried the solutions in wallDist already without success
|
|
|