CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Post-Processing

Calculate variable div zero

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   January 16, 2008, 12:44
Default Hi, a pretty simple one... I
  #1
Senior Member
 
Fabian Braennstroem
Join Date: Mar 2009
Posts: 407
Rep Power: 19
braennstroem is on a distinguished road
Hi,
a pretty simple one... I hope...

I would like to create a new postprocessing variable using:

volScalarField test
(
IOobject
(
"test",
runTime.timeName(),
mesh,
IOobject::NO_READ
),

(fvc::grad(U))/mag(fvc::laplacian(U.component(i)))
);
test.write();

This works fine as long as U.component(i) has some kind of value, but if the denominator is zero I get obviously an error. Can anyone give me an advice, how an 'if' question could look like? I tried somehting like: if (U.component(i)==0.0){...}

but I get:

test.C: In function 'int main(int, char**)':
test.C:128: error: expected primary-expression before 'if'

Fabian
braennstroem is offline   Reply With Quote

 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
RP_Set_Real("variable-name", variable name) bohis FLUENT 1 March 9, 2009 07:44
Post, Calculate Variable in plane Kordou CFX 1 October 14, 2008 16:39
hi how to calculate the HTC kathir Siemens 0 March 26, 2006 09:31
how to calculate y+ in cfx? micaheal CFX 3 November 21, 2005 14:45
how to calculate CL and CD zhaoyu FLUENT 1 April 24, 2001 09:56


All times are GMT -4. The time now is 07:48.