|
[Sponsors] |
December 28, 2011, 14:57 |
Finding field value near boundary
|
#1 |
New Member
Serge Shlump
Join Date: Oct 2011
Posts: 24
Rep Power: 15 |
Hello. I have some scalar field and need to find its value for all cells near some boundary. I need to have array or something like that with values on every timestep. How can i do it? I use some modification of pimpleDyMFoam solver.
|
|
December 29, 2011, 16:21 |
|
#3 |
New Member
Serge Shlump
Join Date: Oct 2011
Posts: 24
Rep Power: 15 |
Thanks for reply.
I'm asking not about type where i can save my data. Actualy I need to printf value of scalar field near the specified boundary. |
|
December 29, 2011, 17:24 |
|
#5 |
New Member
Serge Shlump
Join Date: Oct 2011
Posts: 24
Rep Power: 15 |
yep, i understand that. But the question is how to find cells which are near the specific boundary.
What I have 1) Boundary 2) Field in space I need to know (i.e. print it to console) field value in the boundary layer. |
|
December 30, 2011, 03:17 |
|
#6 |
Senior Member
Join Date: Nov 2009
Location: Michigan
Posts: 135
Rep Power: 17 |
const fvPatchList& patches = mesh.boundary();
forAll(patches,patchi) { const fvPatch& currPatch = patches[patchi]; if(currPatch.name()=="nameOfThePatch") { Info<<U.boundaryField()[patchi].patchInternalField()<<endl; } } Let me know if this works patchInternalField() gives you the values at cell centers of cells near the boundary |
|
December 30, 2011, 11:21 |
|
#7 |
New Member
Serge Shlump
Join Date: Oct 2011
Posts: 24
Rep Power: 15 |
doubtsincfd
Thanks for your response. It seems you've shown me right direction. |
|
December 30, 2011, 17:35 |
|
#8 |
New Member
Serge Shlump
Join Date: Oct 2011
Posts: 24
Rep Power: 15 |
It works. One more stupid question. How can i take the maximum the value of a patch?
|
|
December 30, 2011, 17:47 |
|
#9 |
Senior Member
Join Date: Nov 2009
Location: Michigan
Posts: 135
Rep Power: 17 |
there is an in-built function max(fieldName). I havent used it but it should be pretty straightforward.
http://www.cfd-online.com/Forums/ope...alarfield.html link might help |
|
December 30, 2011, 18:12 |
|
#10 |
New Member
Serge Shlump
Join Date: Oct 2011
Posts: 24
Rep Power: 15 |
It works.Thank you!
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Domain Imbalance | HMR | CFX | 5 | October 10, 2016 06:57 |
how to give boundary conditions:-calculated type of primitive boundary field | suniljain | OpenFOAM Running, Solving & CFD | 1 | March 20, 2010 01:19 |
On the far field boundary conditions. | mini | FLUENT | 7 | January 11, 2005 21:53 |
Far field Boundary condition | Ma | Main CFD Forum | 1 | April 1, 2001 09:40 |