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/)
-   -   setFieldsDict, alpha1, free surface, wigley (http://www.cfd-online.com/Forums/openfoam-pre-processing/86220-setfieldsdict-alpha1-free-surface-wigley.html)

kolloff March 17, 2011 06:33

setFieldsDict, alpha1, free surface, wigley
 
2 Attachment(s)
Dear Foamers,

Can anyone give me a hint on what I am doing wrong.
It seems that the "water is running out of the box"

Please have a look at the pictures:
The first picture is showing the alpha1 status just after running the setFields command. (pre-solving)

Attachment 6941

I don't understand why the "XMAX wall" is blue (indicating it is air)?


The second picture shows what happen when I run the interFoam command and have it running for some time.

Attachment 6942



/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.7.1 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object setFieldsDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defaultFieldValues
(
volScalarFieldValue alpha1 0
volVectorFieldValue U (1 0 0)
);
regions
(
boxToCell
{
box (-30 0 -30) (40 30 0.0);
fieldValues
(
volScalarFieldValue alpha1 1
);
}
);
// ************************************************** *********************** //

Thank you very much in anticipation.

ngj March 17, 2011 08:26

Hi

Could you also please supply us with the following information:
  1. The mesh bounding box (can be obtained by running checkMesh)
  2. The direction of the gravitational vector
  3. Boundary conditions for U, pd and alpha1
Best regards,

Niels

kolloff March 17, 2011 08:59

Quote:

Originally Posted by ngj (Post 299837)
Hi

Could you also please supply us with the following information:
  1. The mesh bounding box (can be obtained by running checkMesh)
  2. The direction of the gravitational vector
  3. Boundary conditions for U, pd and alpha1
Best regards,

Niels

Thanks for your reply!
(Det ser ud til vi har baade navn, nationalitet og uddannelse tilfaeldes, jeg hedder ogsaa niels :-)

I am quite new to OF and have a lot to learn. I have made a copy of the files below:


// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create polyMesh for time = 0

Time = 0

Mesh stats
points: 33201
faces: 92612
internal faces: 85948
cells: 29760
boundary patches: 7
point zones: 0
face zones: 0
cell zones: 0

Overall number of cells of each type:
hexahedra: 29760
prisms: 0
wedges: 0
pyramids: 0
tet wedges: 0
tetrahedra: 0
polyhedra: 0

Checking topology...
Boundary definition OK.
Point usage OK.
Upper triangular ordering OK.
Face vertices OK.
Number of regions: 1 (OK).

Checking patch topology for multiply connected surfaces ...
Patch Faces Points Surface topology
HULL 420 465 ok (non-closed singly connected)
XMAX 480 527 ok (non-closed singly connected)
XMIN 480 527 ok (non-closed singly connected)
YMIN 1440 1547 ok (non-closed singly connected)
YMAX 1860 1953 ok (non-closed singly connected)
ZMAX 992 1071 ok (non-closed singly connected)
ZMIN 992 1071 ok (non-closed singly connected)

Checking geometry...
Overall domain bounding box (-30 -9.46866e-07 -30) (40 30 1.15792e-12)
Mesh (non-empty, non-wedge) directions (1 1 1)
Mesh (non-empty) directions (1 1 1)
Boundary openness (-4.96357e-20 -2.4147e-18 4.46937e-19) OK.
Max cell openness = 2.58764e-16 OK.
Max aspect ratio = 23.3959 OK.
Minumum face area = 0.0390652. Maximum face area = 14.8095. Face area magnitudes OK.
Min volume = 0.0261406. Max volume = 35.3769. Total volume = 62964.9. Cell volumes OK.
Mesh non-orthogonality Max: 61.9371 average: 10.5219
Non-orthogonality check OK.
Face pyramids OK.
Max skewness = 1.68738 OK.

Mesh OK.

Gravity:
FoamFile
{
version 2.0;
format ascii;
class uniformDimensionedVectorField;
location "constant";
object g;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 1 -2 0 0 0 0];
value ( 0 0 -9.81 );
// ************************************************** ******* //

U file:

FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "0";
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 1 -1 0 0 0 0];
internalField uniform (1 0 0);
boundaryField
{
HULL { type slip; }
XMAX { type zeroGradient; }
XMIN { type fixedValue; value uniform (7.86 0 0); }
YMIN { type symmetryPlane; }
YMAX { type slip; }
ZMAX { type slip; }
ZMIN { type slip; }
}

p_rgh file:

FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
XMAX
{ type fixedValue;
value uniform 0;
}
YMAX { type slip; }
YMIN { type symmetryPlane; }
ZMAX { type slip; }
ZMIN { type slip; }
XMIN { type zeroGradient; }
HULL { type zeroGradient; }
}


Looking forward to your reply.
Thank you very much in anticipation.

ngj March 17, 2011 09:16

Hi Niels

Some things, which might cause problems:

1. Your bounding box is larger than your computational domain. Try using larger values in the two horizontal directions than strictly necessary, e.g x\in [-10000 10000].

