CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

Velocity profile using "wallDistance" in expression

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 12, 2021, 05:37
Default Velocity profile using "wallDistance" in expression
  #1
DJF
New Member
 
Join Date: Jan 2019
Posts: 12
Rep Power: 7
DJF is on a distinguished road
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
DJF is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
kindly help me .. i have and error at line number 147.. m zubair Fluent UDF and Scheme Programming 0 February 10, 2019 12:25
Expression for calculating friction velocity Divyaprakash Main CFD Forum 0 October 1, 2015 03:03
3d velocity profile at velocity inlet swethaprakash FLUENT 3 September 1, 2015 03:10
Velocity profile boundary condition Tuca FLOW-3D 1 April 23, 2013 13:02
Prescribed inflow velocity profile - how to? Alan Main CFD Forum 10 October 28, 2005 13:14


All times are GMT -4. The time now is 06:30.