CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Boundary value problem

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 28, 2024, 10:10
Default Boundary value problem
  #1
New Member
 
Join Date: May 2024
Posts: 2
Rep Power: 0
Strajesko is on a distinguished road
Hello everyone,


I'm actually running a simulation for a Poiseuille flow on a modified version of icoFoam that contain a scalar transport.


When I try to impose a BC at the inlet for the scalar field I encounter some interpolation probem with the other BC (zeroGradient) imposed on the walls :bc.jpg


As you cas see, instead of staying at 0, the scalar value goes up to 0.65 at the bottom and the top wall.


I coded the BC like this :



Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2206                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    object      C;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 0 0 0 0 0];

internalField   uniform 0.13;

boundaryField
{
    top
    {
        type            zeroGradient;
    }

    floor
    {
        type            zeroGradient;
    }

    Inlet
    {
        type            codedFixedValue;
        value           uniform 0.;
        name            poiseuille;


        code
        #{
          const vectorField& Cf = patch().Cf();
          scalarField& field = *this;
          
          const scalar p0 = 1.52818931e-01;
          const scalar p1 = 1.09857452e-02 ;
          const scalar p2 = 1.14534928e-04 ;
          const scalar p3 = -5.58183299e-05;
          const scalar p4 = -3.93447609e-05;
          
          forAll(Cf, faceI)
          {
              const scalar y = Cf[faceI][1];
              
      
              field[faceI] = (p0+p1*y*1e6+p2*pow(y*1e6,2)+p3*pow(y*1e6,3)+p4*pow(y*1e6,4))*(erf(y*1e6+5)+erf(-y*1e6+6))/2+(erf(y*1e6+4)+erf(-y*1e6+6))/10*(1-(erf(y*1e6+5)+erf(-y*1e6+6))/2);
              
              
              

          }
        #};
    }
    

    Outlet
    {
    type         zeroGradient;
    }

    frontAndBack
    {
        type            empty;
    }
}


// ************************************************************************* //

Do you know how I could solve this issue ?


Thanks in advance
Strajesko 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
Table bounds warnings at: END OF TIME STEP CFXer CFX 4 July 16, 2020 23:44
CFD analaysis of Pelton turbine amodpanthee CFX 31 April 19, 2018 18:02
Centrifugal fan-reverse flow in outlet lesds to a mass in flow field xiexing CFX 3 March 29, 2017 10:00
Radiation interface hinca CFX 15 January 26, 2014 17:11
domain imbalance for enrgy equation happy CFX 14 September 6, 2012 01:54


All times are GMT -4. The time now is 20:18.