|
[Sponsors] |
March 9, 2011, 06:54 |
conditional CEL function
|
#1 |
Member
anonymous
Join Date: Jan 2011
Posts: 42
Rep Power: 15 |
Hi all ;
How can I set a cel function in CfX PRE to make this expression : sigma = 0.5 for z > 1 end sigma = 0 for z<=1 sigma is constant value. thanks. |
|
March 9, 2011, 07:12 |
|
#2 |
New Member
Join Date: Oct 2010
Posts: 14
Rep Power: 15 |
CEL supports the conditional if statement using the following syntax:
if( cond_expr, true_expr, false_expr ) where: cond_expr: is the logical expression used as the conditional test true_expr: is the mathematical expression used to determine the result if the conditional test is true. false_expr : is the mathematical expression used to determine the result if the conditional test is false. Then for your case, CEL expression is if(z > 1,0.5, 0) |
|
March 9, 2011, 08:20 |
|
#3 |
Member
anonymous
Join Date: Jan 2011
Posts: 42
Rep Power: 15 |
thanks oktavyo ;
but is the condition if(z > 1,0.5, 0) return the true value 0.5? how can I write it sigma = if(z > 1,0.5, 0) ? |
|
March 9, 2011, 08:23 |
|
#4 |
New Member
Join Date: Oct 2010
Posts: 14
Rep Power: 15 |
Just set the name of the expression as sigma and use it where you need
|
|
March 9, 2011, 08:28 |
|
#5 |
Member
anonymous
Join Date: Jan 2011
Posts: 42
Rep Power: 15 |
thanks octavyo
|
|
March 10, 2011, 06:40 |
|
#6 |
Member
anonymous
Join Date: Jan 2011
Posts: 42
Rep Power: 15 |
Hi oktavyo ;
need a doc about CEL Function if possible . |
|
March 10, 2011, 07:25 |
|
#7 |
New Member
Join Date: Oct 2010
Posts: 14
Rep Power: 15 |
I think CFX Help menu is good enough to solve most of problems. Just read the user manuel about CEL. You can also download training document from ansys costumer portal. or search on google.
|
|
March 11, 2011, 11:38 |
|
#8 |
Member
anonymous
Join Date: Jan 2011
Posts: 42
Rep Power: 15 |
Hi octavyo ;
I used the conditional expression but it seems not working ! |
|
March 11, 2011, 12:32 |
|
#9 |
Member
anonymous
Join Date: Jan 2011
Posts: 42
Rep Power: 15 |
the if function don't found in cfx 11 !
|
|
March 12, 2011, 07:36 |
|
#10 |
New Member
Join Date: Oct 2010
Posts: 14
Rep Power: 15 |
If possible, try to use CFX 12
|
|
November 14, 2016, 13:17 |
|
#11 |
New Member
mao
Join Date: Mar 2016
Posts: 20
Rep Power: 10 |
hi, have you solved this, i want expressT322= if(0.1<E22<0.2,T3-0.5, T3) , but it always say it is not correct using 0.1<E22<0.2.
|
|
November 14, 2016, 15:50 |
|
#12 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143 |
Just use nested if statements:
expressT322= if(0.1<E22,if(E22<0.2,T3-0.5, T3),T3) Note that you have not defined units. You should define units if these quantities have units. |
|
November 17, 2016, 09:44 |
|
#13 |
New Member
mao
Join Date: Mar 2016
Posts: 20
Rep Power: 10 |
yes, thank you so much, i used this.
|
|
November 8, 2017, 17:05 |
cfl in cfx
|
#14 |
New Member
masod
Join Date: Nov 2017
Posts: 1
Rep Power: 0 |
hi all:
haw can i write a exprision for time dippendent udf? |
|
November 9, 2017, 01:31 |
|
#15 |
Senior Member
urosgrivc
Join Date: Dec 2015
Location: Slovenija
Posts: 365
Rep Power: 11 |
You can use wariables like (acumulated timestep, time or time this run) and similar;
something like; if(accumulated timestep>10,1,0) ...(1,0) can have units and can be any number or seperate expression like next example. something like; if(time>5[s],10[W m^-2],5[W m^-2]) ...5[W m^-2] <=> could also be an expresion dependant on other stuf, maybe temperature or angular velocity or whatever, the sky is the limit. It is also posible to do it in the second way: For time (or anithing else) dependant wariables it is very easy to use a user function, basicaly a table of your data from vhich cfx selects the corect walue for that time. +You firs create a new user function named (userfun)>vrite units (like [s] for time and your variable let just use [W m^-2] for this example) +than you write the table of data +than you make a new expresion caled let say (expresiont) and for the function you use userfun[t] this will cause cfx to go look in the table and choose the corect number for [W m^-2] in this case. this [t] will cause it to be time dependant but it can also be used in meny other ways like [T] temperature dependant or vhatever so it is quite a powerfull tool. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Compile problem | ivanyao | OpenFOAM Running, Solving & CFD | 1 | October 12, 2012 09:31 |
ParaView for OF-1.6-ext | Chrisi1984 | OpenFOAM Installation | 0 | December 31, 2010 06:42 |
latest OpenFOAM-1.6.x from git failed to compile | phsieh2005 | OpenFOAM Bugs | 25 | February 9, 2010 04:37 |
Error with Wmake | skabilan | OpenFOAM Installation | 3 | July 28, 2009 00:35 |
[blockMesh] Axisymmetrical mesh | Rasmus Gjesing (Gjesing) | OpenFOAM Meshing & Mesh Conversion | 10 | April 2, 2007 14:00 |