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

help for a piece of code

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   August 2, 2012, 23:43
Default change values of a surfaceSalarField at boundary
  #1
New Member
 
kob
Join Date: Nov 2011
Posts: 28
Rep Power: 14
bryant_k is on a distinguished road
Hello everyone
I want to change values of a surfaceSalarField sphi at boundary 'surface'.To other regions,the values keep default.So I write a piece of code :
Code:
sphi=sigma*(interpolate(U) &mesh.Sf())-fvc::snGrad(ha);

label patchI=mesh.boundaryMesh().findPatchID("surface");
forAll(sphi,patchI)
{
sphi[patchI]=sigma*(interpolate(U) &mesh.Sf());
}

But this is wrong.So can you tell me how to modify the above code?

regards!

bryant

Last edited by bryant_k; August 3, 2012 at 02:58.
bryant_k is offline   Reply With Quote

 

Tags
change values


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
The FOAM Documentation Project - SHUT-DOWN holger_marschall OpenFOAM 242 March 7, 2013 12:30
How to make code run in parallel? cwang5 OpenFOAM Programming & Development 1 May 30, 2011 04:47
Open Source Vs Commercial Software MechE OpenFOAM 28 May 16, 2011 11:02
Design Integration with CFD? John C. Chien Main CFD Forum 19 May 17, 2001 15:56
public CFD Code development Heinz Wilkening Main CFD Forum 38 March 5, 1999 11:44


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