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. 
The totalPressure and totalTemperature BC's are what you should be using.

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.

and what should be defined for velocity field with totalPressure and totalTemperature?
How can i know how these models work? 
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:

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_maxpos().y)/vel_r+time_2<time()&&time()<time_3)?1:0"; valueExpression "pr_02*pow((1+(gamma1)/2*magsqr(internalField(U))/(gamma*R_g*internalField(T))),(gamma/(gamma1)))"; value uniform 100000; gradientExpression "0"; //type fixedValue; //value uniform 250000; } 
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.

thank you.you mean what BC should I set for velocity then?(I don't know that)
and whats psi definition? thanks. 
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. 
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? 
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.

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


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 08:20. 