CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (http://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   Swak4foam: get the value of a field in the neighbour cell of a patch face (http://www.cfd-online.com/Forums/openfoam-pre-processing/93007-swak4foam-get-value-field-neighbour-cell-patch-face.html)

miles_davis October 1, 2011 18:29

Swak4foam: get the value of a field in the neighbour cell of a patch face
 
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

gschaider October 3, 2011 17:26

Quote:

Originally Posted by miles_davis (Post 326382)
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

miles_davis October 3, 2011 18:45

Quote:

Originally Posted by gschaider (Post 326543)
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.

gschaider October 4, 2011 07:52

Quote:

Originally Posted by miles_davis (Post 326555)
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

miles_davis October 4, 2011 08:27

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?

gschaider October 4, 2011 14:26

Quote:

Originally Posted by miles_davis (Post 326630)
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

miles_davis October 5, 2011 11:32

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

gschaider October 5, 2011 11:57

Quote:

Originally Posted by miles_davis (Post 326793)
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


All times are GMT -4. The time now is 17:53.