CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

Scalar Field Residual

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   February 12, 2008, 15:24
Default Hi, All Does anybody know h
  #1
New Member
 
Dmitry Kovtunov
Join Date: Mar 2009
Location: Yekaterinburg, Ural, Russia
Posts: 8
Rep Power: 8
dak81 is on a distinguished road
Hi, All

Does anybody know how to calculate residual of
two scalar field with OpenFOAM?

I wanna get shorter code then that:

volScalarField residual("residual", T);

residual == mag(analytical - T);

doubleScalar maxResidual = 0.0;

forAll(residual, i) {
if (residual[i] > maxResidual) {
maxResidual = residual[i];
}
}

residual = maxResidual;

where analytical & T are of type volScalarField.
dak81 is offline   Reply With Quote

Old   February 12, 2008, 16:00
Default i.e. in my question i mean how
  #2
New Member
 
Dmitry Kovtunov
Join Date: Mar 2009
Location: Yekaterinburg, Ural, Russia
Posts: 8
Rep Power: 8
dak81 is on a distinguished road
i.e. in my question i mean how to find max element of volScalarField using OpenFOAM methods
dak81 is offline   Reply With Quote

Old   February 13, 2008, 02:32
Default How about "max(residual)"...?
  #3
Senior Member
 
dmoroian's Avatar
 
Dragos
Join Date: Mar 2009
Posts: 647
Rep Power: 11
dmoroian is on a distinguished road
How about "max(residual)"...?
dmoroian is offline   Reply With Quote

Old   February 13, 2008, 02:48
Default Ah, thanks. I found the decisi
  #4
New Member
 
Dmitry Kovtunov
Join Date: Mar 2009
Location: Yekaterinburg, Ural, Russia
Posts: 8
Rep Power: 8
dak81 is on a distinguished road
Ah, thanks. I found the decision by myself already.

max(mag(analytical - T)).value();

I was in trouble because i didn't use *.value(),
then max(mag(analytical - T)) was returning not scalar value.
dak81 is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculated Values in scalar field arkangel OpenFOAM Running, Solving & CFD 0 June 28, 2007 07:53
MeshPhi for scalar field in 14 gone tehache OpenFOAM Running, Solving & CFD 0 June 18, 2007 06:20
Passing scalar field across processors ankgupta8um OpenFOAM Running, Solving & CFD 1 June 7, 2006 03:32
Boundary scalar field segersson OpenFOAM Running, Solving & CFD 1 March 6, 2006 05:22
Set a fixed value of scalar in flow field. Ke Su FLUENT 0 June 20, 2003 14:47


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