diff --git a/applications/solvers/combustion/coldEngineFoam/readEngineTimeControls.H b/applications/solvers/combustion/coldEngineFoam/readEngineTimeControls.H new file mode 100644 index 0000000000..cccee289dd --- /dev/null +++ b/applications/solvers/combustion/coldEngineFoam/readEngineTimeControls.H @@ -0,0 +1,3 @@ + #include "createTimeControls.H" + + maxDeltaT = runTime.userTimeToTime(maxDeltaT); diff --git a/tutorials/combustion/engineFoam/freePiston/0/T b/tutorials/combustion/engineFoam/freePiston/0/T new file mode 100644 index 0000000000..097e61c6a7 --- /dev/null +++ b/tutorials/combustion/engineFoam/freePiston/0/T @@ -0,0 +1,53 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format binary; + class volScalarField; + location "0"; + object T; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "include/caseSettings" + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform $:internalField.T; + +boundaryField +{ + back + { + type wedge; + } + + front + { + $back; + } + + liner + { + $:wall.T; + } + + cylinderHead + { + $liner; + } + + piston + { + $liner; + } +} + + +// ************************************************************************* // diff --git a/tutorials/combustion/engineFoam/freePiston/0/U b/tutorials/combustion/engineFoam/freePiston/0/U new file mode 100644 index 0000000000..81c314be05 --- /dev/null +++ b/tutorials/combustion/engineFoam/freePiston/0/U @@ -0,0 +1,53 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM:.Uhe Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format binary; + class volVectorField; + location "0"; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "include/caseSettings" + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform $:internalField.U; + +boundaryField +{ + back + { + type wedge; + } + + front + { + $back; + } + + liner + { + $:wall.U; + } + + cylinderHead + { + $liner; + } + + piston + { + $:piston.U; + } +} + + +// ************************************************************************* // diff --git a/tutorials/combustion/engineFoam/freePiston/0/air b/tutorials/combustion/engineFoam/freePiston/0/air new file mode 100644 index 0000000000..61bd8112ae --- /dev/null +++ b/tutorials/combustion/engineFoam/freePiston/0/air @@ -0,0 +1,53 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object air; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "include/caseSettings" + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 1; + +boundaryField +{ + back + { + type wedge; + } + + front + { + $back; + } + + liner + { + $:wall.p; + } + + cylinderHead + { + $liner; + } + + piston + { + $liner; + } +} + + +// ************************************************************************* // diff --git a/tutorials/combustion/engineFoam/freePiston/0/alphat b/tutorials/combustion/engineFoam/freePiston/0/alphat new file mode 100644 index 0000000000..6d96c7f481 --- /dev/null +++ b/tutorials/combustion/engineFoam/freePiston/0/alphat @@ -0,0 +1,38 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format binary; + class volScalarField; + location "0"; + object alphat; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "include/caseSettings" + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + back + { + type wedge; + } + front { $back; } + liner { $:wall.alphat; } + cylinderHead { $liner; } + piston { $liner; } +} +} + + +// ************************************************************************* // diff --git a/tutorials/combustion/engineFoam/freePiston/0/epsilon b/tutorials/combustion/engineFoam/freePiston/0/epsilon new file mode 100644 index 0000000000..c51e83baa5 --- /dev/null +++ b/tutorials/combustion/engineFoam/freePiston/0/epsilon @@ -0,0 +1,53 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format binary; + class volScalarField; + location "0"; + object epsilon; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "include/caseSettings" + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform $:internalField.epsilon; + +boundaryField +{ + back + { + type wedge; + } + + front + { + $back; + } + + liner + { + $:wall.epsilon; + } + + cylinderHead + { + $liner; + } + + piston + { + $liner; + } +} + + +// ************************************************************************* // diff --git a/tutorials/combustion/engineFoam/freePiston/0/include/boundaryConditions b/tutorials/combustion/engineFoam/freePiston/0/include/boundaryConditions new file mode 100644 index 0000000000..d49dedb7c8 --- /dev/null +++ b/tutorials/combustion/engineFoam/freePiston/0/include/boundaryConditions @@ -0,0 +1,70 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object boundaryConditions; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +wall +{ + p + { + type zeroGradient; + } + + U + { + type fixedValue; + value uniform (0 0 0); + } + + T + { + type zeroGradient; + } + + k + { + type kqRWallFunction; + value uniform $:internalField.k; + } + + epsilon + { + type epsilonWallFunction; + value uniform $:internalField.epsilon; + } + + nut + { + type nutkWallFunction; + value uniform 0; + } + + alphat + { + type compressible::alphatWallFunction; + Prt 0.85; + value uniform 0; + } +} + +piston +{ + U + { + type movingWallVelocity; + value uniform (0 0 0); + } +} + +// ************************************************************************* // diff --git a/tutorials/combustion/engineFoam/freePiston/0/include/caseSettings b/tutorials/combustion/engineFoam/freePiston/0/include/caseSettings new file mode 100644 index 0000000000..fd4fc84c88 --- /dev/null +++ b/tutorials/combustion/engineFoam/freePiston/0/include/caseSettings @@ -0,0 +1,28 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object caseSettings; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +internalField +{ + U (0 0 0); + epsilon 5.70e-5; + k 2.40e-5; + T 350; + p 1e5; +} + +#include "boundaryConditions" + +// ************************************************************************* // diff --git a/tutorials/combustion/engineFoam/freePiston/0/k b/tutorials/combustion/engineFoam/freePiston/0/k new file mode 100644 index 0000000000..b428f1080b --- /dev/null +++ b/tutorials/combustion/engineFoam/freePiston/0/k @@ -0,0 +1,53 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM:.khe Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format binary; + class volScalarField; + location "0"; + object k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "include/caseSettings" + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform $:internalField.k; + +boundaryField +{ + back + { + type wedge; + } + + front + { + $back; + } + + liner + { + $:wall.k; + } + + cylinderHead + { + $liner; + } + + piston + { + $liner; + } +} + + +// ************************************************************************* // diff --git a/tutorials/combustion/engineFoam/freePiston/0/nut b/tutorials/combustion/engineFoam/freePiston/0/nut new file mode 100644 index 0000000000..2d3213ce17 --- /dev/null +++ b/tutorials/combustion/engineFoam/freePiston/0/nut @@ -0,0 +1,38 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format binary; + class volScalarField; + location "0"; + object nut; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "include/caseSettings" + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + back + { + type wedge; + } + front { $back; } + liner { $:wall.nut; } + cylinderHead { $liner; } + piston { $liner; } +} +} + + +// ************************************************************************* // diff --git a/tutorials/combustion/engineFoam/freePiston/0/p b/tutorials/combustion/engineFoam/freePiston/0/p new file mode 100644 index 0000000000..6676f4e209 --- /dev/null +++ b/tutorials/combustion/engineFoam/freePiston/0/p @@ -0,0 +1,53 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM:.phe Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format binary; + class volScalarField; + location "0"; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "include/caseSettings" + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform $:internalField.p; + +boundaryField +{ + back + { + type wedge; + } + + front + { + $back; + } + + liner + { + $:wall.p; + } + + cylinderHead + { + $liner; + } + + piston + { + $liner; + } +} + + +// ************************************************************************* // diff --git a/tutorials/combustion/engineFoam/freePiston/constant/engineGeometry b/tutorials/combustion/engineFoam/freePiston/constant/engineGeometry new file mode 100644 index 0000000000..62371d9779 --- /dev/null +++ b/tutorials/combustion/engineFoam/freePiston/constant/engineGeometry @@ -0,0 +1,29 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object engineGeometry; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +engineMesh layered; + +engineType freePiston; + +pistonPositionTime table +( + (0 0.13) + (0.020 0.013) +); + + +// ************************************************************************* // diff --git a/tutorials/combustion/engineFoam/freePiston/constant/g b/tutorials/combustion/engineFoam/freePiston/constant/g new file mode 100644 index 0000000000..d182180d95 --- /dev/null +++ b/tutorials/combustion/engineFoam/freePiston/constant/g @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class uniformDimensionedVectorField; + location "constant"; + object g; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -2 0 0 0 0]; +value (0 0 0); + +// ************************************************************************* // diff --git a/tutorials/combustion/engineFoam/freePiston/constant/include/reactions.air b/tutorials/combustion/engineFoam/freePiston/constant/include/reactions.air new file mode 100644 index 0000000000..5bb714747f --- /dev/null +++ b/tutorials/combustion/engineFoam/freePiston/constant/include/reactions.air @@ -0,0 +1,8 @@ +species +( + air +); + +reactions +{ +} diff --git a/tutorials/combustion/engineFoam/freePiston/constant/include/thermo.air b/tutorials/combustion/engineFoam/freePiston/constant/include/thermo.air new file mode 100644 index 0000000000..f2dad8a6c0 --- /dev/null +++ b/tutorials/combustion/engineFoam/freePiston/constant/include/thermo.air @@ -0,0 +1,21 @@ +air +{ + specie + { + nMoles 1; + molWeight 28.9596; + } + thermodynamics + { + Tlow 200; + Thigh 3500; + Tcommon 1000; + highCpCoeffs ( 3.57304 -7.24383e-04 1.67022e-06 -1.26501e-10 -4.20580e-13 -1047.41 3.12431 ); + lowCpCoeffs ( 3.09589 1.22835e-03 -4.14267e-07 6.56910e-11 -3.87021e-15 -983.191 5.34161 ); + } + transport + { + As 1.67212e-06; + Ts 170.672; + } +} diff --git a/tutorials/combustion/engineFoam/freePiston/constant/thermophysicalProperties b/tutorials/combustion/engineFoam/freePiston/constant/thermophysicalProperties new file mode 100644 index 0000000000..15a3d8ab51 --- /dev/null +++ b/tutorials/combustion/engineFoam/freePiston/constant/thermophysicalProperties @@ -0,0 +1,38 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object thermophysicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type hePsiThermo; + mixture reactingMixture; + transport sutherland; + thermo janaf; + equationOfState perfectGas; + specie specie; + energy sensibleInternalEnergy; +} + +inertSpecie air; + +chemistryReader foamChemistryReader; + +foamChemistryFile "$FOAM_CASE/constant/include/reactions.air"; + +foamChemistryThermoFile "$FOAM_CASE/constant/include/thermo.air"; + + +// ************************************************************************* // diff --git a/tutorials/combustion/engineFoam/freePiston/constant/turbulenceProperties b/tutorials/combustion/engineFoam/freePiston/constant/turbulenceProperties new file mode 100644 index 0000000000..d587253c9a --- /dev/null +++ b/tutorials/combustion/engineFoam/freePiston/constant/turbulenceProperties @@ -0,0 +1,29 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RAS; + +RAS +{ + RASModel kEpsilon; + + turbulence on; + + printCoeffs on; +} + +// ************************************************************************* // diff --git a/tutorials/combustion/engineFoam/freePiston/system/blockMeshDict b/tutorials/combustion/engineFoam/freePiston/system/blockMeshDict new file mode 100644 index 0000000000..434e1c2f47 --- /dev/null +++ b/tutorials/combustion/engineFoam/freePiston/system/blockMeshDict @@ -0,0 +1,87 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 1; + +vertices +( + (0 0 0) + (0.05 -0.000872753 0) + (0.05 0.000872753 0) + (0 0 0.13) + (0.05 -0.000872753 0.13) + (0.05 0.000872753 0.13) +); + +blocks +( + hex (0 1 2 0 3 4 5 3) (50 1 130) simpleGrading (1 1 1) +); + +boundary +( + front + { + type wedge; + faces + ( + (0 1 4 3) + ); + } + back + { + type wedge; + faces + ( + (0 3 5 2) + ); + } + piston + { + type wall; + faces + ( + (0 2 1 0) + ); + } + cylinderHead + { + type wall; + faces + ( + (3 4 5 3) + ); + } + axis + { + type empty; + faces + ( + (0 3 3 0) + ); + } + liner + { + type wall; + faces + ( + (1 2 5 4) + ); + } +); + + +// ************************************************************************* // diff --git a/tutorials/combustion/engineFoam/freePiston/system/controlDict b/tutorials/combustion/engineFoam/freePiston/system/controlDict new file mode 100644 index 0000000000..08ccfa4cf3 --- /dev/null +++ b/tutorials/combustion/engineFoam/freePiston/system/controlDict @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application coldEngineFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 0.03; + +deltaT 5.0e-7; + +writeControl adjustableRunTime; + +writeInterval 0.001; + +purgeWrite 0; + +writeFormat binary; + +writePrecision 6; + +writeCompression off; + +timeFormat general; + +timePrecision 8; + +runTimeModifiable true; + +adjustTimeStep yes; + +maxCo 0.25; + +// ************************************************************************* // diff --git a/tutorials/combustion/engineFoam/freePiston/system/fvSchemes b/tutorials/combustion/engineFoam/freePiston/system/fvSchemes new file mode 100644 index 0000000000..a3bc2848d7 --- /dev/null +++ b/tutorials/combustion/engineFoam/freePiston/system/fvSchemes @@ -0,0 +1,66 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + default none; + + div(phi,U) Gauss linearUpwind grad(U); + div(phi,e) Gauss linearUpwind grad(e); + + div(phiv,p) Gauss linear; + div(phi,K) Gauss linear; + div(meshPhi,p) Gauss linear; + + div(phi,k) Gauss upwind; + div(phi,epsilon) Gauss upwind; + + div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + +fluxRequired +{ + default no; + p; +} + +// ************************************************************************* // diff --git a/tutorials/combustion/engineFoam/freePiston/system/fvSolution b/tutorials/combustion/engineFoam/freePiston/system/fvSolution new file mode 100644 index 0000000000..a9e1486f35 --- /dev/null +++ b/tutorials/combustion/engineFoam/freePiston/system/fvSolution @@ -0,0 +1,62 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + "rho.*" + { + solver diagonal; + } + + p + { + solver PCG; + preconditioner DIC; + tolerance 1e-6; + relTol 0.1; + } + + pFinal + { + $p; + relTol 0; + } + + "(U|e|k|epsilon)" + { + solver PBiCGStab; + preconditioner DILU; + tolerance 1e-5; + relTol 0.1; + } + + "(U|e|k|epsilon)Final" + { + $U; + relTol 0; + } +} + +PIMPLE +{ + nCorrectors 2; + nNonOrthogonalCorrectors 1; + momentumPredictor yes; +} + + +// ************************************************************************* //