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

changing boundary cell value

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By kcn
  • 1 Post By fumiya

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 10, 2015, 03:29
Default changing boundary cell value
  #1
kcn
Member
 
Join Date: May 2014
Posts: 31
Rep Power: 11
kcn is on a distinguished road
Hi,

I used the following piece of code to change the boundary condition of a certain patch during each solver iteration.

label patchID = mesh.boundaryMesh().findPatchID("name of patch");

const polyPatch& cPatch = mesh.boundaryMesh()[patchID];


forAll (cPatch,faceI)
{

U.boundaryField()[patchID][faceI] == expression;

}

I need to define a source term which is only present at the cells that are attached to a particular patch. I hope to do this by first declaring a field that is every where zero and then during solution updating the values attached to the patch of interest, similar to updating the boundary face values in above code.

Can some one please tell me how to modify the code to access and change the values of cells attached to a boundary patch?
erinsam likes this.
kcn is offline   Reply With Quote

Old   August 11, 2015, 09:30
Default
  #2
Senior Member
 
fumiya's Avatar
 
Fumiya Nozaki
Join Date: Jun 2010
Location: Yokohama, Japan
Posts: 266
Blog Entries: 1
Rep Power: 18
fumiya is on a distinguished road
Hi,

You can use faceCells() and might want to read my slide(http://www.slideshare.net/fumiyanoza...ogramming-tips).

Best regards,
Fumiya
adamonov likes this.
__________________
[Personal]
fumiya 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
Wind turbine simulation Saturn CFX 58 July 3, 2020 01:13
Low torque values on Screw Turbine Shaun Waters CFX 34 July 23, 2015 08:16
Error finding variable "THERMX" sunilpatil CFX 8 April 26, 2013 07:00
Solution Diverging with Trimmer Mesh rietuk STAR-CCM+ 8 February 27, 2013 04:50
[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 21:01.