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

[swak4Foam] get the value of a field in the neighbour cell of a patch face

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

Like Tree1Likes
  • 1 Post By miles_davis

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 1, 2011, 19:29
Default get the value of a field in the neighbour cell of a patch face
  #1
Member
 
Miles
Join Date: Sep 2011
Posts: 48
Rep Power: 14
miles_davis is on a distinguished road
Hi,

I am using groovyBC from swak4foam with OF 2.0.1.
I am working a lot with TwophaseEulerfoam solver.
I want to set a value for a field (Ua Ub and alpha o be more specific) at a patch boundary.
To evaluate the expression of my groocyBC, I need for a given face of a patch to use the value caculated in the neighbouring cell.

I have seen in the swak4foam wiki page this expression
atmosphere { type groovyBC; valueExpression "-(gamma+internalField(gamma))*0.5*normal()"; value uniform (0 0 0); }

I am under the impression that "internalField(gamma) " stands for the internal value for the field gamma given at the beginning of the gamma dictionary.
Am I right ?
If yes does anyone know the expression I can use with groovyBC to have the value of a field in the cell connected to a face patch. Is there a particular syntax for Ua Ub or alpha.

Thanks a lot for your help.

Regards,

Miles
Tushar@cfd likes this.
miles_davis is offline   Reply With Quote

Old   October 3, 2011, 18:26
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by miles_davis View Post
Hi,

I am using groovyBC from swak4foam with OF 2.0.1.
I am working a lot with TwophaseEulerfoam solver.
I want to set a value for a field (Ua Ub and alpha o be more specific) at a patch boundary.
To evaluate the expression of my groocyBC, I need for a given face of a patch to use the value caculated in the neighbouring cell.

I have seen in the swak4foam wiki page this expression
atmosphere { type groovyBC; valueExpression "-(gamma+internalField(gamma))*0.5*normal()"; value uniform (0 0 0); }

I am under the impression that "internalField(gamma) " stands for the internal value for the field gamma given at the beginning of the gamma dictionary.
Am I right ?
If yes does anyone know the expression I can use with groovyBC to have the value of a field in the cell connected to a face patch. Is there a particular syntax for Ua Ub or alpha.

Thanks a lot for your help.

Regards,

Miles
According to http://openfoamwiki.net/index.php/Co...her_field_are: the function internalField does the same as the patchField-Method of the same name: give back a field with the same size as the patch where the values are the cell-values of the cell neighbouring to each face. If you feel that the current documentation did not convey this feel free to modify it

Bernhard
gschaider is offline   Reply With Quote

Old   October 3, 2011, 19:45
Default
  #3
Member
 
Miles
Join Date: Sep 2011
Posts: 48
Rep Power: 14
miles_davis is on a distinguished road
Quote:
Originally Posted by gschaider View Post
According to http://openfoamwiki.net/index.php/Co...her_field_are: the function internalField does the same as the patchField-Method of the same name: give back a field with the same size as the patch where the values are the cell-values of the cell neighbouring to each face. If you feel that the current documentation did not convey this feel free to modify it

Bernhard

Hi,
Thanks for your answer.
Sorry if my question seems silly but I am new to OF and sometimes I miss correspondence between entities or method. Hence some confusion. It's a lot to learn.

If I have well understood, this time, internalfield is the function I was looking for:
it does return the value taken in the internaflied next to the patch, hence in the neighboring cell for a given face.

When I try to apply this to the following expression, I am missing something:
Code:
atmosphere 
{ 
type groovyBC; 
valueExpression "-(gamma+internalField(gamma))*0.5*normal()"; 
value uniform (0 0 0); 
}
- why are there two specifications of gamma: "gamma" and “internalfidel(gamma)”.
- does it mean that the BC here is calculated by combining the actual face value of gamma (“gamma”) and the internalfield value of gamma (“internafield(gamma)”) .
- if yes, is it some kind of under-relaxation for the calculation of the boundary?
(I use under-relaxation but maybe the world is not appropriate here. Sorry for the shortcut).

Thanks again.

Have a nice evening,

Miles.
miles_davis is offline   Reply With Quote

