CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   A way to modelling p0 T0 BC (https://www.cfd-online.com/Forums/openfoam-solving/110277-way-modelling-p0-t0-bc.html)

immortality December 6, 2012 18:02

A way to modelling p0 T0 BC
 
imagine we have very very huge reservoir that connects to a pipe and we want to analyze the flow in it.we know p and T at the reservoir and don't want to waste our valuable time to investigate flow at reservoir to find the velocity at outlet of it.on the other hand this reservoir is very huge and takes a lot of time analyzing it that even is useless for us because we want grasp only flow in the pipe.
Now the question is how we can set the boundary conditions at the inlet of the pipe that could precisely model what occurs in real world.
Your responce's and suggestions are appreciated.

mturcios777 December 6, 2012 19:53

The totalPressure and totalTemperature BC's are what you should be using.

immortality December 7, 2012 04:10

oh,i forgot to tell that it should be modelled in groovybc because the real problem that have to model is changing from p0 T0 to another BC mean moving wall.then is it possible this situation without groovybc?or how to model in groovybc.

immortality December 7, 2012 04:41

and what should be defined for velocity field with totalPressure and totalTemperature?
How can i know how these models work?

adambarfi December 7, 2012 09:27

Why you don't apply fixedValue for velocity at inlet? it's known from your post that fixed velocity can be appropriated for inlet.

Quote:

Originally Posted by immortality (Post 396226)
and what should be defined for velocity field with totalPressure and totalTemperature?
How can i know how these models work?

just go to 'scr\finiteVolume\fields\fvPatches\derived' and find the BC you want to use. In the .C file you can see the needed parameters.

immortality December 7, 2012 11:30

because we don't know the velocity.we only know p0 and T0.
Its possible assign a guess for velocity but it will not be accurate this way.
if I set inletOutlet for velocity how value should I put for it?
I have examined several methods but OpenFOAM gives only float exception error.
for example I applied this BC for pressure,is there any error in it?

boundaryField
{
right
{
type zeroGradient;
}

left
{
type groovyBC;

variables (

//"pi=3.1415926535;"
"y_max=max(pos().y);"
"y_min=min(pos().y);"
"r=0.06;"
"rpm=3600;"
"omegav=rpm*pi/30;"
"vel_r=r*omegav;"
"tetha_1=11*pi/180;"
"tetha_2=60*pi/180;"
"tetha_3=90*pi/180;"
"time_1=tetha_1/omegav;"
"time_2=tetha_2/omegav;"
"time_3=tetha_3/omegav;"
"time_final=0.005;"
"pr_01=250000;"
"Tr_01=288;"
"pr_02=100000;"
"Tr_02=288;"
"gamma=1.4;"
"R_g=287.14;"

);

fractionExpression "((y_max-pos().y)/vel_r+time_2<time()&&time()<time_3)?1:0";

valueExpression "pr_02*pow((1+(gamma-1)/2*magsqr(internalField(U))/(gamma*R_g*internalField(T))),(-gamma/(gamma-1)))";
value uniform 100000;
gradientExpression "0";

//type fixedValue;
//value uniform 250000;
}

mturcios777 December 7, 2012 12:02

The totalPressure and totalTemperature BCs will adjust the static temperature and pressure based on flow characteristics so that the total pressure remains constant. You need entries for the velocity and flux fields, as well as what you are using to calculate density or compressibility. If you have a thermo model that outputs rho, use that; otherwise you need to specify either psi or gamma.

immortality December 7, 2012 12:13

thank you.you mean what BC should I set for velocity then?(I don't know that)
and whats psi definition?
thanks.

mturcios777 December 7, 2012 16:39

You'll need to do some reading up on compressible gas models for the definition of psi, there is too much to go into through the forum.

As for U BCs, do you want to determine the flowrate from the resevoir? Will it be inflow or outflow. If you can answer these questions, you should be able to determine what BCs you should use.

immortality December 12, 2012 06:53

I can't understand the code defenitly.
how does it calculate p0 ?
if we dont define psi and only define rho a compressible formula is used?

mturcios777 December 12, 2012 12:06

The totalPressure and totalTemperature BCs have you specify if you want to calculate the total pressure/temperature by using rho, psi or by specifying the specific heat ratio. The static pressure/temperature on the boundary is adjusted so that the total pressure/temperature remains constant.

immortality December 14, 2012 03:25

could you tell me a hint so i understand what psi is?

mturcios777 December 14, 2012 12:09

Start here: http://en.wikipedia.org/wiki/Compressibility_factor

immortality June 24, 2013 10:51

Hi
I think its the time for describe some things:
psi is:1/(R*T) that R=R_u/M,M is molecular mass of the specified gas
I have a long explanations about how totalPressure and totalTemperature work that will put them here later if I remember or if someone needs,don't hesitate to notice me to explain.


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