CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Water into 3D room (https://www.cfd-online.com/Forums/openfoam/70647-water-into-3d-room.html)

shangzung December 1, 2009 12:04

Water into 3D room
 
Hello!

I am trying to simulate water entering a 3D tunnel through a hole on the ceiling. Somehow the simulation crashes after a couple of timesteps and i assume the error lies in the boundary conditions. I am working with interFoam. Here are the BC's:

alpha1:

tunnelWalls
{
type zeroGradient;
}

tunnelHole
{
type fixedValue;
value uniform 0.7;
}

tunnelPortals
{
type inletOutlet;
inletValue uniform 0;
value uniform 0;
}

defaultFaces
{
type inletOutlet;
inletValue uniform 0;
value uniform 0;
}


p:

tunnelWalls
{
type buoyantPressure;
value uniform 0;
}

tunnelHole
{
type totalPressure;
p0 uniform 0;
U U;
phi phi;
rho rho;
psi none;
gamma 1;
value uniform 0;
}

tunnelPortals
{
type totalPressure;
p0 uniform 0;
U U;
phi phi;
rho rho;
psi none;
gamma 1;
value uniform 0;
}

defaultFaces
{
type totalPressure;
p0 uniform 0;
U U;
phi phi;
rho rho;
psi none;
gamma 1;
value uniform 0;
}

U:

tunnelWalls
{
type fixedValue;
value uniform (0 0 0);
}
tunnelHole
{
type fixedValue;
value uniform (0 0 0);
}
tunnelPortals
{
type pressureInletOutletVelocity;
value uniform (0 0 0);
}
defaultFaces
{
type pressureInletOutletVelocity;
value uniform (0 0 0);
}

Is there an error that could cause the instability?

Robat January 15, 2010 09:13

Hi shangzung,

you may set some water-filled cells at your inlet, so you got some medium which can be influenced by your force(gravity). That's pretty easy with the setFieldsDict.
Or your water might leak out to fast, try to wall the oulets and make another hole in the ceiling (or use the ceiling itself) as a new outlet just temporary for checking.
I calculated a similar case some time ago(glass filled by water-tap). There were nearly the same conditions, except the pressure: I set the inlet to zeroGradient and the whole system to a higher pressure than 0 pascal.
May be you already done this( I don't know.): make adjustable and smaller timesteps and limit the Courant number.

I hope this is helpfully.
Regards, Robert

kpm January 15, 2010 10:47

I believe that Your crashes are due to large time steps.
You could try "maxCo 0.10" in controlDict to be on the safe side and see if it helps.

You could also use a different software for that, depending on what Your goal is.
The free 3D rendering software Blender contains a fluid simulator based on El'Beem which is quite good in making flowing water look convincingly, the fluid simulator is pretty fast and easy to use.
I used both, Blender and OpenFOAM, for flowing water, with the goal "convincing appearance".
In my opinion, the OpenFOAM-Paraview-combination is usually inferior to Blender in terms of computational effort and visual quality of the result (not necessarily in terms of physical "correctness", though).
So if You just want to see some convincing flowing water, Blender would usually be the better tool.
Blender itself might be a pain to use for a beginner, though...
so if Your goal was to practice OpenFOAM, stick with OpenFOAM.


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