CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM

How to evaluate a surfaceScalarField face by face?

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

LinkBack Thread Tools Display Modes
Old   July 15, 2013, 15:25
Default How to evaluate a surfaceScalarField face by face?
New Member
Join Date: Jul 2009
Location: LanZhou China
Posts: 10
Rep Power: 10
Zheng.Zhi is on a distinguished road
Sponsored Links
rhoPhi is defined as

surfaceScalarField rhoPhi

and it is updated after alphaEqn solved.

Now I want to create a new surfaceScalarField rhoPhi2 ,which is a function of rhoPhi, so I define

surfaceScalarField rhoPhi2

and evaluate rhoPhi2 face by face :

forAll (rhoPhi2 , facei)
rhoPhi2[facei] = rhoPhi[facei];

but it doesn't work as same as

rhoPhi2 = rhoPhi;

Is there any mistake in my testing code? And How to evaluate a surfaceScalarField face by face?

Zheng.Zhi is offline   Reply With Quote
Sponsored Links

Old   July 15, 2013, 18:03
Senior Member
Laurence R. McGlashan
Join Date: Mar 2009
Posts: 370
Rep Power: 16
l_r_mcglashan will become famous soon enough
Have a look at what operator= does for fields in GeometricField.C

You need to also loop over boundaries. I would question why you need to loop though.
Laurence R. McGlashan :: Website
l_r_mcglashan is online now   Reply With Quote


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
Import netgen mesh to OpenFOAM hsieh Open Source Meshers: Gmsh, Netgen, CGNS, ... 32 September 13, 2011 05:50
BlockMeshmergePatchPairs hjasak OpenFOAM Native Meshers: blockMesh 11 August 15, 2008 07:36
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 12:55
Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Native Meshers: blockMesh 10 April 2, 2007 14:00
Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 2 July 15, 2005 04:15

Sponsored Links

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