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

Finding field value near boundary

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By doubtsincfd

Reply
 
LinkBack Thread Tools Display Modes
Old   December 28, 2011, 14:57
Default Finding field value near boundary
  #1
som
New Member
 
Serge Shlump
Join Date: Oct 2011
Posts: 24
Rep Power: 5
som is on a distinguished road
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.
som is offline   Reply With Quote

Old   December 29, 2011, 13:32
Default
  #2
Senior Member
 
Nima Sam
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,123
Blog Entries: 1
Rep Power: 14
nimasam is on a distinguished road
Send a message via Yahoo to nimasam
your question is vague, however maybe you can use scalarField type to save your data in it
nimasam is offline   Reply With Quote

Old   December 29, 2011, 16:21
Default
  #3
som
New Member
 
Serge Shlump
Join Date: Oct 2011
Posts: 24
Rep Power: 5
som is on a distinguished road
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.
som is offline   Reply With Quote

Old   December 29, 2011, 17:08
Default
  #4
Senior Member
 
Nima Sam
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,123
Blog Entries: 1
Rep Power: 14
nimasam is on a distinguished road
Send a message via Yahoo to nimasam
you can show it in terminal with Info
but if you want to save it in file you show use
IOStream
nimasam is offline   Reply With Quote

Old   December 29, 2011, 17:24
Default
  #5
som
New Member
 
Serge Shlump
Join Date: Oct 2011
Posts: 24
Rep Power: 5
som is on a distinguished road
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.
som is offline   Reply With Quote

Old   December 30, 2011, 03:17
Default
  #6
Senior Member
 
Join Date: Nov 2009
Location: Michigan
Posts: 135
Rep Power: 7
doubtsincfd is on a distinguished road
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
saba_saeb likes this.
doubtsincfd is offline   Reply With Quote

Old   December 30, 2011, 11:21
Default
  #7
som
New Member
 
Serge Shlump
Join Date: Oct 2011
Posts: 24
Rep Power: 5
som is on a distinguished road
doubtsincfd

Thanks for your response. It seems you've shown me right direction.
som is offline   Reply With Quote

Old   December 30, 2011, 17:35
Default
  #8
som
New Member
 
Serge Shlump
Join Date: Oct 2011
Posts: 24
Rep Power: 5
som is on a distinguished road
It works. One more stupid question. How can i take the maximum the value of a patch?
som is offline   Reply With Quote

Old   December 30, 2011, 17:47
Default
  #9
Senior Member
 
Join Date: Nov 2009
Location: Michigan
Posts: 135
Rep Power: 7
doubtsincfd is on a distinguished road
there is an in-built function max(fieldName). I havent used it but it should be pretty straightforward.

max for scalarField

link might help
doubtsincfd is offline   Reply With Quote

Old   December 30, 2011, 18:12
Default
  #10
som
New Member
 
Serge Shlump
Join Date: Oct 2011
Posts: 24
Rep Power: 5
som is on a distinguished road
It works.Thank you!
som is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Domain Imbalance HMR CFX 3 March 6, 2011 21:10
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 08:40


All times are GMT -4. The time now is 02:37.