diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C index 48367ac507..36287119d3 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C @@ -141,7 +141,7 @@ int main(int argc, char *argv[]) } } - if (pimple.nCorrPimple() <= 1) + if (pimple.firstIter()) { #include "rhoEqn.H" } diff --git a/applications/solvers/compressible/sonicFoam/EEqn.H b/applications/solvers/compressible/sonicFoam/EEqn.H deleted file mode 100644 index 73ce837396..0000000000 --- a/applications/solvers/compressible/sonicFoam/EEqn.H +++ /dev/null @@ -1,21 +0,0 @@ -{ - fvScalarMatrix EEqn - ( - fvm::ddt(rho, e) + fvm::div(phi, e) - + fvc::ddt(rho, K) + fvc::div(phi, K) - + fvc::div(fvc::absolute(phi/fvc::interpolate(rho), U), p, "div(phiv,p)") - - fvm::laplacian(turbulence->alphaEff(), e) - == - fvOptions(rho, e) - ); - - EEqn.relax(); - - fvOptions.constrain(EEqn); - - EEqn.solve(); - - fvOptions.correct(e); - - thermo.correct(); -} diff --git a/applications/solvers/compressible/sonicFoam/Make/files b/applications/solvers/compressible/sonicFoam/Make/files deleted file mode 100644 index c78af6be60..0000000000 --- a/applications/solvers/compressible/sonicFoam/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -sonicFoam.C - -EXE = $(FOAM_APPBIN)/sonicFoam diff --git a/applications/solvers/compressible/sonicFoam/Make/options b/applications/solvers/compressible/sonicFoam/Make/options deleted file mode 100644 index 35d223f265..0000000000 --- a/applications/solvers/compressible/sonicFoam/Make/options +++ /dev/null @@ -1,19 +0,0 @@ -EXE_INC = \ - -I$(LIB_SRC)/transportModels/compressible/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ - -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/sampling/lnInclude \ - -I$(LIB_SRC)/finiteVolume/lnInclude - -EXE_LIBS = \ - -lcompressibleTransportModels \ - -lfluidThermophysicalModels \ - -lspecie \ - -lturbulenceModels \ - -lcompressibleTurbulenceModels \ - -lmeshTools \ - -lsampling \ - -lfvOptions \ - -lfiniteVolume diff --git a/applications/solvers/compressible/sonicFoam/UEqn.H b/applications/solvers/compressible/sonicFoam/UEqn.H deleted file mode 100644 index c726eb40db..0000000000 --- a/applications/solvers/compressible/sonicFoam/UEqn.H +++ /dev/null @@ -1,24 +0,0 @@ -// Solve the Momentum equation - -MRF.correctBoundaryVelocity(U); - -fvVectorMatrix UEqn -( - fvm::ddt(rho, U) + fvm::div(phi, U) - + MRF.DDt(rho, U) - + turbulence->divDevRhoReff(U) - == - fvOptions(rho, U) -); - -UEqn.relax(); - -fvOptions.constrain(UEqn); - -if (pimple.momentumPredictor()) -{ - solve(UEqn == -fvc::grad(p)); - - fvOptions.correct(U); - K = 0.5*magSqr(U); -} diff --git a/applications/solvers/compressible/sonicFoam/createFieldRefs.H b/applications/solvers/compressible/sonicFoam/createFieldRefs.H deleted file mode 100644 index a14057e9bc..0000000000 --- a/applications/solvers/compressible/sonicFoam/createFieldRefs.H +++ /dev/null @@ -1,2 +0,0 @@ -volScalarField& e = thermo.he(); -const volScalarField& psi = thermo.psi(); diff --git a/applications/solvers/compressible/sonicFoam/createFields.H b/applications/solvers/compressible/sonicFoam/createFields.H deleted file mode 100644 index 901fe98e15..0000000000 --- a/applications/solvers/compressible/sonicFoam/createFields.H +++ /dev/null @@ -1,57 +0,0 @@ -Info<< "Reading thermophysical properties\n" << endl; - -autoPtr pThermo -( - psiThermo::New(mesh) -); -psiThermo& thermo = pThermo(); -thermo.validate(args.executable(), "e"); - -volScalarField& p = thermo.p(); - -volScalarField rho -( - IOobject - ( - "rho", - runTime.timeName(), - mesh - ), - thermo.rho() -); - -Info<< "Reading field U\n" << endl; -volVectorField U -( - IOobject - ( - "U", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh -); - -#include "compressibleCreatePhi.H" - -mesh.setFluxRequired(p.name()); - -Info<< "Creating turbulence model\n" << endl; -autoPtr turbulence -( - compressible::turbulenceModel::New - ( - rho, - U, - phi, - thermo - ) -); - -Info<< "Creating field kinetic energy K\n" << endl; -volScalarField K("K", 0.5*magSqr(U)); - -#include "createMRF.H" -#include "createFvOptions.H" diff --git a/applications/solvers/compressible/sonicFoam/pEqn.H b/applications/solvers/compressible/sonicFoam/pEqn.H deleted file mode 100644 index 50a9ff240d..0000000000 --- a/applications/solvers/compressible/sonicFoam/pEqn.H +++ /dev/null @@ -1,44 +0,0 @@ -rho = thermo.rho(); - -volScalarField rAU(1.0/UEqn.A()); -surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU)); -volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p)); -surfaceScalarField phid -( - "phid", - fvc::interpolate(psi) - *( - fvc::flux(HbyA) - + MRF.zeroFilter(rhorAUf*fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho)) - ) -); - -MRF.makeRelative(fvc::interpolate(psi), phid); - -// Non-orthogonal pressure corrector loop -while (pimple.correctNonOrthogonal()) -{ - fvScalarMatrix pEqn - ( - fvm::ddt(psi, p) - + fvm::div(phid, p) - - fvm::laplacian(rhorAUf, p) - == - fvOptions(psi, p, rho.name()) - ); - - pEqn.solve(); - - if (pimple.finalNonOrthogonalIter()) - { - phi = pEqn.flux(); - } -} - -#include "rhoEqn.H" -#include "compressibleContinuityErrs.H" - -U = HbyA - rAU*fvc::grad(p); -U.correctBoundaryConditions(); -fvOptions.correct(U); -K = 0.5*magSqr(U); diff --git a/applications/solvers/compressible/sonicFoam/sonicDyMFoam/Make/files b/applications/solvers/compressible/sonicFoam/sonicDyMFoam/Make/files deleted file mode 100644 index 08fa87a2cc..0000000000 --- a/applications/solvers/compressible/sonicFoam/sonicDyMFoam/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -sonicDyMFoam.C - -EXE = $(FOAM_APPBIN)/sonicDyMFoam diff --git a/applications/solvers/compressible/sonicFoam/sonicDyMFoam/Make/options b/applications/solvers/compressible/sonicFoam/sonicDyMFoam/Make/options deleted file mode 100644 index fdca074204..0000000000 --- a/applications/solvers/compressible/sonicFoam/sonicDyMFoam/Make/options +++ /dev/null @@ -1,28 +0,0 @@ -EXE_INC = \ - -I.. \ - -I../../rhoPimpleFoam \ - -I$(LIB_SRC)/transportModels/compressible/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ - -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ - -I$(LIB_SRC)/finiteVolume/cfdTools \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/sampling/lnInclude \ - -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ - -I$(LIB_SRC)/dynamicMesh/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude \ - -EXE_LIBS = \ - -lcompressibleTransportModels \ - -lfluidThermophysicalModels \ - -lspecie \ - -lturbulenceModels \ - -lcompressibleTurbulenceModels \ - -lfiniteVolume \ - -lmeshTools \ - -lsampling \ - -lfvOptions \ - -ldynamicFvMesh \ - -ltopoChangerFvMesh \ - -ldynamicMesh \ - -lmeshTools diff --git a/applications/solvers/compressible/sonicFoam/sonicDyMFoam/pEqn.H b/applications/solvers/compressible/sonicFoam/sonicDyMFoam/pEqn.H deleted file mode 100644 index 92e0bb3673..0000000000 --- a/applications/solvers/compressible/sonicFoam/sonicDyMFoam/pEqn.H +++ /dev/null @@ -1,51 +0,0 @@ -rho = thermo.rho(); - -volScalarField rAU(1.0/UEqn.A()); -surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU)); -volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p)); -surfaceScalarField phid -( - "phid", - fvc::interpolate(psi) - *( - fvc::flux(HbyA) - + rhorAUf*fvc::ddtCorr(rho, U, rhoUf)/fvc::interpolate(rho) - ) -); - -fvc::makeRelative(phid, psi, U); -MRF.makeRelative(fvc::interpolate(psi), phid); - -// Non-orthogonal pressure corrector loop -while (pimple.correctNonOrthogonal()) -{ - fvScalarMatrix pEqn - ( - fvm::ddt(psi, p) - + fvm::div(phid, p) - - fvm::laplacian(rhorAUf, p) - == - fvOptions(psi, p, rho.name()) - ); - - pEqn.solve(); - - if (pimple.finalNonOrthogonalIter()) - { - phi = pEqn.flux(); - } -} - -#include "rhoEqn.H" -#include "compressibleContinuityErrs.H" - -U = HbyA - rAU*fvc::grad(p); -U.correctBoundaryConditions(); -fvOptions.correct(U); -K = 0.5*magSqr(U); - -{ - rhoUf = fvc::interpolate(rho*U); - surfaceVectorField n(mesh.Sf()/mesh.magSf()); - rhoUf += n*(fvc::absolute(phi, rho, U)/mesh.magSf() - (n & rhoUf)); -} diff --git a/applications/solvers/compressible/sonicFoam/sonicDyMFoam/sonicDyMFoam.C b/applications/solvers/compressible/sonicFoam/sonicDyMFoam/sonicDyMFoam.C deleted file mode 100644 index 0a826053ba..0000000000 --- a/applications/solvers/compressible/sonicFoam/sonicDyMFoam/sonicDyMFoam.C +++ /dev/null @@ -1,151 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Application - sonicDyMFoam - -Group - grpCompressibleSolvers grpMovingMeshSolvers - -Description - Transient solver for trans-sonic/supersonic, turbulent flow of a - compressible gas, with optional mesh motion and mesh topology changes. - -\*---------------------------------------------------------------------------*/ - -#include "fvCFD.H" -#include "dynamicFvMesh.H" -#include "psiThermo.H" -#include "turbulentFluidThermoModel.H" -#include "pimpleControl.H" -#include "CorrectPhi.H" -#include "fvOptions.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -int main(int argc, char *argv[]) -{ - #include "postProcess.H" - - #include "setRootCase.H" - #include "createTime.H" - #include "createDynamicFvMesh.H" - #include "createDyMControls.H" - #include "createFields.H" - #include "createFieldRefs.H" - #include "createRhoUf.H" - #include "compressibleCourantNo.H" - #include "setInitialDeltaT.H" - #include "initContinuityErrs.H" - - turbulence->validate(); - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - - Info<< "\nStarting time loop\n" << endl; - - while (runTime.run()) - { - #include "readDyMControls.H" - - { - // Store divrhoU from the previous mesh so that it can be mapped - // and used in correctPhi to ensure the corrected phi has the - // same divergence - volScalarField divrhoU - ( - "divrhoU", - fvc::div(fvc::absolute(phi, rho, U)) - ); - - #include "compressibleCourantNo.H" - #include "setDeltaT.H" - - runTime++; - - Info<< "Time = " << runTime.timeName() << nl << endl; - - // Store momentum to set rhoUf for introduced faces. - volVectorField rhoU("rhoU", rho*U); - - // Do any mesh changes - mesh.update(); - - if (mesh.changing()) - { - MRF.update(); - - if (correctPhi) - { - // Calculate absolute flux from the mapped surface velocity - phi = mesh.Sf() & rhoUf; - - #include "correctPhi.H" - - // Make the fluxes relative to the mesh-motion - fvc::makeRelative(phi, rho, U); - } - } - - if (checkMeshCourantNo) - { - #include "meshCourantNo.H" - } - } - - #include "rhoEqn.H" - Info<< "rhoEqn max/min : " << max(rho).value() - << " " << min(rho).value() << endl; - - // --- Pressure-velocity PIMPLE corrector loop - while (pimple.loop()) - { - #include "UEqn.H" - #include "EEqn.H" - - // --- Pressure corrector loop - while (pimple.correct()) - { - #include "pEqn.H" - } - - if (pimple.turbCorr()) - { - turbulence->correct(); - } - } - - runTime.write(); - - Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" - << " ClockTime = " << runTime.elapsedClockTime() << " s" - << nl << endl; - } - - Info<< "End\n" << endl; - - return 0; -} - - -// ************************************************************************* // diff --git a/applications/solvers/compressible/sonicFoam/sonicFoam.C b/applications/solvers/compressible/sonicFoam/sonicFoam.C deleted file mode 100644 index cdd25e095c..0000000000 --- a/applications/solvers/compressible/sonicFoam/sonicFoam.C +++ /dev/null @@ -1,103 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Application - sonicFoam - -Group - grpCompressibleSolvers - -Description - Transient solver for trans-sonic/supersonic, turbulent flow of a - compressible gas. - -\*---------------------------------------------------------------------------*/ - -#include "fvCFD.H" -#include "psiThermo.H" -#include "turbulentFluidThermoModel.H" -#include "pimpleControl.H" -#include "fvOptions.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -int main(int argc, char *argv[]) -{ - #include "postProcess.H" - - #include "setRootCase.H" - #include "createTime.H" - #include "createMesh.H" - #include "createControl.H" - #include "createFields.H" - #include "createFieldRefs.H" - #include "initContinuityErrs.H" - - turbulence->validate(); - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - - Info<< "\nStarting time loop\n" << endl; - - while (runTime.loop()) - { - Info<< "Time = " << runTime.timeName() << nl << endl; - - #include "compressibleCourantNo.H" - - #include "rhoEqn.H" - - // --- Pressure-velocity PIMPLE corrector loop - while (pimple.loop()) - { - #include "UEqn.H" - #include "EEqn.H" - - // --- Pressure corrector loop - while (pimple.correct()) - { - #include "pEqn.H" - } - - if (pimple.turbCorr()) - { - turbulence->correct(); - } - } - - rho = thermo.rho(); - - runTime.write(); - - Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" - << " ClockTime = " << runTime.elapsedClockTime() << " s" - << nl << endl; - } - - Info<< "End\n" << endl; - - return 0; -} - - -// ************************************************************************* // diff --git a/applications/solvers/compressible/sonicFoam/sonicLiquidFoam/Make/files b/applications/solvers/compressible/sonicFoam/sonicLiquidFoam/Make/files deleted file mode 100644 index 17d1d393f4..0000000000 --- a/applications/solvers/compressible/sonicFoam/sonicLiquidFoam/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -sonicLiquidFoam.C - -EXE = $(FOAM_APPBIN)/sonicLiquidFoam diff --git a/applications/solvers/compressible/sonicFoam/sonicLiquidFoam/Make/options b/applications/solvers/compressible/sonicFoam/sonicLiquidFoam/Make/options deleted file mode 100644 index d27c95d033..0000000000 --- a/applications/solvers/compressible/sonicFoam/sonicLiquidFoam/Make/options +++ /dev/null @@ -1,7 +0,0 @@ -EXE_INC = \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude - -EXE_LIBS = \ - -lfiniteVolume \ - -lmeshTools diff --git a/applications/solvers/compressible/sonicFoam/sonicLiquidFoam/compressibleContinuityErrs.H b/applications/solvers/compressible/sonicFoam/sonicLiquidFoam/compressibleContinuityErrs.H deleted file mode 100644 index 9851dfb7a9..0000000000 --- a/applications/solvers/compressible/sonicFoam/sonicLiquidFoam/compressibleContinuityErrs.H +++ /dev/null @@ -1,12 +0,0 @@ -{ - scalar sumLocalContErr = - (sum(mag(rho - rho0 - psi*(p - p0)))/sum(rho)).value(); - - scalar globalContErr = (sum(rho - rho0 - psi*(p - p0))/sum(rho)).value(); - - cumulativeContErr += globalContErr; - - Info<< "time step continuity errors : sum local = " << sumLocalContErr - << ", global = " << globalContErr - << ", cumulative = " << cumulativeContErr << endl; -} diff --git a/applications/solvers/compressible/sonicFoam/sonicLiquidFoam/createFields.H b/applications/solvers/compressible/sonicFoam/sonicLiquidFoam/createFields.H deleted file mode 100644 index d94b173fee..0000000000 --- a/applications/solvers/compressible/sonicFoam/sonicLiquidFoam/createFields.H +++ /dev/null @@ -1,49 +0,0 @@ -#include "readThermodynamicProperties.H" -#include "readTransportProperties.H" - -Info<< "Reading field p\n" << endl; -volScalarField p -( - IOobject - ( - "p", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh -); - - -Info<< "Reading field U\n" << endl; -volVectorField U -( - IOobject - ( - "U", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh -); - -volScalarField rho -( - IOobject - ( - "rho", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - rhoO + psi*p -); - - -#include "compressibleCreatePhi.H" - -mesh.setFluxRequired(p.name()); diff --git a/applications/solvers/compressible/sonicFoam/sonicLiquidFoam/readThermodynamicProperties.H b/applications/solvers/compressible/sonicFoam/sonicLiquidFoam/readThermodynamicProperties.H deleted file mode 100644 index 82ebe7ae30..0000000000 --- a/applications/solvers/compressible/sonicFoam/sonicLiquidFoam/readThermodynamicProperties.H +++ /dev/null @@ -1,37 +0,0 @@ - Info<< "Reading thermodynamicProperties\n" << endl; - - IOdictionary thermodynamicProperties - ( - IOobject - ( - "thermodynamicProperties", - runTime.constant(), - mesh, - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE - ) - ); - - dimensionedScalar rho0 - ( - "rho0", - dimDensity, - thermodynamicProperties - ); - - dimensionedScalar p0 - ( - "p0", - dimPressure, - thermodynamicProperties - ); - - dimensionedScalar psi - ( - "psi", - dimCompressibility, - thermodynamicProperties - ); - - // Density offset, i.e. the constant part of the density - dimensionedScalar rhoO("rhoO", rho0 - psi*p0); diff --git a/applications/solvers/compressible/sonicFoam/sonicLiquidFoam/readTransportProperties.H b/applications/solvers/compressible/sonicFoam/sonicLiquidFoam/readTransportProperties.H deleted file mode 100644 index 379e211982..0000000000 --- a/applications/solvers/compressible/sonicFoam/sonicLiquidFoam/readTransportProperties.H +++ /dev/null @@ -1,20 +0,0 @@ -Info<< "Reading transportProperties\n" << endl; - -IOdictionary transportProperties -( - IOobject - ( - "transportProperties", - runTime.constant(), - mesh, - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE - ) -); - -dimensionedScalar mu -( - "mu", - dimDynamicViscosity, - transportProperties -); diff --git a/applications/solvers/compressible/sonicFoam/sonicLiquidFoam/sonicLiquidFoam.C b/applications/solvers/compressible/sonicFoam/sonicLiquidFoam/sonicLiquidFoam.C deleted file mode 100644 index 3622d2dd70..0000000000 --- a/applications/solvers/compressible/sonicFoam/sonicLiquidFoam/sonicLiquidFoam.C +++ /dev/null @@ -1,132 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Application - sonicLiquidFoam - -Description - Transient solver for trans-sonic/supersonic, laminar flow of a - compressible liquid. - -\*---------------------------------------------------------------------------*/ - -#include "fvCFD.H" -#include "pimpleControl.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -int main(int argc, char *argv[]) -{ - #include "postProcess.H" - - #include "setRootCase.H" - #include "createTime.H" - #include "createMesh.H" - #include "createControl.H" - #include "createFields.H" - #include "initContinuityErrs.H" - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - - Info<< "\nStarting time loop\n" << endl; - - while (runTime.loop()) - { - Info<< "Time = " << runTime.timeName() << nl << endl; - - #include "compressibleCourantNo.H" - - solve(fvm::ddt(rho) + fvc::div(phi)); - - // --- Pressure-velocity PIMPLE corrector loop - while (pimple.loop()) - { - fvVectorMatrix UEqn - ( - fvm::ddt(rho, U) - + fvm::div(phi, U) - - fvm::laplacian(mu, U) - ); - - solve(UEqn == -fvc::grad(p)); - - // --- Pressure corrector loop - while (pimple.correct()) - { - volScalarField rAU("rAU", 1.0/UEqn.A()); - surfaceScalarField rhorAUf - ( - "rhorAUf", - fvc::interpolate(rho*rAU) - ); - - U = rAU*UEqn.H(); - - surfaceScalarField phid - ( - "phid", - psi - *( - fvc::flux(U) - + rhorAUf*fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho) - ) - ); - - phi = (rhoO/psi)*phid; - - fvScalarMatrix pEqn - ( - fvm::ddt(psi, p) - + fvc::div(phi) - + fvm::div(phid, p) - - fvm::laplacian(rhorAUf, p) - ); - - pEqn.solve(); - - phi += pEqn.flux(); - - solve(fvm::ddt(rho) + fvc::div(phi)); - #include "compressibleContinuityErrs.H" - - U -= rAU*fvc::grad(p); - U.correctBoundaryConditions(); - } - } - - rho = rhoO + psi*p; - - runTime.write(); - - Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" - << " ClockTime = " << runTime.elapsedClockTime() << " s" - << nl << endl; - } - - Info<< "End\n" << endl; - - return 0; -} - - -// ************************************************************************* // diff --git a/bin/sonicDyMFoam b/bin/sonicDyMFoam new file mode 120000 index 0000000000..f9a4ea5582 --- /dev/null +++ b/bin/sonicDyMFoam @@ -0,0 +1 @@ +sonicFoam \ No newline at end of file diff --git a/bin/sonicFoam b/bin/sonicFoam new file mode 100755 index 0000000000..118213b761 --- /dev/null +++ b/bin/sonicFoam @@ -0,0 +1,52 @@ +#!/bin/sh +#------------------------------------------------------------------------------ +# ========= | +# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox +# \\ / O peration | +# \\ / A nd | Copyright (C) 2018 OpenFOAM Foundation +# \\/ M anipulation | +#------------------------------------------------------------------------------- +# License +# This file is part of OpenFOAM. +# +# OpenFOAM is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License +# along with OpenFOAM. If not, see . +# +# Script +# supersededByPostProcess +# +# Description +# Script to suggest using the new "postProcess" utility. +# +#------------------------------------------------------------------------------ +sonicFoam=${0##*/} + +cat <