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

p and p_rgh in simple algorithm

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 13, 2024, 09:32
Default p and p_rgh in simple algorithm
  #1
Member
 
Kim jeamin
Join Date: Jul 2023
Posts: 36
Rep Power: 3
mongya is on a distinguished road
Hi, everyone.
I am new to openfoam and I am not sure the BCs that I set are right or not.
Should BCs in p_rgh file be the same as BCs in p file? Or Is it okay to consider them independently?
mongya is offline   Reply With Quote

Old   August 13, 2024, 10:13
Default
  #2
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,169
Rep Power: 27
Yann will become famous soon enough
Hello Kim,

For solvers using p_rgh, your BCs have to be defined in p_rgh.
p BCs would be usually set to calculated.

In such situation, have a look to the tutorials corresponding to the solver you want to use to see how the BCs are defined.

Yann
Yann is offline   Reply With Quote

Old   August 13, 2024, 20:17
Default
  #3
Member
 
Kim jeamin
Join Date: Jul 2023
Posts: 36
Rep Power: 3
mongya is on a distinguished road
Quote:
Originally Posted by Yann View Post
Hello Kim,

For solvers using p_rgh, your BCs have to be defined in p_rgh.
p BCs would be usually set to calculated.

In such situation, have a look to the tutorials corresponding to the solver you want to use to see how the BCs are defined.

Yann
Dear Yann
Thank you for your reply. I set BCs as you advised. But, I am not sure if my BCs are valid. It seems there is not any problem during iterations. Does it mean they are valid?

My BCs in p and p_rgh file are as follows :
BCs in p file
Code:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -2 0 0 0 0];

internalField   uniform 0;

boundaryField
{
/*  the tutorials :  floor
    {
        type            calculated;
        value           $internalField;
    }

    ceiling
    {
        type            calculated;
        value           $internalField;
    }

    fixedWalls
    {
        type            calculated;
        value           $internalField;
    }
*/	
	
	inlet1
    {
		type            zeroGradient;
    }
    inlet2
    {
        type            zeroGradient;
    }
    outlet
    {
        type            fixedValue;
        value           uniform 0;
    }
    airconditioner
    {
        type            zeroGradient;
    }
    wall1
    {
        type            zeroGradient;
    }	
}


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

BCs in p_rgh file
Code:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -2 0 0 0 0];

internalField   uniform 0;

boundaryField
{
/*  the tutorials :   floor
    {
        type            fixedFluxPressure;
        rho             rhok;
        value           uniform 0;
    }

    ceiling
    {
        type            fixedFluxPressure;
        rho             rhok;
        value           uniform 0;
    }

    fixedWalls
    {
        type            fixedFluxPressure;
        rho             rhok;
        value           uniform 0;
    }
*/	

	inlet1
    {
		type            zeroGradient;
		rho             rhok;
    }
    inlet2
    {
        type            zeroGradient;
		rho             rhok;
    }
    outlet
    {
        type            fixedValue;
		rho             rhok;
        value           uniform 0;
    }
    airconditioner
    {
        type            zeroGradient;
		rho             rhok;
    }
    wall1
    {
        type            zeroGradient;
		rho             rhok;
    }	
}


// ************************************************************************* //
Respectfully.
mongya is offline   Reply With Quote

Old   August 15, 2024, 05:55
Default
  #4
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,169
Rep Power: 27
Yann will become famous soon enough
Hello Kim,

The fact your case is able to run does not necessarily mean your setup is physically correct (OpenFOAM will crash or throw an error only if something in your setup is preventing it to solve the equations)

I see you copied and commented some BCs coming from tutorials, but you didn't use these BCs on the actual patches you have in your case.
In p_rgh, your patches defined as zeroGradient should use fixedFluxPressure instead (as it is done in the tutorials) and in p your BCs should be defined as calculated.

Regards,
Yann
Yann is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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



All times are GMT -4. The time now is 19:37.