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

boundaryField vs. internalField

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By AlmostSurelyRob

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 14, 2011, 08:23
Default boundaryField vs. internalField
  #1
Member
 
Sebastian Lang
Join Date: Aug 2009
Posts: 47
Rep Power: 17
sebonator is on a distinguished road
Hi there,

maybe this sounds a bit like a stupid question, but the answer is not clear to me:

Can you tell me, what the 'boundaryField', like it is returned for example from a volScalarField by

Code:
volScalarField.boundaryField();
really is? Are those values the values of the cells that are located next to the boundary (=> The very first cells when you move from the patch into your field???) or are those values the values of the faces which lie on the patch?

This makes a difference!

Thanks in advance,
Greetings Sebastian
sebonator is offline   Reply With Quote

Old   January 14, 2011, 08:42
Default
  #2
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
akidess will become famous soon enough
I'm pretty sure it's the patch value. The near-patch cell values can be read by patchInternalField I think.
akidess is offline   Reply With Quote

Old   January 14, 2011, 09:50
Talking Problem solved!!!
  #3
Member
 
Sebastian Lang
Join Date: Aug 2009
Posts: 47
Rep Power: 17
sebonator is on a distinguished road
Thanks Anton!

Greetings Sebastian
sebonator is offline   Reply With Quote

Old   January 14, 2011, 10:45
Default
  #4
Senior Member
 
Robert Sawko
Join Date: Mar 2009
Posts: 117
Rep Power: 22
AlmostSurelyRob will become famous soon enough
As suggested above through this construct you can access patch values. You can also reinforce it with an id in a following way
Code:
q.boundaryField()[i]
where i is the ID of your patch as stated in blockMeshDict.

Another example is:
Code:
 sum( q.boundaryField()[i] * mesh.Sf().boundaryField()[i] );
which will calculate a surface integral of quantity q on patch i.

Hope that helps.



mm.abdollahzadeh likes this.

Last edited by AlmostSurelyRob; January 14, 2011 at 12:38.
AlmostSurelyRob is offline   Reply With Quote

Old   January 14, 2011, 11:53
Default
  #5
Senior Member
 
Ben K
Join Date: Feb 2010
Location: Ottawa, Canada
Posts: 140
Rep Power: 19
benk is on a distinguished road
Along the same line of questioning, how can I access the value at a corner of a 2D mesh?
benk is offline   Reply With Quote

Old   January 17, 2011, 05:45
Default
  #6
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
akidess will become famous soon enough
I don't think you can, because values are not stored on vertices. You will have to manually find the corner cell and then interpolate the appropriate face values to get something at the corner.
akidess is offline   Reply With Quote

Old   January 17, 2011, 09:13
Default
  #7
Member
 
Sebastian Lang
Join Date: Aug 2009
Posts: 47
Rep Power: 17
sebonator is on a distinguished road
Hi Ben,

I don't really know a correct answer for your question, but I doubt that there is a method in volVectorField or volScalarField that returns such a "corner" value.

Maybe you can create the value with some "if"-construct, because such a corner cell would be defined as "a cell that has two different patches on two of her faces". I can't tell a proper implementation, but maybe that's something you can start from!

But as Anton already mentioned, you will have to separate between cell-centre-values and face-centre values.

Hope that helps,
Greetings Sebastian
sebonator is offline   Reply With Quote

Old   January 24, 2011, 16:25
Default
  #8
Senior Member
 
Mirko Vukovic
Join Date: Mar 2009
Posts: 159
Rep Power: 17
mirko is on a distinguished road
Quote:
Originally Posted by AlmostSurelyRob View Post
As suggested above through this construct you can access patch values. You can also reinforce it with an id in a following way
Code:
q.boundaryField()[i]
where i is the ID of your patch as stated in blockMeshDict.

Another example is:
Code:
 sum( q.boundaryField()[i] * mesh.Sf().boundaryField()[i] );
which will calculate a surface integral of quantity q on patch i.

Hope that helps.



I am writing a boundary condition (I will use oscillatingFixedValue as guide) in a radiation problem, which calculates Qr (see fvDOM.c). I want to get the patch value using the procedure you describe.

But, how can I get hold of Qr? I am assuming it is a property of the fvDOM object. I'm not sure how to get hold of it in my code.

Thank you,

Mirko
mirko is offline   Reply With Quote

Old   January 24, 2011, 16:48
Default
  #9
Senior Member
 
Robert Sawko
Join Date: Mar 2009
Posts: 117
Rep Power: 22
AlmostSurelyRob will become famous soon enough
Quote:
Originally Posted by mirko View Post
I am writing a boundary condition (I will use oscillatingFixedValue as guide) in a radiation problem, which calculates Qr (see fvDOM.c). I want to get the patch value using the procedure you describe.

But, how can I get hold of Qr? I am assuming it is a property of the fvDOM object. I'm not sure how to get hold of it in my code.
Hello Mirko,

I have no experience with radiation models in OpenFOAM. Also, I am not sure what do you mean by patch value. Do you want to use a value for each face on the patch or just some sort of integral?

In the latter case I believe that the code you're looking for
Code:
dimensionedScalar result = 
sum(fvDOMInstance.Qr().boudaryField()[patchIndex] * 
mesh.Sf().boundaryField()[patchIndex])
where fvDOMInstance is simply an instance of the fvDOM class.
AlmostSurelyRob is offline   Reply With Quote

Old   January 24, 2011, 16:53
Default
  #10
Senior Member
 
Mirko Vukovic
Join Date: Mar 2009
Posts: 159
Rep Power: 17
mirko is on a distinguished road
Quote:
Originally Posted by AlmostSurelyRob View Post
Hello Mirko,

I have no experience with radiation models in OpenFOAM. Also, I am not sure what do you mean by patch value. Do you want to use a value for each face on the patch or just some sort of integral?

In the latter case I believe that the code you're looking for
Code:
dimensionedScalar result = 
sum(fvDOMInstance.Qr().boudaryField()[patchIndex] * 
mesh.Sf().boundaryField()[patchIndex])
where fvDOMInstance is simply an instance of the fvDOM class.
Yes, I think that is what I am after. But how to get to the fvDOMinstance? :-)

Thanks,

Mirko
mirko is offline   Reply With Quote

Old   January 24, 2011, 17:43
Default
  #11
Senior Member
 
Robert Sawko
Join Date: Mar 2009
Posts: 117
Rep Power: 22
AlmostSurelyRob will become famous soon enough
Right, now I see your problem and I am afraid can't claim any competence in OpenFOAM radiation models.

Perhaps you could look for some hints in

/$FOAMSRC/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField. C

/$FOAMSRC/
thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C

Both of these codes are executing Qr and using fvDOM. Let me know if you find an answer.
AlmostSurelyRob is offline   Reply With Quote

Reply

Tags
boundary field, boundary patch


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
transsonic nozzle with rhoSimpleFoam Unseen OpenFOAM Running, Solving & CFD 8 July 1, 2022 07:54
boundary conditions for simpleFoam calculation foam_noob OpenFOAM Running, Solving & CFD 8 July 1, 2015 09:07
Problem with internalField mecbe2002 OpenFOAM 1 April 24, 2010 11:57
buoyantSimpleRadiationFoam msarkar OpenFOAM 0 February 15, 2010 07:22
pipe flow with heat transfer Fabian OpenFOAM 2 December 12, 2009 05:53


All times are GMT -4. The time now is 04:11.