|
[Sponsors] |
August 10, 2015, 03:29 |
changing boundary cell value
|
#1 |
Member
Join Date: May 2014
Posts: 31
Rep Power: 11 |
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? |
|
August 11, 2015, 09:30 |
|
#2 |
Senior Member
Fumiya Nozaki
Join Date: Jun 2010
Location: Yokohama, Japan
Posts: 266
Blog Entries: 1
Rep Power: 18 |
Hi,
You can use faceCells() and might want to read my slide(http://www.slideshare.net/fumiyanoza...ogramming-tips). Best regards, Fumiya
__________________
[Personal]
|
|
|
|
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 |