diff --git a/doc/Makefile b/doc/Makefile new file mode 100644 index 0000000..e69de29 diff --git a/src/cube/0/U b/src/cube/0/U new file mode 100644 index 0000000..a7acef3 --- /dev/null +++ b/src/cube/0/U @@ -0,0 +1,37 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +boundaryField +{ + inlet + { + type ; + } + + outlet + { + type ; + } + + wall + { + type ; + } +} + +// ************************************************************************* // diff --git a/src/cube/0/p b/src/cube/0/p new file mode 100644 index 0000000..0840d42 --- /dev/null +++ b/src/cube/0/p @@ -0,0 +1,37 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +boundaryField +{ + inlet + { + type fixedValue; + } + + outlet + { + type fixedValue; + } + + wall + { + type ; + } +} + +// ************************************************************************* // diff --git a/src/cube/constant/transportProperties b/src/cube/constant/transportProperties new file mode 100644 index 0000000..749d236 --- /dev/null +++ b/src/cube/constant/transportProperties @@ -0,0 +1,24 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object transportProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +transportModel Newtonian; + +rho 1; + +nu 1e-05; + +// ************************************************************************* // diff --git a/src/cube/constant/turbulenceProperties b/src/cube/constant/turbulenceProperties new file mode 100644 index 0000000..3540a58 --- /dev/null +++ b/src/cube/constant/turbulenceProperties @@ -0,0 +1,29 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RAS; + +RAS +{ + RASModel SpalartAllmaras; + + turbulence on; + + printCoeffs on; +} + +// ************************************************************************* // diff --git a/src/cube/system/controlDict b/src/cube/system/controlDict new file mode 100644 index 0000000..8ee5651 --- /dev/null +++ b/src/cube/system/controlDict @@ -0,0 +1,70 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application simpleFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 500; + +deltaT 1; + +writeControl timeStep; + +writeInterval 50; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable true; + +functions +{ + momErr + { + type momentumError; + libs (fieldFunctionObjects); + executeControl writeTime; + writeControl writeTime; + } + + contErr + { + type div; + libs (fieldFunctionObjects); + field phi; + executeControl writeTime; + writeControl writeTime; + } + +} + + +// ************************************************************************* // diff --git a/src/cube/system/fvSchemes b/src/cube/system/fvSchemes new file mode 100644 index 0000000..d0e489c --- /dev/null +++ b/src/cube/system/fvSchemes @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default steadyState; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + default none; + div(phi,U) bounded Gauss linearUpwind grad(U); +// div(phi,nuTilda) bounded Gauss linearUpwind grad(nuTilda); +// div((nuEff*dev2(T(grad(U))))) Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + +// ************************************************************************* // diff --git a/src/cube/system/fvSolution b/src/cube/system/fvSolution new file mode 100644 index 0000000..891704c --- /dev/null +++ b/src/cube/system/fvSolution @@ -0,0 +1,62 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + p + { + solver GAMG; + tolerance 1e-06; + relTol 0.1; + smoother GaussSeidel; + } + + U + { + solver smoothSolver; + smoother GaussSeidel; + nSweeps 2; + tolerance 1e-08; + relTol 0.1; + } +} + +SIMPLE +{ + nNonOrthogonalCorrectors 0; + + residualControl + { + p 1e-5; + U 1e-5; + } +} + +relaxationFactors +{ + fields + { + p 0.3; + } + equations + { + U 0.7; + } +} + + +// ************************************************************************* // diff --git a/src/genmesh.py b/src/genmesh.py index 662f269..74b133f 100644 --- a/src/genmesh.py +++ b/src/genmesh.py @@ -4,16 +4,16 @@ import multiprocessing path = os.getcwd() cube = os.path.join(path, "cube/main.py") -print(cube) -alpha = [0.1, 0.15] + +alpha = [0.1, 0.15, 0.2] processes = [] -def genmesh(coef): - subprocess.run(["salome", "-t", "{} {}".format(cube, str(coef))]) +def salome(exePath, arg): + subprocess.run(["salome", "start", "-t", exePath, "args:%s" % arg]) for c in alpha: print("starting process") - p = multiprocessing.Process(target=genmesh, args=(c,)) + p = multiprocessing.Process(target = salome, args = (cube, c)) processes.append(p) p.start()