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

matching imported mesh and boundary conditions in "0"

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 6, 2011, 15:00
Default matching imported mesh and boundary conditions in "0"
  #1
New Member
 
Join Date: Jul 2011
Posts: 23
Rep Power: 14
Stephy is on a distinguished road
Hello all,
I have a problem after importing my mesh.neu from Gambit. As it is imported from Gambit, it does not need a BlockMeshDict to work (as far as I noticed, but I might be wrong). So then, I have a problem when it comes to match this mesh with the files in the "0" folder, the boundary conditions like for 'p' or 'U'. How should I fil them to make them correspond to my mesh ? I have not really any wall and wall type defined as I did it in Gambit.

Could someone help me and tell me how to make it work ?

thank you very much !!

Stephy
Stephy is offline   Reply With Quote

Old   July 8, 2011, 20:06
Default
  #2
New Member
 
Join Date: Jul 2011
Posts: 23
Rep Power: 14
Stephy is on a distinguished road
I still cannot make it work.... anybody has an idea ?
thank you very much ! :-)
Stephy is offline   Reply With Quote

Old   July 8, 2011, 20:34
Default
  #3
New Member
 
Join Date: Jul 2011
Posts: 23
Rep Power: 14
Stephy is on a distinguished road
OpenFoam says, for "icoFoam" for example:
Create time
Create mesh for time=0
Reading TransportProperties
Reading field p

--> FOAM FATAL IO ERROR:
keyword wall is undefined in dictionary ".../0/p::boundaryField"
file: /home/.../0/p::boundaryField from line 25 to line 35.
From function dictionary::subDict(const word& keyword) const
in file db/dictionary/dictionary.C at line 461.
FOAM exiting


Could someone help me and tell me how to make it work ?

thank you very much !!
Stephy is offline   Reply With Quote

Old   July 9, 2011, 18:41
Default
  #4
Super Moderator
 
bigphil's Avatar
 
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,086
Rep Power: 34
bigphil will become famous soon enoughbigphil will become famous soon enough
Hi Stephy,

To get a Gambit mesh (.neu) into OpenFOAM, first while inside the case
Code:
gambitToFoam meshFile.neu
You then need to edit the "./constant/polyMesh/boundary" file and change your boundary types to the correct type. I think gambit will probably set all the patch types to "patch" or "wall" or something like that so change them to what you want them to be i.e. wall, fixedValue, symmetryPlane, empty, etc..

Then you need to set your initial conditions in the "./0" directory. "icoFoam" wants initial conditions for pressure, "./0/p", and velocity, "./0/U", so you need to set up these files with the boundary conditions you want, with a boundary conditions for each of your patches, check out the icoFoam tutorial to see how to setup p and U initial conditions.
The error you are getting from icoFoam is because it cannot find the p initial condition for a patch called wall by the looks of things.

Hope it helps,
Philip
bigphil is offline   Reply With Quote

Old   July 9, 2011, 23:34
Default
  #5
New Member
 
Join Date: Jul 2011
Posts: 23
Rep Power: 14
Stephy is on a distinguished road
Philip,

Thank you very much for your help, it helps a lot as now I know where to look at. When you say

Quote:
Originally Posted by bigphil View Post
Hi Stephy,

To get a Gambit mesh (.neu) into OpenFOAM, first while inside the case
Code:
gambitToFoam meshFile.neu
You then need to edit the "./constant/polyMesh/boundary" file and change your boundary types to the correct type. I think gambit will probably set all the patch types to "patch" or "wall" or something like that so change them to what you want them to be i.e. wall, fixedValue, symmetryPlane, empty, etc..
in my boundary file there is only one thing:

