|
[Sponsors] |
August 17, 2010, 05:13 |
dynamic viskosity field function
|
#1 |
New Member
Join Date: Jun 2010
Posts: 3
Rep Power: 15 |
Hello,
i have the following problem: Turbulent Flow non newton viskosity (paint) i have to create an user defined field function for viskosity depends on strainrate. my formulation is: ($StrainRate <= 10) ? 0.01 : ((10 < $StrainRate > 1000 ) : (1.35*$StrainRate*pow(-0.25)) : 0.14)
What is wrong with my formulation? Thank you for your answer! Jarry |
|
August 17, 2010, 06:56 |
|
#2 |
New Member
sven
Join Date: Jul 2010
Location: Germany
Posts: 7
Rep Power: 15 |
The tertiary operator works like this
(if) ? (then) : (else) if you want to use multiple if clauses use (if1) ? (then1) : ( (if2) ? (then2) : ( (if3) ? (then3) : (finalElse) ) ) in your case it should be something like this: ($StrainRate <= 10) ? 0.01 : ( ($StrainRate < 1000 ) ? (1.35*$StrainRate*pow(-0.25)) : 0.14 ) ============================= (10 < $StrainRate > 1000 ) <-- you already checked in the first if clause that $StrainRate > 10, so its unnecessary to check it again you use an > then where I assume < |
|
August 18, 2010, 04:53 |
|
#3 |
New Member
Join Date: Jun 2010
Posts: 3
Rep Power: 15 |
Hello svenne,
thank you for your answer. I tried you formulation, but you make a little mistake. This are the formulation that works: ($StrainRate < 10) ? 0.01 : (($StrainRate < 1000 ) ? (3.2*pow($StrainRate,-0.35)) : 0.14) For all ather users who have the same problem. jarry |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
LiencubiclowRemodel | nzy102 | OpenFOAM Bugs | 14 | January 10, 2012 08:53 |
UDF vs Custom field function | andrew | FLUENT | 5 | June 24, 2011 10:53 |
[blockMesh] BlockMesh FOAM warning | gaottino | OpenFOAM Meshing & Mesh Conversion | 7 | July 19, 2010 14:11 |
field function in STAR-CCM+ | stu | Siemens | 1 | May 9, 2008 11:11 |
Custom Field function...>>>Please HELP..! | sushii | FLUENT | 2 | October 11, 2007 01:04 |