# Hydrostatic Pressure in a cube

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

 November 25, 2012, 08:20 Hydrostatic Pressure in a cube #1 New Member   Join Date: Oct 2012 Posts: 14 Rep Power: 13 Dear Foamers, I would like to understand how to implement hydrostatic pressure on a wall. I am a beginner with OF. For that, I created a simple cube mesh: Code: ```convertToMeters 1; vertices ( (0 0 0) (0 0 1) (0 1 1) (0 1 0) (1 0 0) (1 0 1) (1 1 1) (1 1 0) ); blocks ( hex (0 1 2 3 4 5 6 7) (40 40 40) simpleGrading (1 1 1) ); edges ( ); boundary ( walls { type wall; faces ( (0 1 2 3) (4 5 6 7) (4 0 1 5) (5 6 2 1) (7 6 2 3) (4 7 3 0) ); } );``` I want the hydrostatic pressure, so I used buoyantPressure for p: Code: ```dimensions [0 2 -2 0 0 0 0]; internalField uniform 0; boundaryField { walls { type buoyantPressure; value uniform 0; } }``` The velocity type is pressureInletVelocity and the value is uniform(0 0 0). I also created a g folder in "constant": Code: ```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 );``` The fluid is not supposed to move since it is a closed cube. I don't know exactly what solver should I use but it seems that pisoFoam is ok. So here is the fvSolution: Code: ```solvers { p { solver PCG; preconditioner DIC; tolerance 1e-06; relTol 0; } U { solver PBiCG; preconditioner DILU; tolerance 1e-05; relTol 0; } } PISO { nCorrectors 2; nNonOrthogonalCorrectors 0; pRefCell 0; pRefValue 0; }``` And for the fvSchemes, I used an existing one: Code: ```ddtSchemes { default Euler; } gradSchemes { default Gauss linear; grad(p) Gauss linear; } divSchemes { default none; div(phi,U) Gauss linear; } laplacianSchemes { default none; laplacian(nu,U) Gauss linear corrected; laplacian((1|A(U)),p) Gauss linear corrected; } interpolationSchemes { default linear; interpolate(HbyA) linear; } snGradSchemes { default corrected; } fluxRequired { default no; p ; }``` Here are the TransportProperties: Code: ```nu nu [ 0 2 -1 0 0 0 0 ] 0.01; transportModel Newtonian;``` Here is the terminal response: Code: ```--> FOAM FATAL IO ERROR: keyword div((nuEff*dev(T(grad(U))))) is undefined in dictionary "/home/ubuntu/openfoam/simu/cube/system/fvSchemes::divSchemes"``` I don't know what model should I use for div((nuEff*dev(T(grad(U))))? Or maybe it is a wrong solver for a simple case like that? Thank you for your help!

 November 25, 2012, 16:53 #2 Member   Florian Join Date: Nov 2009 Posts: 59 Rep Power: 16 I don't know if pisoFoam is right solver for this kind of problem. For the error message you posted, simple add this expression to the divSchemes dictionary or set a default entry, e.g. Code: ```divSchemes { default Gauss linear; div(phi,U) Gauss linear; div((nuEff*dev(T(grad(U))))) Gauss linear; }```

 November 26, 2012, 04:42 #3 New Member   Join Date: Oct 2012 Posts: 14 Rep Power: 13 Thank you for your answer! I added that line in the fvSchemes, as well as the Code: `laplacian(nuEff,U) Gauss linear corrected;` in the laplacianSchemes. Still, the terminal doesn't find the "g" folder: Code: ```--> FOAM FATAL ERROR: request for uniformDimensionedVectorField g from objectRegistry region0 failed available objects of type uniformDimensionedVectorField are 0 ( )``` Where is the objectRegistry region0? I tried to copy/paste the g in all the folders (0,constant,system) still doesn't work. Thanks for your help!