2. Your velocity in setFieldsDict differ from the value on the xmin boundary. This will definitely cause problems, i.e. chock waves.

3. You write that the water flows out of xmax, but as the x-coordinate of xmax appears to be smaller than xmin (your first figure) and xmin is your inlet, then the velocity on this boundary is in the wrong direction. Thus your inlet is a sink, oops :)

4. Why are you using the surface tracking methods if you are filling the computational domain completely with water?

5. What are the boundary conditions for alpha1?

Hope it helps,

Niels

P.S. Hvor arbejder du med dette problem? Jeg er bare nysgerrig, da det altid er spændende at høre om virksomheder, som bruger OF.

kolloff March 17, 2011 09:30

Hej Niels,

Thank you very much for this valuable information!

I am going to look into the issues you mentioned.
The reason I have the domain full of water was a panic try.
I will for sure have a air layer on top of the water surface.

So fare I have little clue of what I am doing - but I try to learn...

And yes I forgot to present the alpha1 BC:

dimensions [0 0 0 0 0 0 0];
internalField uniform 1;
boundaryField
{
XMAX { type zeroGradient; }
YMAX { type zeroGradient; }
YMIN { type symmetryPlane; }
XMIN { type zeroGradient; }
ZMAX { type zeroGradient; }
ZMIN { type zeroGradient; }
HULL { type zeroGradient; }
}

Thank you so much for your help!

NB
Jeg tror jeg har fundet dig paa LinkedIn - Du er PhD paa DTU og har arbejdet for DHI?
(Vi kan fortsaette samtalen der)

ngj March 17, 2011 09:34

Ok, good luck. Please do not hesitate to ask questions.

- Niels

P.S. Ja, det er mig, men lad os tage diskussionen her i forummet og på engelsk, så andre også kan lære noget, hvis de støder ind i lign. problemer.

kolloff March 17, 2011 09:42

Quote:

Originally Posted by ngj (Post 299855)
Ok, good luck. Please do not hesitate to ask questions.

- Niels

P.S. Ja, det er mig, men lad os tage diskussionen her i forummet og på engelsk, så andre også kan lære noget, hvis de støder ind i lign. problemer.




Ja vi fortsaetter med OF kommunikationen her.
Jeg mente mht hvor jeg arbejde og hvad jeg lave etc. kan vi kommunikere over LinkedIn.


But for now I have work to do. Will come back on this topic as soon I have progress.

Thank you.

kolloff March 17, 2011 10:50

Quote:

Originally Posted by ngj (Post 299852)
Hi Niels

Some things, which might cause problems:

1. Your bounding box is larger than your computational domain. Try using larger values in the two horizontal directions than strictly necessary, e.g x\in [-10000 10000].

2. Your velocity in setFieldsDict differ from the value on the xmin boundary. This will definitely cause problems, i.e. chock waves.

3. You write that the water flows out of xmax, but as the x-coordinate of xmax appears to be smaller than xmin (your first figure) and xmin is your inlet, then the velocity on this boundary is in the wrong direction. Thus your inlet is a sink, oops :)

4. Why are you using the surface tracking methods if you are filling the computational domain completely with water?

5. What are the boundary conditions for alpha1?

Hope it helps,

Niels

P.S. Hvor arbejder du med dette problem? Jeg er bare nysgerrig, da det altid er spændende at høre om virksomheder, som bruger OF.

Niels,

you wrote:

1. Your bounding box is larger than your computational domain. Try using larger values in the two horizontal directions than strictly necessary, e.g x\in [-10000 10000].

I am not sure how to correct the problem. Where do I control the size of the computational domain? I have not generated the mesh my self. (I have just taken it from some examples from this forum.

I am not quite sure what you mean with : e.g x\in [-10000 10000]

Sorry for my very basic questions.

Best regards,
Niels

ngj March 17, 2011 11:43

Hi Niels

In the setFieldsDict you merely extend the box to very large dimensions, so e.g. do

Code:

box (-1000 -1000 -1000) (1000 1000 seaLevel);
then you are completely sure, that the computational domain in the horizontal directions is within the part, where you want to have water.

Bests,

Niels

ankit171032 October 23, 2013 15:14

Setfields not changing the field value
 
I am using setFields but value of the field for region(axisymetric) which I am defining in the setfields is not changing.My T file in 0 stil has ""internalField uniform 278;""
I dont know why it is not changing.I am also running the command setFields.


My setFileds file is as :

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

defaultFieldValues ( volVectorFieldValue U ( 0 0 0 ) volScalarFieldValue T 278. volScalarFieldValue p 1 );

regions ( boxToCell { box ( 9.5 0 0) ( 10.5 0.4 0.1 ) ; fieldValues ( volScalarFieldValue T 2000 volScalarFieldValue p 10 ) ; } );


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

Sam_CFD April 3, 2015 05:05

How to define set fields for two volumes
 
1 Attachment(s)
Dear all,

I have a geometry similar to the picture attached. I have generated the mesh in ICEM CFD and imported to OpenFOAM.

How to set intial value for air and liquid ?

Regards,
Sam


All times are GMT -4. The time now is 10:48.