CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   Conditional Expression in CFX Pre (https://www.cfd-online.com/Forums/cfx/100310-conditional-expression-cfx-pre.html)

ghorrocks May 16, 2012 22:48

Lots of options. You can:
1) Use a 1D interpolation function
2) Curve fit a function and stick that in as a CEL expression
3) use nested if statements, if(T>2000[K],if(T<1000[K],7000[kg m^-3],7500[kg m^-3]),8000[kg m^-3]) - this will return 7000, 7500 or 8000 depending on temperature.

Danial Q May 16, 2012 22:56

Hi Glenn
 
I am getting again and again these "clipping independent variables" warnings. What is that about?? even though loops are defined from 3-50 value for min to max. should i reduce my time step even more??


Thanks

Danial Q May 16, 2012 23:02

Hi Glenn
 
I am not familiar with programming stuff..is synatx available in CFX documents or i should use teh same as used for fortran.

Thanks

ghorrocks May 16, 2012 23:07

The clipping warning says soem properties went beyond the specified bounds. Either there is a region in your flow which exceeds your bounds, or the solution is not converged and weird material properties are being used. To investigate check the first one (find where in the model it is clipping and determine whether it is real), then if it is a convergence thing then try to make your model more numerically stable.

The syntax of CEL is in the CFX reference guide, and examples in the tutorials. It does not use fortran syntax.

Danial Q May 17, 2012 20:08

HI glenn
 
If between two domains (fluid & solid[CHT]) ,an interface is defined and under additional interface model tab ,heat transfer is selected also along with thermal contact resistance(with some value), Do i still need to provide heat source?? or solver will automatoically calculate it from fluid (release of heat)? Excerpts from AnSYS DOCUMENTS says it can automaticallly;

"Boundaries between domains that model heat transfer have temperatures and thermal fluxes calculated automatically, and should not have thermal boundary conditions specified. External boundaries (which can represent solids that are not explicitly modeled) require the specification of a thermal boundary condition."
Thanks

ghorrocks May 17, 2012 20:14

The interface automatically has the temperature coupled across the interface with zero contact resistance. You only need to change it if you want to add a heat source/sink, or a contact resistance.

Danial Q May 17, 2012 20:27

Hi
 
So, for specified thermal contact resistance or thin material, sources should be defined by user. If i define subdomain here with solid domain will it make solution better or it is unnecessary? Sorry for stupid questions but i am learning so need answers.

Thanks

ghorrocks May 17, 2012 20:34

There are many models to choose from.

If you want no contact resistance just leave it at the defaults.

If you want contact resistance use the contact resistance option. Alternately you can specify a thin material, but that just evaluated to a contact resistance so is a different way of doing the same thing.

If the user wants to apply a heat source or sink then use a source.

Subdomains a totally seperate things and are not related to interfaces. An interface connects two domains. A subdomain does not require an interface to connect it to its host domain, it is automatically coupled together.

Danial Q May 17, 2012 20:51

Hi Glenn
 
The reason for using thermal contact resistance in my case is , it should transfer all amount of heat to CHTsolid domain through interface. That is why i asked about it. And if i mention the value of thermal contact resistance then should i also mention Energy(heat) sources OR solver will calculate it by value of thermal contcat resistance and total heat released by fluid domain??

Thanks

ghorrocks May 17, 2012 21:00

I do not understand your question, and I suspect you do not understand how CFX implements contact resistance, heat sources and interfaces. Of course thermal contact resistance transfers all the heat, it increases the resistance so the total heat transferred is reduced.

Can I recommend you do some simple CFX experiments - join two solid regions with an interface and see what happens, then add contact resistance and see what happens, then add a heat source and see what happens. Then you might understand what is going on.

Danial Q May 18, 2012 00:42

Hi glenn
 
If the user wants to apply a heat source or sink then use a source.

Suppose I have two domains; fluid and solid and heat released by fluid should heat up the solid domain. In this case, can I mention this "heat released" as a source for solid domain?? or there is no need to define this heat specifically as a source for solid domain.
I doubt that sources only deal with external type heat injection like electricl or thermal heating etc.

ghorrocks May 18, 2012 00:49

When a fluid domain has an interface with a solid domain the default connection simply couples them together, so the heat flux into one is matched by the heat flux out of the other. At the interface heat in equals heat out. There is no need to specify sources.

If the interface gets heated by some magical means which you are not modelling, so the heat is simply "created" on the surface, and then shared between the solid and fluid domains, then an interface with a heat source will model it. Then you will not have balanced heat fluxes. The heat to the fluid and solid domains will equal the external heat.

Danial Q May 18, 2012 00:58

Hi Glenn
 
Thanks Mr GLENN! got it.
i have a plot which shows that cp and density changed when system reached from 3000 K to 300 K . On these basis ,can i assume that phase change occcured in system?

ghorrocks May 18, 2012 07:51

I will let you work that one out.

Danial Q May 19, 2012 05:06

Hi GLENN
 
1 Attachment(s)
Could you please explain what is this aerror about??

Details of error:-
----------------
Error detected by routine MAKDAT
CDANAM = LVAR CDTYPE = INTR ISIZE = 301
CRESLT = OLD

i have also attached output file, it returned with error code1.

Thanks

ghorrocks May 19, 2012 07:23

The actual error is a few lines earlier:

Code:

Fatal bounds error detected
  ---------------------------
  Variable: liquid Ni.Dynamic Viscosity
  Locale  : splat

liquid Ni.Dynamic Viscosity is set by a function nimu3 which is a CEL expression. I bet this expression evaluates to a negative number. You cannot have a negative viscosity. Well, at least not in this universe.

Danial Q May 19, 2012 23:07

ooooooooh gosh!!!
 
I did not have much data and I tried to define a function with two points data and missed the point.:mad:
Thanks

Danial Q May 21, 2012 00:31

HI Glenn
 
I have run my model with defined functions (corrected:)) and did not find any phase change. Should I go for finer mesh if it could help it.
Even I tried to chech free surface in post processing and unable to have any significant animation thing. I was thinking to do some finer meshing. Could you please suggest if it would be a good idea???

Is that the only one method (intersection method) described in free surface tutorial to observe free surface?

Thanks

ghorrocks May 21, 2012 00:41

The free surface is defined to be at volume fraction = 0.5, so a isosurface at VF=0.5 lies on the modelled free surface.

Danial Q May 21, 2012 01:33

HI
 
These are the functions generated for the free surface (from codes i got) and i doubt that they are not correct;

dist = sqrt((x - (50^-3) [mm]) ^2 + (y - (50^-3) [mm]) ^2 + (z + (10.5^-3) [mm]) ^2)

liquid = step((rdrop-dist)/1[mm])

rdrop = (10^-3) [mm]
But "NO" DELTA and smearedVF tan function (as given in thoery guide) while curvature factor is assumed 0.25 which ofcouse indicate the strong influence of surface tension.
Is it right or i should necessarily define Delta nd Smeared VF tan fn as suggested by guide.


All times are GMT -4. The time now is 06:44.