CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   How To set a variable value for alpha.water on the wall with alphacontactangle (https://www.cfd-online.com/Forums/openfoam-pre-processing/165887-how-set-variable-value-alpha-water-wall-alphacontactangle.html)

h_fathi January 28, 2016 10:02

How To set a variable value for alpha.water on the wall with alphacontactangle
 
Dear Foamers

I hope I find my answer in here. I try to set an initial value of alpha.water on some parts of the wall which has a capillary angle and during the solution, this value will change related to another field (the job we do in groovyBC).

It seems we cant set a value of field alpha for the boundary condition:
type consantAlphaContactAngle;

and also we are not able to set the field value of alpha according to another field.

Please help me:confused:

Best Regards

leske February 1, 2016 15:26

1 Attachment(s)
Hello everyone,
I have managed to create a new patch and set the new boundary conditions that I mentioned in the post above. This is the procedure that i adopted:

1)I used a topoSetDict to create a set of face :


/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.4.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object topoSetDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//

actions
(
{
name INL_olio;
type faceSet;
action new;
source boxToFace;
sourceInfo
{
box (0.422878 0 -0.0109062069) (0.5 0.0162083112 0.0109062069);
// boxToFace ((MINX MINY MINZ) (MAXX MAXY MAXZ))
}
}
);

// ************************************************** **********//



2) I used a createPatchDict to create a patch with the face of the topoSet :



/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.4.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object createPatchDict;
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
pointSync false;

// Patches to create.
patches
(
{
// Name of new patch
name INL_OLIO;

// Dictionary to construct new patch from
patchInfo
{
type patch;
}

// How to construct: either from 'patches' or 'set'
constructFrom set;

// If constructFrom = set : name of faceSet
set INL_olio;
}
);

// ************************************************** ********//

3) The new mesh is placed in the directory 0.001 ,




and then subsequently i had to bring the boundary conditions (BC) for all variables (initially in the 0 folder) in the 0.001 folder , the BC in the 0.001 folder must include the conditions on the new patch (INL_OLIO).

4) In the controlDict file i used start at = latest time( that is 0.001) instead of start at = start time =0

In this way i got this result (see attached photos), but i have a new question:




as you can see from the picture the result of the creation of the new patch isn't an accurate rectangle because the faces are part of the new patch or not if their center is internal or external to the rectangle.

Since the size of the rectangle are set by me and these affect the space occupied by the oil in the inlet face and than the result of the simulation, i want a rectangle with a specific area, but in this way i can't have an axact area.

The question is:




there is a way to create a precise rectangle (or another shape) therefore a way to cut the faces of the original mesh rather than take into account
the faces according to the criterion: the faces are part of the new patch or not if their center is internal or external to the rectangle.

thank you.


All times are GMT -4. The time now is 03:12.