Mod: try to use potentialFoam
This commit is contained in:
parent
44801de26b
commit
60716a4d1d
14
run.sh
Executable file
14
run.sh
Executable file
@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
path=build/simple-cubic/0.1
|
||||
|
||||
# python src/genmesh.py
|
||||
# python src/prefoam.py
|
||||
|
||||
ideasUnvFoam -case $path mesh.unv
|
||||
checkMesh -case $path
|
||||
foamDictionary -case $path constant/polyMesh/boundary -entry entry0.wall.type -set wall
|
||||
#potentialFoam -case $path
|
||||
decomposePar -case $path
|
||||
mpirun -np 4 --oversubscribe simpleFoam -parallel -case $path > $path/simpleFoam.log
|
||||
|
@ -10,7 +10,7 @@ if not os.path.exists(build):
|
||||
|
||||
###
|
||||
|
||||
alpha = [0.1, 0.15, 0.2]
|
||||
alpha = [0.1] #, 0.15, 0.2]
|
||||
|
||||
simpleCubic = os.path.join(src, "simple-cubic/main.py")
|
||||
# Body-centered cubic
|
||||
|
13
src/prefoam.py
Normal file
13
src/prefoam.py
Normal file
@ -0,0 +1,13 @@
|
||||
import os, shutil
|
||||
|
||||
src = os.getcwd()
|
||||
build = os.path.join(src, "../build")
|
||||
|
||||
if not os.path.exists(build):
|
||||
os.makedirs(build)
|
||||
|
||||
foamCase = [ "0", "constant", "system" ]
|
||||
|
||||
for d in foamCase:
|
||||
shutil.copytree("{}/simple-cubic/{}".format(src, d),
|
||||
"{}/simple-cubic/0.1/{}".format(build, d))
|
@ -23,7 +23,7 @@ boundaryField
|
||||
inlet
|
||||
{
|
||||
type pressureInletVelocity;
|
||||
valut uniform (0 0 0);
|
||||
value uniform (0 0 0);
|
||||
}
|
||||
|
||||
outlet
|
||||
|
@ -16,14 +16,14 @@ FoamFile
|
||||
|
||||
dimensions [0 2 -2 0 0 0 0];
|
||||
|
||||
internaleField uniform 0;
|
||||
internalField uniform 0;
|
||||
|
||||
boundaryField
|
||||
{
|
||||
inlet
|
||||
{
|
||||
type fixedValue;
|
||||
value uniform 1;
|
||||
value uniform 0.001;
|
||||
}
|
||||
|
||||
outlet
|
||||
|
@ -17,6 +17,6 @@ FoamFile
|
||||
|
||||
transportModel Newtonian;
|
||||
|
||||
nu 1e-05;
|
||||
nu 1e-06;
|
||||
|
||||
// ************************************************************************* //
|
||||
|
@ -15,18 +15,9 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
simulationType RAS;
|
||||
simulationType laminar;
|
||||
|
||||
RAS
|
||||
{
|
||||
// Tested with kEpsilon, realizableKE, kOmega, kOmegaSST,
|
||||
// ShihQuadraticKE, LienCubicKE.
|
||||
RASModel kEpsilon;
|
||||
|
||||
turbulence on;
|
||||
|
||||
printCoeffs on;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
@ -17,7 +17,7 @@ def create(geomObj, bc):
|
||||
param.SetCheckChartBoundary( 0 )
|
||||
param.SetMinSize( 0.01 )
|
||||
param.SetMaxSize( 0.1 )
|
||||
param.SetFineness( 3 )
|
||||
param.SetFineness( 4 )
|
||||
#param.SetGrowthRate( 0.1 )
|
||||
#param.SetNbSegPerEdge( 5 )
|
||||
#param.SetNbSegPerRadius( 10 )
|
||||
|
@ -23,7 +23,7 @@ startTime 0;
|
||||
|
||||
stopAt endTime;
|
||||
|
||||
endTime 500;
|
||||
endTime 5000;
|
||||
|
||||
deltaT 1;
|
||||
|
||||
|
@ -23,17 +23,21 @@ ddtSchemes
|
||||
gradSchemes
|
||||
{
|
||||
default Gauss linear;
|
||||
// grad(Phi) Gauss linear;
|
||||
}
|
||||
|
||||
divSchemes
|
||||
{
|
||||
default none;
|
||||
div(phi,U) bounded Gauss linearUpwind grad(U);
|
||||
div((nuEff*dev2(T(grad(U))))) Gauss linear;
|
||||
div(nonlinearStress) Gauss linear;
|
||||
}
|
||||
|
||||
laplacianSchemes
|
||||
{
|
||||
default Gauss linear corrected;
|
||||
// laplacian(1, Phi) Gauss linear corrected;
|
||||
}
|
||||
|
||||
interpolationSchemes
|
||||
|
@ -33,16 +33,30 @@ solvers
|
||||
tolerance 1e-08;
|
||||
relTol 0.1;
|
||||
}
|
||||
|
||||
Phi
|
||||
{
|
||||
solver smoothSolver;
|
||||
smoother GaussSeidel;
|
||||
nSweeps 2;
|
||||
tolerance 1e-08;
|
||||
relTol 0.1;
|
||||
}
|
||||
}
|
||||
|
||||
potentialFlow
|
||||
{
|
||||
nNonOrthogonalCorrectors 3;
|
||||
}
|
||||
|
||||
SIMPLE
|
||||
{
|
||||
nNonOrthogonalCorrectors 0;
|
||||
nNonOrthogonalCorrectors 10;
|
||||
|
||||
residualControl
|
||||
{
|
||||
p 1e-5;
|
||||
U 1e-5;
|
||||
p 1e-3;
|
||||
U 1e-3;
|
||||
}
|
||||
}
|
||||
|
||||
@ -50,11 +64,11 @@ relaxationFactors
|
||||
{
|
||||
fields
|
||||
{
|
||||
p 0.3;
|
||||
p 0.05;
|
||||
}
|
||||
equations
|
||||
{
|
||||
U 0.7;
|
||||
U 0.2;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user