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

Difference between exact value and calculated value

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 18, 2011, 08:31
Default Difference between exact value and calculated value
  #1
OFU
New Member
 
Jennifer
Join Date: Aug 2009
Location: Germany
Posts: 28
Rep Power: 16
OFU is on a distinguished road
Hi,

I want to calculate Teps of the the following equation:

T0 (1 + Teps) = T

T0 is the exact solution and T the solution calculated by OpenFOAM in each time step.

For the internalField it works. And also if an boundary patch is defined as type inletOutlet with an uniform inletValue and an uniform value it works too. But if an patch is defined as type zeroGradient or type fixedValue with an uniform value, the calculation of Teps seems not to work. Then the mentioned patches of the boundary field of Teps look the same as the boundary fields in T.
Does anybody know how I can get the right values of these patches?
I want to calculate the same for p, rho and U.
Or are there already applications in OpenFOAM, which calculate the difference between an exact value and the values calculated by OpenFOAM?

Thanks in advance,
Jennifer
OFU is offline   Reply With Quote

Old   August 19, 2011, 05:19
Default
  #2
Senior Member
 
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 21
eugene is on a distinguished road
The trick is to create your result field independent of the input fields so that it uses a "calculated" type boundary everywhere. Then the assignment should work fine.

Something like:

volScalarField Teps
(
IOobject
(
blah blah blah
),
mesh,
dimensionedScalar("Teps", T.dimensions(), 0.0)
);

Teps = some functions of T and T0
eugene is offline   Reply With Quote

Old   August 19, 2011, 06:10
Default
  #3
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
Did you call

T.correctBoundaryConditions();

after updating the internal field?

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Reply


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



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