CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   density problem (https://www.cfd-online.com/Forums/cfx/25550-density-problem.html)

 snowshovel March 27, 2008 17:06

density problem

Guys,

I defined a new material in CFX with variable density and viscosity by using CEL. I did plot the density and viscosity in CFX-Pre which look great.

the problem is a simple liquid flow in duct. the inlet BC is mass flow rate and static temp. the outlet BC is static pressure. the wall is non-slip with a constant temp.

When I tried to run the case, I got a fetal error which is as follows,

Fetal Bounds Error Detected ----------------------------- Variable: Density

Details of Error ---------------------------- Error detected by routine: MAKDAT

CDANAM = LVAR CDTYPE = INTR ISIZE = 95 CRESLT = OLD

Anybody knows where the problem is?

thanks a lot

snowshovel

 Rogerio Fernandes Brito March 27, 2008 21:54

Re: density problem

Did u forget to put Cp and K?

 Rogerio Fernandes Brito March 27, 2008 21:59

Re: density problem

When u create a expression for a variable, don´t forget to put it in the same unit. See below.

Fluxrogerio

(B*(19453.29701*(t/A)^3.07678)/(4.73947^3.07678+(t/A)^3.07678))

A 1.0 [s] B 1.0 [W m^-2]

Observe that the name "Fluxrogerio" has the unit [W m^-2] or heat flux or rate of energy per area.

 Rogerio Fernandes Brito March 27, 2008 22:01

Re: density problem

t is the time in [s]!!

 snowshovel March 28, 2008 09:18

Re: density problem

Rogerio,

Thanks for your help. I defined Cp and K. And, all the units in my expression should be correct since I double checked the values and curves in CFX-Pre. The only thing is I use constant Cp and thermal conductivity since I don't have formula for them. For density and viscosity, I use equations to make the 2 variabls a function of temp.

Any thoughts?

thanks again.

snowshovel

 andy2O March 28, 2008 09:35

Re: density problem

Does your definition of density work for all values of pressure and temperature? Does it give sensible values at high and low pressures and temperatures?

I have had problems with this in the past:

In the initial stages of a calculation you can get big variations of pressure and temperature - so CFX may be trying to evaluate the density for very high or low pressures and temperatures and your correlation may be failing or giving unrealistic large or small values.

For a simple example, imagine if you had used:

density = sqrt( T - 273.15 K )

This would work fine for room temperature (T=294.15 K, or 21 deg C), but would fail immediately if T < 273.15 K (T<0 deg C) at *any* intermediate stage of the calculation.

It's worth checking, but I cannot guarantee this is the problem. Good luck. andy

 snowshovel March 28, 2008 09:52

Re: density problem

Andy,

That's what I'm worrying. My temperature range is -40 deg F --- 300 deg F. I tried to use a ploynomial equation for the specific heat at constant pressure. Now, the problem is something wrong w/ the specific heat, not density any more. Seems you're right. Do you have any idea to make a quick adjustment in CFX w/o changing my formula since I have to use them?

Snowshovel

 snowshovel March 28, 2008 10:19

Re: density problem

After defining the min and max temp under the "table generation" for my equation, CFX solver starts running. Thanks the help from you guys. Have a good weekend.

 CycLone March 28, 2008 10:31

Re: density problem

Hi Snowshovel,

Also make sure your density is a function of the Absolute Pressure (pabs), not Pressure (p). Pressure (p) is relative to the domain pressure and can be negative, which would result in a negative density, whereas the Absolute Pressure (pabs) includes the domain reference pressure.

-CycLone

 andy2O March 28, 2008 10:53

Re: density problem

Hmm... can you define a new variable, Tbound, as:

Tbound = max(min( Temperature, Tmax),Tmin)

or something like that and then write your polynomials for cp, density etc. in terms of Tbounded instead of T?

I think then:

Tbound = T for Tmin<T<Tmax Tbound = Tmin for T<Tmin Tbound = Tmax for T>Tmax

so as long as your formula work on the range [Tmin,Tmax], and your final temperatures all lie in this range you should be OK. There are lots of other similar options using CEL....

I bet there's an easier way though - but I can't think of it now. I hope others will post better advice.

 andy2O March 28, 2008 10:56

Re: density problem

"After defining the min and max temp under the "table generation" for my equation, CFX solver starts running."

That's much better than my min(...,max(...)) solution I just posted. I'll make a note of it myself!

Good luck, andy

 Rogerio Fernandes Brito March 28, 2008 19:44

Re: density problem

You´re welcome!

 snowshovel March 29, 2008 14:09

Re: density problem

CycLone,

Thanks for your comments. In my case, the density and viscosity are function of temp. only. However, your comments really make me know something new.

Thanks,

snowshovel

 snowshovel March 29, 2008 14:12

Re: density problem

Good method. Let's see any new thinking around?

 All times are GMT -4. The time now is 16:33.