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

How to evaluate a surfaceScalarField face by face?

Register Blogs Community New Posts Updated Threads Search

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

surfaceScalarField rhoPhi
(
IOobject
(
"rhoPhi",
runTime.timeName(),
mesh
),
dimensionedScalar("0",dimensionSet(1,0,-1,0,0),0)
);

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
(
IOobject
(
"rhoPhi2",
runTime.timeName(),
mesh
),
dimensionedScalar("0",dimensionSet(1,0,-1,0,0),0)
);

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?

Thanks!
Zheng.Zhi is offline   Reply With Quote

Old   July 15, 2013, 18:03
Default
  #2
Senior Member
 
Laurence R. McGlashan
Join Date: Mar 2009
Posts: 370
Rep Power: 23
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 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Netgen] Import netgen mesh to OpenFOAM hsieh OpenFOAM Meshing & Mesh Conversion 32 September 13, 2011 05:50
[blockMesh] BlockMeshmergePatchPairs hjasak OpenFOAM Meshing & Mesh Conversion 11 August 15, 2008 07:36
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 11:55
[blockMesh] Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Meshing & Mesh Conversion 10 April 2, 2007 14:00
[Commercial meshers] Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Meshing & Mesh Conversion 2 July 15, 2005 04:15


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