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

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 Display Modes
Old   October 1, 2011, 18:29
Default Swak4foam: 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: 6
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, 17:26
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
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, 18:45
Default
  #3
Member
 
Miles
Join Date: Sep 2011
Posts: 48
Rep Power: 6
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, 07:52
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
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, 08:27
Default
  #5
Member
 
Miles
Join Date: Sep 2011
Posts: 48
Rep Power: 6
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, 14:26
Default
  #6
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
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, 11:32
Default
  #7
Member
 
Miles
Join Date: Sep 2011
Posts: 48
Rep Power: 6
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, 11:57
Default
  #8
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
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
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
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20
FvMatrix coefficients shrina OpenFOAM Running, Solving & CFD 10 October 3, 2013 14:38
StarToFoam error Kart OpenFOAM Meshing & Mesh Conversion 1 February 4, 2010 05:38
BlockMeshmergePatchPairs hjasak OpenFOAM Native Meshers: blockMesh 11 August 15, 2008 07:36
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 12:55


All times are GMT -4. The time now is 22:01.