FoamFile
{
version 2.0;
format ascii;
class polyBoundaryMesh;
location "constant/polyMesh";
object boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

1
(
wall
{
type patch;
nFaces 18922;
startFace 229789;
}
)

But I clearly defined the boundary condition with Gambit (I am used to mesh with Gambit so I am sure of that, at least). The only file where I can see a part of my boundary conditions is in my mesh.msh at the very last lines:

(0 "Cells:")
(12 (0 1 1d349 0))
(12 (2 1 1d349 1 2))

(0 "Zones:")
(45 (2 fluid fluid)())
(45 (3 interface interface.4)())
(45 (4 mass-flow-inlet mass_flow_inlet.3)())
(45 (5 outflow outflow.2)())
(45 (6 wall wall.1)())
(45 (8 interior default-interior)())

But using this, I have absolutely no idea of what values to put in the boundary file
for "nfaces" and "startFace".... I also have the mesh.neu file, but I couldn't find any clear info about my boundary condition in it...

Do you know what should I do to fill correctly my boundary file ?

again, thank you very much for your help, it's very precious.

Stephy
Stephy is offline   Reply With Quote

Old   July 10, 2011, 07:15
Default
  #6
Super Moderator
 
bigphil's Avatar
 
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,086
Rep Power: 34
bigphil will become famous soon enoughbigphil will become famous soon enough
Stephy,

The boundary patches must be defined separately in Gambit for them to appear in the 'constant/polyMesh/boundary' file. If your 'myMesh.msh' file definitively has the boundaries then import that mesh into OpenFOAM using the command:
Code:
fluentMeshToFoam myMesh.msh
Then check if the separate boundaries are in the 'constant/polyMesh/boundary' file.

I think your 'mesh.neu' doesn't have any boundaries defined maybe because Gambit deleted all the boundaries when you change solver type at the top of Gambit.

Philip
bigphil is offline   Reply With Quote

Old   July 10, 2011, 17:50
Default
  #7
New Member
 
Join Date: Jul 2011
Posts: 23
Rep Power: 14
Stephy is on a distinguished road
Philip,

Thank you again for your help, you were completely right, Gambit reset the boundary conditions when I changed the solver. So now I have my correct boundary file, like this:
FoamFile
{
version 2.0;
format ascii;
class polyBoundaryMesh;
location "constant/polyMesh";
object boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

4
(
wall
{
type wall;
nFaces 11332;
startFace 229789;
}
outflow
{
type patch;
nFaces 446;
startFace 241121;
}
inflow
{
type patch;
nFaces 452;
startFace 241567;
}
freesurface
{
type patch;
nFaces 6692;
startFace 242019;
}
)

I am currently trying to figure out how what to put instead of "patch" and how to fill "p" and "U". Do you know if there is a type that corresponds to a non-slip condition at the surface (for my hull and my bottom floor, noted "wall". by the way, should I separate them in two different "wall" ?) ? I saw people using "zerogradient" but doesn't that mean that they are using a slip condition ?

I am also wondering what to put for the freesurface (which is the top surface of my mesh). As I want to represent the water elevation/trough around the hull, I am still not sure if I am doing the correct things as I guess the flow cannot go outside the mesh...

Do you have any idea ?

again, thank you very much for your help,

Stephy
Stephy is offline   Reply With Quote

Old   July 10, 2011, 18:24
Default
  #8
Super Moderator
 
bigphil's Avatar
 
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,086
Rep Power: 34
bigphil will become famous soon enoughbigphil will become famous soon enough
Stephy,


That's good that the mesh is now in OpenFOAM.

As regards boundary conditions, you should check what boundary conditions are used in the tutorial cases for the solver you are using. Check out the cavity tutorial boundary conditions (it's in the User Guide).

If you are still unsure then search this forum for posts about boundary conditions for solver eg "icoFoam boundary conditions".

You could also try google.

If you are still unsure then create a post and there are lots of smart people here who will help you (Unfortunately I don't deal much with fluids so can't help you with the boundary conditions).

If you would like to model a free surface then you should check out interFoam and the damBreak tutorial (in the User Guide).


Hope it helps,
Philip
bigphil is offline   Reply With Quote

Old   July 10, 2011, 23:41
Default
  #9
New Member
 
Join Date: Jul 2011
Posts: 23
Rep Power: 14
Stephy is on a distinguished road
Philip,

I am trying to run my mesh in the most basic case, using icoFoam and looking closely to the cavity case. I managed to find how to fill "p" and "U" to make OpenFoam go to computations, but now here is what I get:

Create time

Create mesh for time = 0

Reading transportProperties

Reading field p

Reading field U

Reading/calculating face flux field phi


Starting time loop

Time = 0.1

Courant Number mean: 0.000506547 max: 0.315347
DILUPBiCG: Solving for Ux, Initial residual = 0, Final residual = 0, No Iterations 0
DILUPBiCG: Solving for Uy, Initial residual = 0, Final residual = 0, No Iterations 0
DILUPBiCG: Solving for Uz, Initial residual = 1, Final residual = 3.31525e-08, No Iterations 2


--> FOAM FATAL ERROR:
Continuity error cannot be removed by adjusting the outflow.
Please check the velocity boundary conditions and/or run potentialFoam to initialise the outflow.
Total flux : 41.8405
Specified mass inflow : 0
Specified mass outflow : 185.25
Adjustable mass outflow : 0


From function adjustPhi(surfaceScalarField& phi, const volVectorField& U,const volScalarField& p
in file cfdTools/general/adjustPhi/adjustPhi.C at line 116.

FOAM exiting
-------

and my "p" and "U" are as follow:

p:
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 2 -2 0 0 0 0];

internalField uniform 0;

boundaryField
{
wall
{
type buoyantPressure;
}

outflow
{
type freestreamPressure;
}

inflow
{
type freestreamPressure;
}

symmetry
{
type zeroGradient;
}
}
---------

U:
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 1 -1 0 0 0 0];

internalField uniform (0 0 0);

boundaryField
{
wall
{
type fixedValue;
value uniform (0 0 0);
}

outflow
{
type zeroGradient;
}

inflow
{
type fixedValue;
value uniform (0 0 1);
}

symmetry
{
type zeroGradient;
}
}
------
"symmetry" corresponding to the free surface.
I tried to run potentialFoam but I get "--> FOAM FATAL IO ERROR:
keyword potentialFlow is undefined in dictionary ..[...]... FOAM Exiting".

Please let me know if you have any suggestion about this issue,

thank you very much,

Stephy
Stephy is offline   Reply With Quote

Old   July 11, 2011, 08:57
Default
  #10
Super Moderator
 
bigphil's Avatar
 
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,086
Rep Power: 34
bigphil will become famous soon enoughbigphil will become famous soon enough
Hi Stephy,


That's good that you are able to run your solver now albeit with errors.

As I said I don't know much about the correct boundary conditions for icoFoam but I imagine they are the cause of your continuity error.

By the way, after importing your mesh into OpenFOAM it is always a good idea to run
Code:
checkMesh
This will check the quality of your mesh and check for any mesh errors.

Maybe some body else here could help you better with your boundary conditions, maybe start a new thread (with a nice clear title like what boundary conditions for icoFoam or something like that) and there are lots of people who know their stuff who will help.


Philip
bigphil is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Wind turbine simulation Saturn CFX 58 July 3, 2020 02:13
Water subcooled boiling Attesz CFX 7 January 5, 2013 04:32
[Netgen] boundary conditions and mesh exporting vaina74 OpenFOAM Meshing & Mesh Conversion 2 May 27, 2010 10:38
RPM in Wind Turbine Pankaj CFX 9 November 23, 2009 05:05
[Commercial meshers] Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Meshing & Mesh Conversion 2 July 15, 2005 05:15


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