CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   setFields does not recognize inlet patch (https://www.cfd-online.com/Forums/openfoam-solving/233985-setfields-does-not-recognize-inlet-patch.html)

thesa February 19, 2021 06:49

setFields does not recognize inlet patch
 
Hello everyone,

I created a mesh from a DEM of a river with snappyHexMesh. I did the spillway tutorial of openFoam and I want to apply the interFoam solver at my case. My problem is the following: in the setFieldsDict, I created a box around a part of my geometry, including the inlet patch. The setFields utility works, but it does not set the alpha values to 1 at the inlet and at the atmosphere patch , it does set the alpha values to 1 at the walls and at the internal mesh. I checked already the bounding box, it is large enough to cover the region.

defaultFieldValues
(
volScalarFieldValue alpha.water 0
);
regions
boxToCell
{
box (-100 -10 -10) (100 20 30);
fieldValues
(
volScalarFieldValue alpha.water 1
);
}
);

Any suggestions what might be wrong? How can I fix it?

Thank you for your replies!


regards,
Theresa

Sarah_Ag September 8, 2023 16:45

Problem Solved?
 
Hi, did you reach a solution? I'm having the same problem.

LongGe September 11, 2023 03:38

Hello

When applied to "PATCH", write as follows.


see: OpenFOAM-v2212/tutorials/multiphase/interFoam/RAS/DTCHull/system/setFieldsDict





defaultFieldValues
(
volScalarFieldValue alpha.water 0
);

regions
(
// Set cell values
// (does zerogradient on boundaries)
boxToCell
{
box (-999 -999 -999) (999 999 0.244);

fieldValues
(
volScalarFieldValue alpha.water 1
);
}

// Set patch values (using ==)
boxToFace
{
box (-999 -999 -999) (999 999 0.244);

fieldValues
(
volScalarFieldValue alpha.water 1
);
}
);

Sarah_Ag September 12, 2023 17:09

Had Tried
 
1 Attachment(s)
Hi! thanks for the reply, i set my setFields like this:



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

defaultFieldValues
(
volScalarFieldValue alpha.water 0
);

regions
(
boxToCell
{
box (-10 0 -1) (57 20 1);

fieldValues
(
volScalarFieldValue alpha.water 1
);
}
boxToFace
{
box (0 0 -1) (0 20 1);

fieldValues
(
volScalarFieldValue alpha.water 1
);
}
);



Then in 0 time the inlet bondary is ok! but in the follow time steps the bondary got the same problem, staying all water or partial water where should be just air. Like the pic.



Dis you saw something like this? have any tips?

LongGe September 12, 2023 18:09

Hello
What type of boundary conditions are you giving to the patch there? I mean, please indicate 0/alpha.* .

Sarah_Ag September 13, 2023 15:59

alpha.water
 
Thanks for the reply, this is my alpha.water









ALPHA.WATER



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

dimensions [0 0 0 0 0 0 0];

internalField uniform 0;

boundaryField
{
inlet
{
type waveAlpha;
waveDictName waveDict;
value uniform 0;
}
frontAndBack
{
type empty;
}
wall
{
type zeroGradient;
}
atmosphere
{
type inletOutlet;
inletValue uniform 0;
value uniform 0;
}
}

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

LongGe September 13, 2023 18:11

Hello



Maybe this is a "waveAlpha" problem. I don't know this type, so I can't judge if it is a bug or not.

Sarah_Ag September 14, 2023 16:58

Thank you
 
I'll search about this. Thank you!


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