|
[Sponsors] |
July 2, 2009, 03:03 |
C_P and C_T not working for me
|
#1 |
New Member
songok
Join Date: Jul 2009
Posts: 4
Rep Power: 16 |
I have a simple C code
real temp= C_T(c,t); real press =C_P(c,t); rho = D*pow(press,B)/pow(temp,Q); for calculating density real gas.D,B and Q are all constants. if i hook up and iterate i get floating point error and when i add some constants value to temp and press it calculates and returns the density of the constant values and ignores the C_T and C_P... What should I do? |
|
July 2, 2009, 05:18 |
|
#2 |
Senior Member
Max
Join Date: Mar 2009
Posts: 133
Rep Power: 17 |
Hello mmoja,
this is just a presumption of what may went wrong, but C_P returns the static gauge pressure which may be a negative value depending on your operating pressure and boundary settings! Thus if constant B is not an even number pow(press,B) may become negative as well as your calculated density. A negative density is definitely a problem for any FV-code. cheers |
|
July 2, 2009, 15:19 |
|
#3 |
New Member
songok
Join Date: Jul 2009
Posts: 4
Rep Power: 16 |
Thanks for the reply, the constant B is 1.01 which is not an even number and my operating pressure is between 1-100bars...not atmospheric. Concerning the boundary conditions I have the gauge pressure as zero at the outlet pressure.... and mass flow for inlet boundary condition...
|
|
|
|