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/)
-   -   Filling of a basin (https://www.cfd-online.com/Forums/openfoam-solving/212227-filling-basin.html)

Fool November 28, 2018 17:17

Filling of a basin
 
2 Attachment(s)
Hello all,

I need to simulate the filling process of a basin under atmospheric conditions. I guess it's really not that difficult but as a beginner I do not really progress.

I've built a simplification of my original geometry in FreeCAD and meshed it with gmsh. I chosed the blue sides as inlet and the black walls as wall.
Now that the basin shall get filled with 3m³/s I don't want to define an outlet. But trying to solve it with simpleFoam doesn't work because of the missing outlet it says.
Is it even possible to do a simulation without outlet in simpleFoam and if yes what boundary conditions do I have to select for the outlet?

Attachment 67001

Below I'll post an example of the case I have to simulate. Would be very thankful if someone could give me some specific advices for such a case. I'm really struggling.

Attachment 67002

Tanks a lot
Dave

ssa_cfd November 29, 2018 05:00

Try with interFoam.

obscureed November 29, 2018 05:34

Hi Fool,


I'm no expert, but here are some thoughts:
1) simpleFoam is a steady-state solver, and yours is a transient situation. You need a transient solver.
2) When the water comes in, the corresponding amount of air must leave (or be compressed). If it leaves, you need an outlet.
3) You have two fluids in your simulation (water and air), so (as far as I know) you need a multiphase solver. Looking at https://www.openfoam.com/documentati...rd-solvers.php, and assuming you don't need (and therefore don't want) compressible effects, I think interFoam looks like something to explore.


Good luck!
Ed

RobertHB November 29, 2018 06:02

Quote:

Originally Posted by Fool (Post 717225)
But trying to solve it with simpleFoam doesn't work because of the missing outlet it says.
Is it even possible to do a simulation without outlet in simpleFoam and if yes what boundary conditions do I have to select for the outlet?

Hi Dave,
with most of the OpenFoam solvers it is assume that you numerical domain is filled with water/air/... . E.g. you can define an inlet as a velocity inlet accelerating the water within your domain, but it will allways be full of water. As such it needs an outlet the pressure can be released somewhere and the volume that comes in has to go out somewhere.

Keyword: Navier-Stokes eqn., conservation laws.

Imagine a close cube and you attach a hose to a hole in the top to fill your cube. Remember a OpenFoam cube will allways be filled. Without a release the pressure in your cube would rise unti it bursts at some point.

If you want to simulate the filling of an air-filled domain with water you will need a multiphase solver that can capture the air/water interface.

Fool December 13, 2018 17:20

Thanks for your help.

I now tried interfoam and the results are getting better. But I do have a problem with the boundary conditions for my inlet.
In my case the whole basin shall be filled with air at time 0 and after that a constant flow of 3m³/s shall flow into the basin. But the only possibility I see is to set alpha.water=1 for the inlet and U to flowrateinletvelocity with a volumetricflowrate of 3, but then the whole inlet is full of water and it doesn't really rises from the bottom as a flow in reality would do, which I guess is not the perfect solution. I will post the files below (laminar case).

I tried to play around with variableHeightFlowRateInletVelocity and variableHeightFlowRate but then I either get an error message in openFoam or no solution for alpha.water that can be displayed in paraview.

Does anyone know if it is even possible to simulate it as I imagine it and is it maybe more useful to work with a velocity instead of the volumetricflowrate?

And can someone explain me the variableHeightFlowRate condition and what the upper and the lower bound stands for?




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

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

internalField uniform 0.0;

boundaryField
{

wall
{
type fixedFluxPressure;
value uniform 0.0;
}

atmosphere
{
type totalPressure;
p0 uniform 0.0;
}

inlet
{
type fixedFluxPressure;
gradient uniform 0.0;
}

defaultFaces
{
type empty;
}

}

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

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 4.x |
| \\ / A nd | Web: 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.0;

boundaryField
{

wall
{
type zeroGradient;
}

atmosphere
{
type inletOutlet;
inletValue uniform 0.0;
value uniform 0.0;
}

inlet
{
type fixedValue;
value uniform 1;
}

defaultFaces
{
type empty;
}

}

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


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

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

internalField uniform (0.0 0.0 0.0);

boundaryField
{

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

atmosphere
{
type pressureInletOutletVelocity;
value uniform (0 0 0);
}

inlet
{
type fixedValue;
value (1 0 0);
}

defaultFaces
{
type empty;
}

}

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

ssa_cfd December 14, 2018 03:44

I think the problem is not with boundary conditions, but with the geometry. Instead of selecting whole face as inlet, select only the bottom few cells as inlet using toposet and createpatch and I hope the water will increase from bottom.


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