|
[Sponsors] |
April 24, 2012, 04:37 |
if statement for volScalarField
|
#1 |
Member
Anja Miehe
Join Date: Dec 2009
Location: Freiberg / Germany
Posts: 48
Rep Power: 17 |
Hello Foamers,
I want to code an if condition for a volScalarField and I do get errors in compiling that the if statement does not work. Code:
volScalarField T volScalarField lambda ( IOobject ( "lambda", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), if (T>Tf)? 0 : pow((Tf-T)/(Tf-Tl),-0.35) ) Any other coding idea is welcome as well. Thanks in advance, Regards, Anja |
|
April 24, 2012, 06:00 |
|
#2 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30 |
Use pos() and neg(): pos(T - Tf)* pow((Tf-T)/(Tf-Tl),-0.35)
__________________
*On twitter @akidTwit *Spend as much time formulating your questions as you expect people to spend on their answer. |
|
April 24, 2012, 08:01 |
|
#3 |
Member
Anja Miehe
Join Date: Dec 2009
Location: Freiberg / Germany
Posts: 48
Rep Power: 17 |
Hello akidess,
and thank you very much. That was the basic idea I needed. To make it work finally, I changed it a little bit using the magnitude: Code:
pos(Tf-T)*pow(mag(Tf-T)/(Tf-Tl),-0.35) Thanks again, Anja |
|
Tags |
if volscalarfield |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Conditional statement over the entire mesh | xisto | OpenFOAM Programming & Development | 6 | November 24, 2010 13:13 |
If Statement | Zaktatir | CFX | 5 | June 19, 2010 07:09 |
Weak statement for Galerkin Method | rugabug | Main CFD Forum | 0 | March 26, 2010 20:19 |
Need help with statement in Gambit | kbs | FLUENT | 16 | May 9, 2008 09:15 |
marking statement in Latex | mike | Main CFD Forum | 0 | October 8, 2006 13:01 |