Old   October 4, 2011, 08:52
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by miles_davis View Post
Hi,
Thanks for your answer.
Sorry if my question seems silly but I am new to OF and sometimes I miss correspondence between entities or method. Hence some confusion. It's a lot to learn.

If I have well understood, this time, internalfield is the function I was looking for:
it does return the value taken in the internaflied next to the patch, hence in the neighboring cell for a given face.

When I try to apply this to the following expression, I am missing something:
Code:
atmosphere 
{ 
type groovyBC; 
valueExpression "-(gamma+internalField(gamma))*0.5*normal()"; 
value uniform (0 0 0); 
}
- why are there two specifications of gamma: "gamma" and “internalfidel(gamma)”.
- does it mean that the BC here is calculated by combining the actual face value of gamma (“gamma”) and the internalfield value of gamma (“internafield(gamma)”) .
- if yes, is it some kind of under-relaxation for the calculation of the boundary?
(I use under-relaxation but maybe the world is not appropriate here. Sorry for the shortcut).
gamma is the value on the face while internalField(gamma) is the one in the first cell row. To be honest I don't remember what the exact purpose of this BC was but I think it made the BC a bit more stable (or it was just done to demonstrate the difference between the two formulations). Heck. I'm not even sure whether it was my idea
gschaider is offline   Reply With Quote

Old   October 4, 2011, 09:27
Default
  #5
Member
 
Miles
Join Date: Sep 2011
Posts: 48
Rep Power: 14
miles_davis is on a distinguished road
Ok
This is clear to me now.

Thanks again for your anwsers.


Miles



P.S.: the "wmake all" command executed to install swake4foam is not listed in the userguide as a common wmake argument (page U-75). I did not get what the "all" stands for exactly?
Does this mean all the libs in a given folder?
miles_davis is offline   Reply With Quote

Old   October 4, 2011, 15:26
Default
  #6
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by miles_davis View Post
Ok
This is clear to me now.

Thanks again for your anwsers.


Miles



P.S.: the "wmake all" command executed to install swake4foam is not listed in the userguide as a common wmake argument (page U-75). I did not get what the "all" stands for exactly?
Does this mean all the libs in a given folder?
Execute wmake in all subdirectories or (if present) execute the Allwmake script
gschaider is offline   Reply With Quote

Old   October 5, 2011, 12:32
Default
  #7
Member
 
Miles
Join Date: Sep 2011
Posts: 48
Rep Power: 14
miles_davis is on a distinguished road
Thanks for the answer.

BTW I have found the link to the presentation of PyFoam on the swak4foam page.
It's realy a pity that it is not highlighted in big! It is very usefull.
I was wondering is pyFoam working on OF2.0.1?

regards,

Miles
miles_davis is offline   Reply With Quote

Old   October 5, 2011, 12:57
Default
  #8
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by miles_davis View Post
Thanks for the answer.

BTW I have found the link to the presentation of PyFoam on the swak4foam page.
It's realy a pity that it is not highlighted in big! It is very usefull.
I was wondering is pyFoam working on OF2.0.1?
pyFoam only controls OpenFOAM from the outside. Thus as long as the fileformats and the outputs of OF do not change radically (and they did not with 2.0) it works with every OF-version known to mankind
gschaider is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[blockMesh] FATAL ERROR: face 6 in patch 2 does not have neighbour cell face: 4(8 9 21 20) robingilbert OpenFOAM Meshing & Mesh Conversion 28 November 23, 2023 07:32
y+ and u+ values with low-Re RANS turbulence models: utility + testcase florian_krause OpenFOAM 114 August 23, 2023 06:37
snappyhexmesh remove blockmesh geometry philipp1 OpenFOAM Running, Solving & CFD 2 December 12, 2014 11:58
[Gmsh] Import problem ARC OpenFOAM Meshing & Mesh Conversion 0 February 27, 2010 11:56
[Gmsh] Import gmsh msh to Foam adorean OpenFOAM Meshing & Mesh Conversion 24 April 27, 2005 09:19


All times are GMT -4. The time now is 00:18.