From 038d85d713d9e989bea3164e57f51dd7a19f80e0 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Tue, 5 Jun 2018 11:14:17 +0100 Subject: [PATCH 01/15] compressibleInterFoam: Merged with compressibleInterDyMFoam compressibleInterFoam can now run with static or dynamic meshes selected in the constant/dynamicMeshDict dictionary. --- .../compressibleInterFoam/Allwclean | 1 - .../multiphase/compressibleInterFoam/Allwmake | 1 - .../compressibleInterFoam/Make/options | 12 +- .../multiphase/compressibleInterFoam/TEqn.H | 2 +- .../compressibleInterDyMFoam/Make/files | 3 - .../compressibleInterDyMFoam/Make/options | 35 ---- .../compressibleInterDyMFoam.C | 176 ------------------ .../compressibleInterDyMFoam/pEqn.H | 156 ---------------- .../compressibleInterFoam.C | 71 +++++-- .../correctPhi.H | 2 - .../multiphase/compressibleInterFoam/pEqn.H | 31 ++- bin/compressibleInterDyMFoam | 1 + bin/mergedDyM | 2 +- .../RAS/sloshingTank2D/0/T | 0 .../RAS/sloshingTank2D/0/U | 0 .../RAS/sloshingTank2D/0/alpha.water.orig | 0 .../RAS/sloshingTank2D/0/p | 0 .../RAS/sloshingTank2D/0/p_rgh | 0 .../RAS/sloshingTank2D/Allclean | 0 .../RAS/sloshingTank2D/Allrun | 0 .../sloshingTank2D/constant/dynamicMeshDict | 0 .../RAS/sloshingTank2D/constant/g | 0 .../constant/thermophysicalProperties | 0 .../constant/thermophysicalProperties.air | 0 .../constant/thermophysicalProperties.water | 0 .../constant/transportProperties | 0 .../constant/turbulenceProperties | 0 .../sloshingTank2D/system/blockMeshDict.m4 | 0 .../RAS/sloshingTank2D/system/controlDict | 2 +- .../sloshingTank2D/system/decomposeParDict | 0 .../RAS/sloshingTank2D/system/fvSchemes | 0 .../RAS/sloshingTank2D/system/fvSolution | 8 +- .../RAS/sloshingTank2D/system/setFieldsDict | 0 .../laminar/depthCharge2D/system/controlDict | 2 +- .../laminar/depthCharge2D/system/fvSolution | 12 +- .../laminar/depthCharge3D/system/fvSolution | 12 +- 36 files changed, 110 insertions(+), 419 deletions(-) delete mode 100644 applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/Make/files delete mode 100644 applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/Make/options delete mode 100644 applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C delete mode 100644 applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/pEqn.H rename applications/solvers/multiphase/compressibleInterFoam/{compressibleInterDyMFoam => }/correctPhi.H (82%) create mode 120000 bin/compressibleInterDyMFoam rename tutorials/multiphase/{compressibleInterDyMFoam => compressibleInterFoam}/RAS/sloshingTank2D/0/T (100%) rename tutorials/multiphase/{compressibleInterDyMFoam => compressibleInterFoam}/RAS/sloshingTank2D/0/U (100%) rename tutorials/multiphase/{compressibleInterDyMFoam => compressibleInterFoam}/RAS/sloshingTank2D/0/alpha.water.orig (100%) rename tutorials/multiphase/{compressibleInterDyMFoam => compressibleInterFoam}/RAS/sloshingTank2D/0/p (100%) rename tutorials/multiphase/{compressibleInterDyMFoam => compressibleInterFoam}/RAS/sloshingTank2D/0/p_rgh (100%) rename tutorials/multiphase/{compressibleInterDyMFoam => compressibleInterFoam}/RAS/sloshingTank2D/Allclean (100%) rename tutorials/multiphase/{compressibleInterDyMFoam => compressibleInterFoam}/RAS/sloshingTank2D/Allrun (100%) rename tutorials/multiphase/{compressibleInterDyMFoam => compressibleInterFoam}/RAS/sloshingTank2D/constant/dynamicMeshDict (100%) rename tutorials/multiphase/{compressibleInterDyMFoam => compressibleInterFoam}/RAS/sloshingTank2D/constant/g (100%) rename tutorials/multiphase/{compressibleInterDyMFoam => compressibleInterFoam}/RAS/sloshingTank2D/constant/thermophysicalProperties (100%) rename tutorials/multiphase/{compressibleInterDyMFoam => compressibleInterFoam}/RAS/sloshingTank2D/constant/thermophysicalProperties.air (100%) rename tutorials/multiphase/{compressibleInterDyMFoam => compressibleInterFoam}/RAS/sloshingTank2D/constant/thermophysicalProperties.water (100%) rename tutorials/multiphase/{compressibleInterDyMFoam => compressibleInterFoam}/RAS/sloshingTank2D/constant/transportProperties (100%) rename tutorials/multiphase/{compressibleInterDyMFoam => compressibleInterFoam}/RAS/sloshingTank2D/constant/turbulenceProperties (100%) rename tutorials/multiphase/{compressibleInterDyMFoam => compressibleInterFoam}/RAS/sloshingTank2D/system/blockMeshDict.m4 (100%) rename tutorials/multiphase/{compressibleInterDyMFoam => compressibleInterFoam}/RAS/sloshingTank2D/system/controlDict (98%) rename tutorials/multiphase/{compressibleInterDyMFoam => compressibleInterFoam}/RAS/sloshingTank2D/system/decomposeParDict (100%) rename tutorials/multiphase/{compressibleInterDyMFoam => compressibleInterFoam}/RAS/sloshingTank2D/system/fvSchemes (100%) rename tutorials/multiphase/{compressibleInterDyMFoam => compressibleInterFoam}/RAS/sloshingTank2D/system/fvSolution (94%) rename tutorials/multiphase/{compressibleInterDyMFoam => compressibleInterFoam}/RAS/sloshingTank2D/system/setFieldsDict (100%) diff --git a/applications/solvers/multiphase/compressibleInterFoam/Allwclean b/applications/solvers/multiphase/compressibleInterFoam/Allwclean index 773096f8bb..2e9b7fa3d7 100755 --- a/applications/solvers/multiphase/compressibleInterFoam/Allwclean +++ b/applications/solvers/multiphase/compressibleInterFoam/Allwclean @@ -6,7 +6,6 @@ wclean libso surfaceTensionModels wclean libso VoFphaseCompressibleTurbulenceModels wclean -wclean compressibleInterDyMFoam wclean compressibleInterFilmFoam #------------------------------------------------------------------------------ diff --git a/applications/solvers/multiphase/compressibleInterFoam/Allwmake b/applications/solvers/multiphase/compressibleInterFoam/Allwmake index 757145f256..5685a23f41 100755 --- a/applications/solvers/multiphase/compressibleInterFoam/Allwmake +++ b/applications/solvers/multiphase/compressibleInterFoam/Allwmake @@ -9,7 +9,6 @@ wmake $targetType surfaceTensionModels wmake $targetType VoFphaseCompressibleTurbulenceModels wmake $targetType -wmake $targetType compressibleInterDyMFoam wmake $targetType compressibleInterFilmFoam #------------------------------------------------------------------------------ diff --git a/applications/solvers/multiphase/compressibleInterFoam/Make/options b/applications/solvers/multiphase/compressibleInterFoam/Make/options index 57c4b80dce..cf5ab1021b 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/Make/options +++ b/applications/solvers/multiphase/compressibleInterFoam/Make/options @@ -2,6 +2,7 @@ EXE_INC = \ -I. \ -I../VoF \ -ItwoPhaseMixtureThermo \ + -IVoFphaseCompressibleTurbulenceModels/lnInclude \ -I$(LIB_SRC)/transportModels/compressible/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \ @@ -9,9 +10,10 @@ EXE_INC = \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/phaseCompressible/lnInclude \ - -IVoFphaseCompressibleTurbulenceModels/lnInclude \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude + -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/dynamicMesh/lnInclude \ + -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = \ -ltwoPhaseMixtureThermo \ @@ -27,4 +29,6 @@ EXE_LIBS = \ -lVoFphaseCompressibleTurbulenceModels \ -lfiniteVolume \ -lfvOptions \ - -lmeshTools + -lmeshTools \ + -ldynamicMesh \ + -ldynamicFvMesh diff --git a/applications/solvers/multiphase/compressibleInterFoam/TEqn.H b/applications/solvers/multiphase/compressibleInterFoam/TEqn.H index bf7a4bfc25..f21f74073f 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/TEqn.H +++ b/applications/solvers/multiphase/compressibleInterFoam/TEqn.H @@ -4,7 +4,7 @@ fvm::ddt(rho, T) + fvm::div(rhoPhi, T) - fvm::Sp(contErr, T) - fvm::laplacian(turbulence.alphaEff(), T) + ( - fvc::div(fvc::absolute(phi, U), p)()() - contErr/rho*p + fvc::div(fvc::absolute(phi, U), p)()() // - contErr/rho*p + (fvc::ddt(rho, K) + fvc::div(rhoPhi, K))()() - contErr*K ) *( diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/Make/files b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/Make/files deleted file mode 100644 index 121264b1a9..0000000000 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -compressibleInterDyMFoam.C - -EXE = $(FOAM_APPBIN)/compressibleInterDyMFoam diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/Make/options b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/Make/options deleted file mode 100644 index 53bc21eada..0000000000 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/Make/options +++ /dev/null @@ -1,35 +0,0 @@ -EXE_INC = \ - -I. \ - -I.. \ - -I../../VoF \ - -I../twoPhaseMixtureThermo \ - -I../VoFphaseCompressibleTurbulenceModels/lnInclude \ - -I$(LIB_SRC)/transportModels/compressible/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \ - -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ - -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ - -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ - -I$(LIB_SRC)/TurbulenceModels/phaseCompressible/lnInclude \ - -I$(LIB_SRC)/dynamicMesh/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ - -I$(LIB_SRC)/finiteVolume/lnInclude - -EXE_LIBS = \ - -ltwoPhaseMixtureThermo \ - -ltwoPhaseSurfaceTension \ - -lcompressibleTransportModels \ - -lfluidThermophysicalModels \ - -lspecie \ - -ltwoPhaseMixture \ - -ltwoPhaseProperties \ - -linterfaceProperties \ - -lturbulenceModels \ - -lcompressibleTurbulenceModels \ - -lVoFphaseCompressibleTurbulenceModels \ - -ldynamicMesh \ - -lmeshTools \ - -ldynamicFvMesh \ - -lfiniteVolume \ - -lfvOptions diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C deleted file mode 100644 index ada64bb5e2..0000000000 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C +++ /dev/null @@ -1,176 +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 - compressibleInterDyMFoam - -Description - Solver for 2 compressible, non-isothermal immiscible fluids using a VOF - (volume of fluid) phase-fraction based interface capturing approach, - with optional mesh motion and mesh topology changes including adaptive - re-meshing. - - The momentum and other fluid properties are of the "mixture" and a single - momentum equation is solved. - - Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected. - -\*---------------------------------------------------------------------------*/ - -#include "fvCFD.H" -#include "dynamicFvMesh.H" -#include "CMULES.H" -#include "EulerDdtScheme.H" -#include "localEulerDdtScheme.H" -#include "CrankNicolsonDdtScheme.H" -#include "subCycle.H" -#include "compressibleInterPhaseTransportModel.H" -#include "pimpleControl.H" -#include "fvOptions.H" -#include "CorrectPhi.H" -#include "fvcSmooth.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -int main(int argc, char *argv[]) -{ - #include "postProcess.H" - - #include "setRootCase.H" - #include "createTime.H" - #include "createDynamicFvMesh.H" - #include "initContinuityErrs.H" - #include "createDyMControls.H" - #include "createFields.H" - #include "createUf.H" - #include "CourantNo.H" - #include "setInitialDeltaT.H" - - volScalarField& p = mixture.p(); - volScalarField& T = mixture.T(); - const volScalarField& psi1 = mixture.thermo1().psi(); - const volScalarField& psi2 = mixture.thermo2().psi(); - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - Info<< "\nStarting time loop\n" << endl; - - while (runTime.run()) - { - #include "readDyMControls.H" - - // Store divU from the previous mesh so that it can be mapped - // and used in correctPhi to ensure the corrected phi has the - // same divergence - volScalarField divU("divU0", fvc::div(fvc::absolute(phi, U))); - - if (LTS) - { - #include "setRDeltaT.H" - } - else - { - #include "CourantNo.H" - #include "alphaCourantNo.H" - #include "setDeltaT.H" - } - - runTime++; - - Info<< "Time = " << runTime.timeName() << nl << endl; - - // --- Pressure-velocity PIMPLE corrector loop - while (pimple.loop()) - { - if (pimple.firstIter() || moveMeshOuterCorrectors) - { - scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime(); - - mesh.update(); - - if (mesh.changing()) - { - - MRF.update(); - - Info<< "Execution time for mesh.update() = " - << runTime.elapsedCpuTime() - timeBeforeMeshUpdate - << " s" << endl; - - gh = (g & mesh.C()) - ghRef; - ghf = (g & mesh.Cf()) - ghRef; - - if (correctPhi) - { - // Calculate absolute flux - // from the mapped surface velocity - phi = mesh.Sf() & Uf; - - #include "correctPhi.H" - - // Make the fluxes relative to the mesh motion - fvc::makeRelative(phi, U); - - mixture.correct(); - } - - if (checkMeshCourantNo) - { - #include "meshCourantNo.H" - } - } - } - - #include "alphaControls.H" - #include "compressibleAlphaEqnSubCycle.H" - - turbulence.correctPhasePhi(); - - #include "UEqn.H" - #include "TEqn.H" - - // --- Pressure corrector loop - while (pimple.correct()) - { - #include "pEqn.H" - } - - if (pimple.turbCorr()) - { - turbulence.correct(); - } - } - - runTime.write(); - - Info<< "ExecutionTime = " - << runTime.elapsedCpuTime() - << " s\n\n" << endl; - } - - Info<< "End\n" << endl; - - return 0; -} - - -// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/pEqn.H b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/pEqn.H deleted file mode 100644 index 49ad93a45c..0000000000 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/pEqn.H +++ /dev/null @@ -1,156 +0,0 @@ -{ - volScalarField rAU("rAU", 1.0/UEqn.A()); - surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU)); - volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh)); - surfaceScalarField phiHbyA - ( - "phiHbyA", - fvc::flux(HbyA) - + MRF.zeroFilter(fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, Uf)) - ); - MRF.makeRelative(phiHbyA); - - surfaceScalarField phig - ( - ( - mixture.surfaceTensionForce() - - ghf*fvc::snGrad(rho) - )*rAUf*mesh.magSf() - ); - - phiHbyA += phig; - - // Update the pressure BCs to ensure flux consistency - constrainPressure(p_rgh, U, phiHbyA, rAUf, MRF); - - // Make the fluxes relative to the mesh motion - fvc::makeRelative(phiHbyA, U); - - tmp p_rghEqnComp1; - tmp p_rghEqnComp2; - - if (pimple.transonic()) - { - #include "rhofs.H" - - surfaceScalarField phid1("phid1", fvc::interpolate(psi1)*phi); - surfaceScalarField phid2("phid2", fvc::interpolate(psi2)*phi); - - p_rghEqnComp1 = - pos(alpha1) - *( - ( - fvc::ddt(alpha1, rho1) + fvc::div(alphaPhi1*rho1f) - - (fvOptions(alpha1, mixture.thermo1().rho())&rho1) - )/rho1 - - fvc::ddt(alpha1) - fvc::div(alphaPhi1) - + (alpha1/rho1) - *correction - ( - psi1*fvm::ddt(p_rgh) - + fvm::div(phid1, p_rgh) - fvm::Sp(fvc::div(phid1), p_rgh) - ) - ); - p_rghEqnComp1.ref().relax(); - - p_rghEqnComp2 = - pos(alpha2) - *( - ( - fvc::ddt(alpha2, rho2) + fvc::div(alphaPhi2*rho2f) - - (fvOptions(alpha2, mixture.thermo2().rho())&rho2) - )/rho2 - - fvc::ddt(alpha2) - fvc::div(alphaPhi2) - + (alpha2/rho2) - *correction - ( - psi2*fvm::ddt(p_rgh) - + fvm::div(phid2, p_rgh) - fvm::Sp(fvc::div(phid2), p_rgh) - ) - ); - p_rghEqnComp2.ref().relax(); - } - else - { - #include "rhofs.H" - - p_rghEqnComp1 = - pos(alpha1) - *( - ( - fvc::ddt(alpha1, rho1) + fvc::div(alphaPhi1*rho1f) - - (fvOptions(alpha1, mixture.thermo1().rho())&rho1) - )/rho1 - - fvc::ddt(alpha1) - fvc::div(alphaPhi1) - + fvc::div(mesh.phi())*alpha1 - + (alpha1*psi1/rho1)*correction(fvm::ddt(p_rgh)) - ); - - p_rghEqnComp2 = - pos(alpha2) - *( - ( - fvc::ddt(alpha2, rho2) + fvc::div(alphaPhi2*rho2f) - - (fvOptions(alpha2, mixture.thermo2().rho())&rho2) - )/rho2 - - fvc::ddt(alpha2) - fvc::div(alphaPhi2) - + fvc::div(mesh.phi())*alpha2 - + (alpha2*psi2/rho2)*correction(fvm::ddt(p_rgh)) - ); - } - - // Cache p_rgh prior to solve for density update - volScalarField p_rgh_0(p_rgh); - - while (pimple.correctNonOrthogonal()) - { - fvScalarMatrix p_rghEqnIncomp - ( - fvc::div(phiHbyA) - - fvm::laplacian(rAUf, p_rgh) - ); - - solve - ( - p_rghEqnComp1() + p_rghEqnComp2() + p_rghEqnIncomp, - mesh.solver(p_rgh.select(pimple.finalInnerIter())) - ); - - if (pimple.finalNonOrthogonalIter()) - { - p = max(p_rgh + (alpha1*rho1 + alpha2*rho2)*gh, pMin); - p_rgh = p - (alpha1*rho1 + alpha2*rho2)*gh; - - dgdt = - ( - alpha1*(p_rghEqnComp2 & p_rgh) - - alpha2*(p_rghEqnComp1 & p_rgh) - ); - - phi = phiHbyA + p_rghEqnIncomp.flux(); - - U = HbyA - + rAU*fvc::reconstruct((phig + p_rghEqnIncomp.flux())/rAUf); - U.correctBoundaryConditions(); - fvOptions.correct(U); - } - } - - { - Uf = fvc::interpolate(U); - surfaceVectorField n(mesh.Sf()/mesh.magSf()); - Uf += n*(fvc::absolute(phi, U)/mesh.magSf() - (n & Uf)); - } - - // Update densities from change in p_rgh - mixture.thermo1().correctRho(psi1*(p_rgh - p_rgh_0)); - mixture.thermo2().correctRho(psi2*(p_rgh - p_rgh_0)); - - rho = alpha1*rho1 + alpha2*rho2; - - // Correct p_rgh for consistency with p and the updated densities - p_rgh = p - rho*gh; - p_rgh.correctBoundaryConditions(); - - K = 0.5*magSqr(U); -} diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C index d5bf141657..91fdfcd16e 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,7 +26,9 @@ Application Description Solver for 2 compressible, non-isothermal immiscible fluids using a VOF - (volume of fluid) phase-fraction based interface capturing approach. + (volume of fluid) phase-fraction based interface capturing approach, + with optional mesh motion and mesh topology changes including adaptive + re-meshing. The momentum and other fluid properties are of the "mixture" and a single momentum equation is solved. @@ -39,6 +41,7 @@ Description \*---------------------------------------------------------------------------*/ #include "fvCFD.H" +#include "dynamicFvMesh.H" #include "CMULES.H" #include "EulerDdtScheme.H" #include "localEulerDdtScheme.H" @@ -47,6 +50,7 @@ Description #include "compressibleInterPhaseTransportModel.H" #include "pimpleControl.H" #include "fvOptions.H" +#include "CorrectPhi.H" #include "fvcSmooth.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -57,30 +61,30 @@ int main(int argc, char *argv[]) #include "setRootCase.H" #include "createTime.H" - #include "createMesh.H" - #include "createControl.H" - #include "createTimeControls.H" + #include "createDynamicFvMesh.H" + #include "initContinuityErrs.H" + #include "createDyMControls.H" #include "createFields.H" + #include "CourantNo.H" + #include "setInitialDeltaT.H" + #include "createUfIfPresent.H" volScalarField& p = mixture.p(); volScalarField& T = mixture.T(); const volScalarField& psi1 = mixture.thermo1().psi(); const volScalarField& psi2 = mixture.thermo2().psi(); - if (!LTS) - { - #include "readTimeControls.H" - #include "CourantNo.H" - #include "setInitialDeltaT.H" - } - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - Info<< "\nStarting time loop\n" << endl; while (runTime.run()) { - #include "readTimeControls.H" + #include "readDyMControls.H" + + // Store divU from the previous mesh so that it can be mapped + // and used in correctPhi to ensure the corrected phi has the + // same divergence + volScalarField divU("divU0", fvc::div(fvc::absolute(phi, U))); if (LTS) { @@ -100,6 +104,45 @@ int main(int argc, char *argv[]) // --- Pressure-velocity PIMPLE corrector loop while (pimple.loop()) { + if (pimple.firstIter() || moveMeshOuterCorrectors) + { + scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime(); + + mesh.update(); + + if (mesh.changing()) + { + + MRF.update(); + + Info<< "Execution time for mesh.update() = " + << runTime.elapsedCpuTime() - timeBeforeMeshUpdate + << " s" << endl; + + gh = (g & mesh.C()) - ghRef; + ghf = (g & mesh.Cf()) - ghRef; + + if (correctPhi) + { + // Calculate absolute flux + // from the mapped surface velocity + phi = mesh.Sf() & Uf(); + + #include "correctPhi.H" + + // Make the fluxes relative to the mesh motion + fvc::makeRelative(phi, U); + + mixture.correct(); + } + + if (checkMeshCourantNo) + { + #include "meshCourantNo.H" + } + } + } + #include "alphaControls.H" #include "compressibleAlphaEqnSubCycle.H" diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/correctPhi.H b/applications/solvers/multiphase/compressibleInterFoam/correctPhi.H similarity index 82% rename from applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/correctPhi.H rename to applications/solvers/multiphase/compressibleInterFoam/correctPhi.H index ad73a951ff..79860853b8 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/correctPhi.H +++ b/applications/solvers/multiphase/compressibleInterFoam/correctPhi.H @@ -8,6 +8,4 @@ CorrectPhi pimple ); -//***HGW phi.oldTime() = phi; - #include "continuityErrs.H" diff --git a/applications/solvers/multiphase/compressibleInterFoam/pEqn.H b/applications/solvers/multiphase/compressibleInterFoam/pEqn.H index 5854748e99..87ae3d1328 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/pEqn.H +++ b/applications/solvers/multiphase/compressibleInterFoam/pEqn.H @@ -6,7 +6,7 @@ ( "phiHbyA", fvc::flux(HbyA) - + MRF.zeroFilter(fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi)) + + MRF.zeroFilter(fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi, Uf)) ); MRF.makeRelative(phiHbyA); @@ -23,6 +23,9 @@ // Update the pressure BCs to ensure flux consistency constrainPressure(p_rgh, U, phiHbyA, rAUf, MRF); + // Make the fluxes relative to the mesh motion + fvc::makeRelative(phiHbyA, U); + tmp p_rghEqnComp1; tmp p_rghEqnComp2; @@ -34,8 +37,7 @@ surfaceScalarField phid2("phid2", fvc::interpolate(psi2)*phi); p_rghEqnComp1 = - pos(alpha1) - *( + ( ( fvc::ddt(alpha1, rho1) + fvc::div(alphaPhi1*rho1f) - (fvOptions(alpha1, mixture.thermo1().rho())&rho1) @@ -48,11 +50,9 @@ + fvm::div(phid1, p_rgh) - fvm::Sp(fvc::div(phid1), p_rgh) ) ); - p_rghEqnComp1.ref().relax(); p_rghEqnComp2 = - pos(alpha2) - *( + ( ( fvc::ddt(alpha2, rho2) + fvc::div(alphaPhi2*rho2f) - (fvOptions(alpha2, mixture.thermo2().rho())&rho2) @@ -65,7 +65,6 @@ + fvm::div(phid2, p_rgh) - fvm::Sp(fvc::div(phid2), p_rgh) ) ); - p_rghEqnComp2.ref().relax(); } else { @@ -94,6 +93,21 @@ ); } + if (mesh.moving()) + { + p_rghEqnComp1.ref() += fvc::div(mesh.phi())*alpha1; + p_rghEqnComp2.ref() += fvc::div(mesh.phi())*alpha2; + } + + p_rghEqnComp1.ref() *= pos(alpha1); + p_rghEqnComp2.ref() *= pos(alpha2); + + if (pimple.transonic()) + { + p_rghEqnComp1.ref().relax(); + p_rghEqnComp2.ref().relax(); + } + // Cache p_rgh prior to solve for density update volScalarField p_rgh_0(p_rgh); @@ -131,6 +145,9 @@ } } + // Correct Uf if the mesh is moving + fvc::correctUf(Uf, U, fvc::absolute(phi, U)); + // Update densities from change in p_rgh mixture.thermo1().correctRho(psi1*(p_rgh - p_rgh_0)); mixture.thermo2().correctRho(psi2*(p_rgh - p_rgh_0)); diff --git a/bin/compressibleInterDyMFoam b/bin/compressibleInterDyMFoam new file mode 120000 index 0000000000..d9fcbed5a0 --- /dev/null +++ b/bin/compressibleInterDyMFoam @@ -0,0 +1 @@ +mergedDyM \ No newline at end of file diff --git a/bin/mergedDyM b/bin/mergedDyM index eed3824241..b8179ce1ec 100755 --- a/bin/mergedDyM +++ b/bin/mergedDyM @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2017 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------- # License diff --git a/tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/0/T b/tutorials/multiphase/compressibleInterFoam/RAS/sloshingTank2D/0/T similarity index 100% rename from tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/0/T rename to tutorials/multiphase/compressibleInterFoam/RAS/sloshingTank2D/0/T diff --git a/tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/0/U b/tutorials/multiphase/compressibleInterFoam/RAS/sloshingTank2D/0/U similarity index 100% rename from tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/0/U rename to tutorials/multiphase/compressibleInterFoam/RAS/sloshingTank2D/0/U diff --git a/tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/0/alpha.water.orig b/tutorials/multiphase/compressibleInterFoam/RAS/sloshingTank2D/0/alpha.water.orig similarity index 100% rename from tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/0/alpha.water.orig rename to tutorials/multiphase/compressibleInterFoam/RAS/sloshingTank2D/0/alpha.water.orig diff --git a/tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/0/p b/tutorials/multiphase/compressibleInterFoam/RAS/sloshingTank2D/0/p similarity index 100% rename from tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/0/p rename to tutorials/multiphase/compressibleInterFoam/RAS/sloshingTank2D/0/p diff --git a/tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/0/p_rgh b/tutorials/multiphase/compressibleInterFoam/RAS/sloshingTank2D/0/p_rgh similarity index 100% rename from tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/0/p_rgh rename to tutorials/multiphase/compressibleInterFoam/RAS/sloshingTank2D/0/p_rgh diff --git a/tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/Allclean b/tutorials/multiphase/compressibleInterFoam/RAS/sloshingTank2D/Allclean similarity index 100% rename from tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/Allclean rename to tutorials/multiphase/compressibleInterFoam/RAS/sloshingTank2D/Allclean diff --git a/tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/Allrun b/tutorials/multiphase/compressibleInterFoam/RAS/sloshingTank2D/Allrun similarity index 100% rename from tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/Allrun rename to tutorials/multiphase/compressibleInterFoam/RAS/sloshingTank2D/Allrun diff --git a/tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/constant/dynamicMeshDict b/tutorials/multiphase/compressibleInterFoam/RAS/sloshingTank2D/constant/dynamicMeshDict similarity index 100% rename from tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/constant/dynamicMeshDict rename to tutorials/multiphase/compressibleInterFoam/RAS/sloshingTank2D/constant/dynamicMeshDict diff --git a/tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/constant/g b/tutorials/multiphase/compressibleInterFoam/RAS/sloshingTank2D/constant/g similarity index 100% rename from tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/constant/g rename to tutorials/multiphase/compressibleInterFoam/RAS/sloshingTank2D/constant/g diff --git a/tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/constant/thermophysicalProperties b/tutorials/multiphase/compressibleInterFoam/RAS/sloshingTank2D/constant/thermophysicalProperties similarity index 100% rename from tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/constant/thermophysicalProperties rename to tutorials/multiphase/compressibleInterFoam/RAS/sloshingTank2D/constant/thermophysicalProperties diff --git a/tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/constant/thermophysicalProperties.air b/tutorials/multiphase/compressibleInterFoam/RAS/sloshingTank2D/constant/thermophysicalProperties.air similarity index 100% rename from tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/constant/thermophysicalProperties.air rename to tutorials/multiphase/compressibleInterFoam/RAS/sloshingTank2D/constant/thermophysicalProperties.air diff --git a/tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/constant/thermophysicalProperties.water b/tutorials/multiphase/compressibleInterFoam/RAS/sloshingTank2D/constant/thermophysicalProperties.water similarity index 100% rename from tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/constant/thermophysicalProperties.water rename to tutorials/multiphase/compressibleInterFoam/RAS/sloshingTank2D/constant/thermophysicalProperties.water diff --git a/tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/constant/transportProperties b/tutorials/multiphase/compressibleInterFoam/RAS/sloshingTank2D/constant/transportProperties similarity index 100% rename from tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/constant/transportProperties rename to tutorials/multiphase/compressibleInterFoam/RAS/sloshingTank2D/constant/transportProperties diff --git a/tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/constant/turbulenceProperties b/tutorials/multiphase/compressibleInterFoam/RAS/sloshingTank2D/constant/turbulenceProperties similarity index 100% rename from tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/constant/turbulenceProperties rename to tutorials/multiphase/compressibleInterFoam/RAS/sloshingTank2D/constant/turbulenceProperties diff --git a/tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/system/blockMeshDict.m4 b/tutorials/multiphase/compressibleInterFoam/RAS/sloshingTank2D/system/blockMeshDict.m4 similarity index 100% rename from tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/system/blockMeshDict.m4 rename to tutorials/multiphase/compressibleInterFoam/RAS/sloshingTank2D/system/blockMeshDict.m4 diff --git a/tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/system/controlDict b/tutorials/multiphase/compressibleInterFoam/RAS/sloshingTank2D/system/controlDict similarity index 98% rename from tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/system/controlDict rename to tutorials/multiphase/compressibleInterFoam/RAS/sloshingTank2D/system/controlDict index cd070ec999..87a46282a4 100644 --- a/tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/system/controlDict +++ b/tutorials/multiphase/compressibleInterFoam/RAS/sloshingTank2D/system/controlDict @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -application compressibleInterDyMFoam; +application compressibleInterFoam; startFrom startTime; diff --git a/tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/system/decomposeParDict b/tutorials/multiphase/compressibleInterFoam/RAS/sloshingTank2D/system/decomposeParDict similarity index 100% rename from tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/system/decomposeParDict rename to tutorials/multiphase/compressibleInterFoam/RAS/sloshingTank2D/system/decomposeParDict diff --git a/tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/system/fvSchemes b/tutorials/multiphase/compressibleInterFoam/RAS/sloshingTank2D/system/fvSchemes similarity index 100% rename from tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/system/fvSchemes rename to tutorials/multiphase/compressibleInterFoam/RAS/sloshingTank2D/system/fvSchemes diff --git a/tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/system/fvSolution b/tutorials/multiphase/compressibleInterFoam/RAS/sloshingTank2D/system/fvSolution similarity index 94% rename from tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/system/fvSolution rename to tutorials/multiphase/compressibleInterFoam/RAS/sloshingTank2D/system/fvSolution index 84390b1eb8..bf0332eb99 100644 --- a/tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/system/fvSolution +++ b/tutorials/multiphase/compressibleInterFoam/RAS/sloshingTank2D/system/fvSolution @@ -74,8 +74,8 @@ solvers U { - solver smoothSolver; - smoother GaussSeidel; + solver PBiCGStab; + preconditioner DILU; tolerance 1e-06; relTol 0; nSweeps 1; @@ -83,8 +83,8 @@ solvers "(T|k|B|nuTilda).*" { - solver smoothSolver; - smoother symGaussSeidel; + solver PBiCGStab; + preconditioner DILU; tolerance 1e-08; relTol 0; } diff --git a/tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/system/setFieldsDict b/tutorials/multiphase/compressibleInterFoam/RAS/sloshingTank2D/system/setFieldsDict similarity index 100% rename from tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/system/setFieldsDict rename to tutorials/multiphase/compressibleInterFoam/RAS/sloshingTank2D/system/setFieldsDict diff --git a/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/system/controlDict b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/system/controlDict index dc0b7630a1..a049876aa2 100644 --- a/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/system/controlDict +++ b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/system/controlDict @@ -17,7 +17,7 @@ FoamFile application compressibleInterFoam; -startFrom startTime; +startFrom latestTime; startTime 0; diff --git a/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/system/fvSolution b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/system/fvSolution index b852c8ab23..22b936c0ba 100644 --- a/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/system/fvSolution +++ b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/system/fvSolution @@ -79,8 +79,8 @@ solvers U { - solver smoothSolver; - smoother GaussSeidel; + solver PBiCGStab; + preconditioner DILU; tolerance 1e-06; relTol 0; nSweeps 1; @@ -88,8 +88,8 @@ solvers "(T|k|B|nuTilda).*" { - solver smoothSolver; - smoother symGaussSeidel; + solver PBiCGStab; + preconditioner DILU; tolerance 1e-08; relTol 0; } @@ -99,8 +99,8 @@ PIMPLE { momentumPredictor no; transonic no; - nOuterCorrectors 3; - nCorrectors 1; + nOuterCorrectors 2; + nCorrectors 2; nNonOrthogonalCorrectors 0; } diff --git a/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/system/fvSolution b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/system/fvSolution index b1bec5a301..1be4adab31 100644 --- a/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/system/fvSolution +++ b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/system/fvSolution @@ -56,7 +56,7 @@ solvers { solver GAMG; tolerance 1e-07; - relTol 0.01; + relTol 0; smoother DIC; } @@ -79,8 +79,8 @@ solvers U { - solver smoothSolver; - smoother GaussSeidel; + solver PBiCGStab; + preconditioner DILU; tolerance 1e-06; relTol 0; nSweeps 1; @@ -88,8 +88,8 @@ solvers "(T|k|B|nuTilda).*" { - solver smoothSolver; - smoother symGaussSeidel; + solver PBiCGStab; + preconditioner DILU; tolerance 1e-08; relTol 0; } @@ -100,7 +100,7 @@ PIMPLE momentumPredictor no; transonic no; nOuterCorrectors 2; - nCorrectors 1; + nCorrectors 2; nNonOrthogonalCorrectors 0; } From 3341f925108a759f58f06ce2fd865321af6dd6ca Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Wed, 6 Jun 2018 11:07:45 +0100 Subject: [PATCH 02/15] sonicFoam, sonicDyMFoam, sonicLiquidFoam: Functionality merged into rhoPimpleFoam The sonicFoam, sonicDyMFoam and sonicLiquidFoam functionality has been merged into the transonic option of the latest rhoPimpleFoam solver and the corresponding tutorials moved into the rhoPimpleFoam tutorials directory. To run rhoPimpleFoam in transonic mode set the transonic option in the PIMPLE sub-dictionary of fvSolution: PIMPLE { . . . transonic yes; } --- .../rhoPimpleFoam/rhoPimpleFoam.C | 2 +- .../solvers/compressible/sonicFoam/EEqn.H | 21 --- .../solvers/compressible/sonicFoam/Make/files | 3 - .../compressible/sonicFoam/Make/options | 19 --- .../solvers/compressible/sonicFoam/UEqn.H | 24 --- .../compressible/sonicFoam/createFieldRefs.H | 2 - .../compressible/sonicFoam/createFields.H | 57 ------- .../solvers/compressible/sonicFoam/pEqn.H | 44 ----- .../sonicFoam/sonicDyMFoam/Make/files | 3 - .../sonicFoam/sonicDyMFoam/Make/options | 28 ---- .../sonicFoam/sonicDyMFoam/pEqn.H | 51 ------ .../sonicFoam/sonicDyMFoam/sonicDyMFoam.C | 151 ------------------ .../compressible/sonicFoam/sonicFoam.C | 103 ------------ .../sonicFoam/sonicLiquidFoam/Make/files | 3 - .../sonicFoam/sonicLiquidFoam/Make/options | 7 - .../compressibleContinuityErrs.H | 12 -- .../sonicFoam/sonicLiquidFoam/createFields.H | 49 ------ .../readThermodynamicProperties.H | 37 ----- .../sonicLiquidFoam/readTransportProperties.H | 20 --- .../sonicLiquidFoam/sonicLiquidFoam.C | 132 --------------- bin/sonicDyMFoam | 1 + bin/sonicFoam | 52 ++++++ bin/sonicLiquidFoam | 1 + etc/config.sh/bash_completion | 75 --------- .../rhoCentralFoam/shockTube/Allrun | 1 + .../shockTube/system/blockMeshDict | 2 +- .../shockTube/system/controlDict | 4 + .../rhoCentralFoam/shockTube/system/fvSchemes | 6 +- .../rhoCentralFoam/shockTube/system/sample | 13 +- .../RAS/nacaAirfoil/0/T | 0 .../RAS/nacaAirfoil/0/U | 0 .../RAS/nacaAirfoil/0/alphat | 0 .../RAS/nacaAirfoil/0/epsilon | 0 .../RAS/nacaAirfoil/0/k | 0 .../RAS/nacaAirfoil/0/nut | 0 .../RAS/nacaAirfoil/0/p | 0 .../RAS/nacaAirfoil/Allclean | 0 .../RAS/nacaAirfoil/Allrun | 0 .../RAS/nacaAirfoil/Running_Notes | 0 .../constant/thermophysicalProperties | 0 .../nacaAirfoil/constant/turbulenceProperties | 0 .../nacaAirfoil/prostar/nacaAirfoil.bnd.gz | Bin .../nacaAirfoil/prostar/nacaAirfoil.cel.gz | Bin .../nacaAirfoil/prostar/nacaAirfoil.vrt.gz | Bin .../RAS/nacaAirfoil/system/controlDict | 2 +- .../RAS/nacaAirfoil/system/fvSchemes | 0 .../RAS/nacaAirfoil/system/fvSolution | 2 + .../RAS/prism/0/T | 0 .../RAS/prism/0/U | 0 .../RAS/prism/0/alphat | 0 .../RAS/prism/0/epsilon | 0 .../RAS/prism/0/k | 0 .../RAS/prism/0/nut | 0 .../RAS/prism/0/p | 0 .../prism/constant/thermophysicalProperties | 0 .../RAS/prism/constant/turbulenceProperties | 0 .../RAS/prism/system/blockMeshDict | 0 .../RAS/prism/system/controlDict | 2 +- .../RAS/prism/system/fvSchemes | 0 .../RAS/prism/system/fvSolution | 2 + .../laminar/decompressionTank}/Allclean | 0 .../laminar/decompressionTank}/Allrun | 0 .../decompressionTank/decompressionTank}/0/T | 26 +-- .../decompressionTank}/decompressionTank/0/U | 0 .../decompressionTank}/decompressionTank/0/p | 0 .../constant/thermophysicalProperties | 33 +++- .../constant/turbulenceProperties | 1 - .../decompressionTank/system/blockMeshDict | 0 .../decompressionTank/system/controlDict | 2 +- .../decompressionTank/system/fvSchemes | 6 + .../decompressionTank}/system/fvSolution | 2 + .../laminar/forwardStep/0/T | 0 .../laminar/forwardStep/0/U | 0 .../laminar/forwardStep/0/p | 0 .../constant/thermophysicalProperties | 0 .../constant/turbulenceProperties | 0 .../laminar/forwardStep/system/blockMeshDict | 0 .../laminar/forwardStep/system/controlDict | 2 +- .../laminar/forwardStep/system/fvSchemes | 0 .../laminar/forwardStep}/system/fvSolution | 4 +- .../laminar/shockTube/0/T.orig | 0 .../laminar/shockTube/0/U.orig | 0 .../laminar/shockTube/0/p.orig | 0 .../laminar/shockTube/Allrun | 0 .../constant/thermophysicalProperties | 0 .../shockTube}/constant/turbulenceProperties | 0 .../laminar/shockTube/system/blockMeshDict | 0 .../laminar/shockTube/system/controlDict | 2 +- .../laminar/shockTube/system/fvSchemes | 0 .../laminar/shockTube/system/fvSolution | 2 + .../laminar/shockTube/system/sample | 0 .../laminar/shockTube/system/setFieldsDict | 0 .../compressible/sonicDyMFoam/movingCone/0/U | 61 ------- .../compressible/sonicDyMFoam/movingCone/0/p | 60 ------- .../sonicDyMFoam/movingCone/0/pointMotionUx | 56 ------- .../movingCone/constant/dynamicMeshDict | 28 ---- .../movingCone/system/blockMeshDict | 142 ---------------- .../movingCone/system/controlDict | 52 ------ .../movingCone/system/cuttingPlane | 38 ----- .../sonicDyMFoam/movingCone/system/fvSchemes | 58 ------- .../sonicDyMFoam/movingCone/system/fvSolution | 94 ----------- .../constant/thermodynamicProperties | 25 --- .../constant/transportProperties | 21 --- 103 files changed, 125 insertions(+), 1521 deletions(-) delete mode 100644 applications/solvers/compressible/sonicFoam/EEqn.H delete mode 100644 applications/solvers/compressible/sonicFoam/Make/files delete mode 100644 applications/solvers/compressible/sonicFoam/Make/options delete mode 100644 applications/solvers/compressible/sonicFoam/UEqn.H delete mode 100644 applications/solvers/compressible/sonicFoam/createFieldRefs.H delete mode 100644 applications/solvers/compressible/sonicFoam/createFields.H delete mode 100644 applications/solvers/compressible/sonicFoam/pEqn.H delete mode 100644 applications/solvers/compressible/sonicFoam/sonicDyMFoam/Make/files delete mode 100644 applications/solvers/compressible/sonicFoam/sonicDyMFoam/Make/options delete mode 100644 applications/solvers/compressible/sonicFoam/sonicDyMFoam/pEqn.H delete mode 100644 applications/solvers/compressible/sonicFoam/sonicDyMFoam/sonicDyMFoam.C delete mode 100644 applications/solvers/compressible/sonicFoam/sonicFoam.C delete mode 100644 applications/solvers/compressible/sonicFoam/sonicLiquidFoam/Make/files delete mode 100644 applications/solvers/compressible/sonicFoam/sonicLiquidFoam/Make/options delete mode 100644 applications/solvers/compressible/sonicFoam/sonicLiquidFoam/compressibleContinuityErrs.H delete mode 100644 applications/solvers/compressible/sonicFoam/sonicLiquidFoam/createFields.H delete mode 100644 applications/solvers/compressible/sonicFoam/sonicLiquidFoam/readThermodynamicProperties.H delete mode 100644 applications/solvers/compressible/sonicFoam/sonicLiquidFoam/readTransportProperties.H delete mode 100644 applications/solvers/compressible/sonicFoam/sonicLiquidFoam/sonicLiquidFoam.C create mode 120000 bin/sonicDyMFoam create mode 100755 bin/sonicFoam create mode 120000 bin/sonicLiquidFoam rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/RAS/nacaAirfoil/0/T (100%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/RAS/nacaAirfoil/0/U (100%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/RAS/nacaAirfoil/0/alphat (100%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/RAS/nacaAirfoil/0/epsilon (100%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/RAS/nacaAirfoil/0/k (100%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/RAS/nacaAirfoil/0/nut (100%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/RAS/nacaAirfoil/0/p (100%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/RAS/nacaAirfoil/Allclean (100%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/RAS/nacaAirfoil/Allrun (100%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/RAS/nacaAirfoil/Running_Notes (100%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/RAS/nacaAirfoil/constant/thermophysicalProperties (100%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/RAS/nacaAirfoil/constant/turbulenceProperties (100%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/RAS/nacaAirfoil/prostar/nacaAirfoil.bnd.gz (100%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/RAS/nacaAirfoil/prostar/nacaAirfoil.cel.gz (100%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/RAS/nacaAirfoil/prostar/nacaAirfoil.vrt.gz (100%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/RAS/nacaAirfoil/system/controlDict (98%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/RAS/nacaAirfoil/system/fvSchemes (100%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/RAS/nacaAirfoil/system/fvSolution (97%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/RAS/prism/0/T (100%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/RAS/prism/0/U (100%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/RAS/prism/0/alphat (100%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/RAS/prism/0/epsilon (100%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/RAS/prism/0/k (100%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/RAS/prism/0/nut (100%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/RAS/prism/0/p (100%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/RAS/prism/constant/thermophysicalProperties (100%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/RAS/prism/constant/turbulenceProperties (100%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/RAS/prism/system/blockMeshDict (100%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/RAS/prism/system/controlDict (97%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/RAS/prism/system/fvSchemes (100%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/RAS/prism/system/fvSolution (97%) rename tutorials/compressible/{sonicLiquidFoam => rhoPimpleFoam/laminar/decompressionTank}/Allclean (100%) rename tutorials/compressible/{sonicLiquidFoam => rhoPimpleFoam/laminar/decompressionTank}/Allrun (100%) rename tutorials/compressible/{sonicDyMFoam/movingCone => rhoPimpleFoam/laminar/decompressionTank/decompressionTank}/0/T (74%) rename tutorials/compressible/{sonicLiquidFoam => rhoPimpleFoam/laminar/decompressionTank}/decompressionTank/0/U (100%) rename tutorials/compressible/{sonicLiquidFoam => rhoPimpleFoam/laminar/decompressionTank}/decompressionTank/0/p (100%) rename tutorials/compressible/{sonicDyMFoam/movingCone => rhoPimpleFoam/laminar/decompressionTank/decompressionTank}/constant/thermophysicalProperties (70%) rename tutorials/compressible/{sonicFoam/laminar/shockTube => rhoPimpleFoam/laminar/decompressionTank/decompressionTank}/constant/turbulenceProperties (99%) rename tutorials/compressible/{sonicLiquidFoam => rhoPimpleFoam/laminar/decompressionTank}/decompressionTank/system/blockMeshDict (100%) rename tutorials/compressible/{sonicLiquidFoam => rhoPimpleFoam/laminar/decompressionTank}/decompressionTank/system/controlDict (97%) rename tutorials/compressible/{sonicLiquidFoam => rhoPimpleFoam/laminar/decompressionTank}/decompressionTank/system/fvSchemes (87%) rename tutorials/compressible/{sonicFoam/laminar/forwardStep => rhoPimpleFoam/laminar/decompressionTank/decompressionTank}/system/fvSolution (97%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/laminar/forwardStep/0/T (100%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/laminar/forwardStep/0/U (100%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/laminar/forwardStep/0/p (100%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/laminar/forwardStep/constant/thermophysicalProperties (100%) rename tutorials/compressible/{sonicDyMFoam/movingCone => rhoPimpleFoam/laminar/forwardStep}/constant/turbulenceProperties (100%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/laminar/forwardStep/system/blockMeshDict (100%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/laminar/forwardStep/system/controlDict (97%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/laminar/forwardStep/system/fvSchemes (100%) rename tutorials/compressible/{sonicLiquidFoam/decompressionTank => rhoPimpleFoam/laminar/forwardStep}/system/fvSolution (96%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/laminar/shockTube/0/T.orig (100%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/laminar/shockTube/0/U.orig (100%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/laminar/shockTube/0/p.orig (100%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/laminar/shockTube/Allrun (100%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/laminar/shockTube/constant/thermophysicalProperties (100%) rename tutorials/compressible/{sonicFoam/laminar/forwardStep => rhoPimpleFoam/laminar/shockTube}/constant/turbulenceProperties (100%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/laminar/shockTube/system/blockMeshDict (100%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/laminar/shockTube/system/controlDict (97%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/laminar/shockTube/system/fvSchemes (100%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/laminar/shockTube/system/fvSolution (97%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/laminar/shockTube/system/sample (100%) rename tutorials/compressible/{sonicFoam => rhoPimpleFoam}/laminar/shockTube/system/setFieldsDict (100%) delete mode 100644 tutorials/compressible/sonicDyMFoam/movingCone/0/U delete mode 100644 tutorials/compressible/sonicDyMFoam/movingCone/0/p delete mode 100644 tutorials/compressible/sonicDyMFoam/movingCone/0/pointMotionUx delete mode 100644 tutorials/compressible/sonicDyMFoam/movingCone/constant/dynamicMeshDict delete mode 100644 tutorials/compressible/sonicDyMFoam/movingCone/system/blockMeshDict delete mode 100644 tutorials/compressible/sonicDyMFoam/movingCone/system/controlDict delete mode 100644 tutorials/compressible/sonicDyMFoam/movingCone/system/cuttingPlane delete mode 100644 tutorials/compressible/sonicDyMFoam/movingCone/system/fvSchemes delete mode 100644 tutorials/compressible/sonicDyMFoam/movingCone/system/fvSolution delete mode 100644 tutorials/compressible/sonicLiquidFoam/decompressionTank/constant/thermodynamicProperties delete mode 100644 tutorials/compressible/sonicLiquidFoam/decompressionTank/constant/transportProperties 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 < Date: Mon, 2 Jul 2018 17:23:40 +0100 Subject: [PATCH 03/15] bin/tools/HookFunctions: Filter out gtagsrc which contains valid tabs --- bin/tools/HookFunctions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/tools/HookFunctions b/bin/tools/HookFunctions index 70cbf029cc..3fb6f3d14d 100755 --- a/bin/tools/HookFunctions +++ b/bin/tools/HookFunctions @@ -181,7 +181,7 @@ checkIllegalCode() do case "$f" in # exclude potential makefiles - (*[Mm]akefile* | wmake/rules/* | *.f* | *.v[cf]proj | *.pdf | *.png | *.html | *.gif | *.css | *.gz) + (*[Mm]akefile* | wmake/rules/* | bin/tools/gtagsrc | *.f* | *.v[cf]proj | *.pdf | *.png | *.html | *.gif | *.css | *.gz) ;; (*) fileType=`file -b $f` From bbc5853e3d9b915af81710a5caf8ae302c1adc4c Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Mon, 2 Jul 2018 20:41:20 +0100 Subject: [PATCH 04/15] rhoCentralFoam: Merged with rhoCentralDyMFoam rhoCentralFoam can now run with static or dynamic meshes selected in the constant/dynamicMeshDict dictionary. --- .../compressible/rhoCentralFoam/Allwclean | 1 - .../compressible/rhoCentralFoam/Allwmake | 2 +- .../compressible/rhoCentralFoam/Make/options | 4 +- .../rhoCentralDyMFoam/Make/files | 3 - .../rhoCentralDyMFoam/Make/options | 26 -- .../rhoCentralDyMFoam/rhoCentralDyMFoam.C | 269 ------------------ .../rhoCentralFoam/rhoCentralFoam.C | 37 ++- bin/rhoCentralDyMFoam | 1 + .../movingCone/0/T | 0 .../movingCone/0/U | 0 .../movingCone/0/p | 0 .../movingCone/0/pointMotionUx | 0 .../movingCone/constant/dynamicMeshDict | 0 .../constant/thermophysicalProperties | 0 .../movingCone/constant/turbulenceProperties | 0 .../movingCone/system/blockMeshDict | 0 .../movingCone/system/controlDict | 2 +- .../movingCone/system/cuttingPlane | 0 .../movingCone/system/fvSchemes | 0 .../movingCone/system/fvSolution | 0 20 files changed, 34 insertions(+), 311 deletions(-) delete mode 100644 applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/Make/files delete mode 100644 applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/Make/options delete mode 100644 applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/rhoCentralDyMFoam.C create mode 120000 bin/rhoCentralDyMFoam rename tutorials/compressible/{rhoCentralDyMFoam => rhoCentralFoam}/movingCone/0/T (100%) rename tutorials/compressible/{rhoCentralDyMFoam => rhoCentralFoam}/movingCone/0/U (100%) rename tutorials/compressible/{rhoCentralDyMFoam => rhoCentralFoam}/movingCone/0/p (100%) rename tutorials/compressible/{rhoCentralDyMFoam => rhoCentralFoam}/movingCone/0/pointMotionUx (100%) rename tutorials/compressible/{rhoCentralDyMFoam => rhoCentralFoam}/movingCone/constant/dynamicMeshDict (100%) rename tutorials/compressible/{rhoCentralDyMFoam => rhoCentralFoam}/movingCone/constant/thermophysicalProperties (100%) rename tutorials/compressible/{rhoCentralDyMFoam => rhoCentralFoam}/movingCone/constant/turbulenceProperties (100%) rename tutorials/compressible/{rhoCentralDyMFoam => rhoCentralFoam}/movingCone/system/blockMeshDict (100%) rename tutorials/compressible/{rhoCentralDyMFoam => rhoCentralFoam}/movingCone/system/controlDict (97%) rename tutorials/compressible/{rhoCentralDyMFoam => rhoCentralFoam}/movingCone/system/cuttingPlane (100%) rename tutorials/compressible/{rhoCentralDyMFoam => rhoCentralFoam}/movingCone/system/fvSchemes (100%) rename tutorials/compressible/{rhoCentralDyMFoam => rhoCentralFoam}/movingCone/system/fvSolution (100%) diff --git a/applications/solvers/compressible/rhoCentralFoam/Allwclean b/applications/solvers/compressible/rhoCentralFoam/Allwclean index 787221b83c..abc2014e90 100755 --- a/applications/solvers/compressible/rhoCentralFoam/Allwclean +++ b/applications/solvers/compressible/rhoCentralFoam/Allwclean @@ -3,6 +3,5 @@ cd ${0%/*} || exit 1 # Run from this directory wclean libso BCs wclean -wclean rhoCentralDyMFoam #------------------------------------------------------------------------------ diff --git a/applications/solvers/compressible/rhoCentralFoam/Allwmake b/applications/solvers/compressible/rhoCentralFoam/Allwmake index 5dee7d1a88..e6ead0f47d 100755 --- a/applications/solvers/compressible/rhoCentralFoam/Allwmake +++ b/applications/solvers/compressible/rhoCentralFoam/Allwmake @@ -4,6 +4,6 @@ cd ${0%/*} || exit 1 # Run from this directory # Parse arguments for library compilation . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments -(wmake $targetType BCs && wmake $targetType && wmake $targetType rhoCentralDyMFoam) +(wmake $targetType BCs && wmake $targetType) #------------------------------------------------------------------------------ diff --git a/applications/solvers/compressible/rhoCentralFoam/Make/options b/applications/solvers/compressible/rhoCentralFoam/Make/options index 24fc2d966e..3b71f3ea95 100644 --- a/applications/solvers/compressible/rhoCentralFoam/Make/options +++ b/applications/solvers/compressible/rhoCentralFoam/Make/options @@ -6,7 +6,7 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ - -I$(LIB_SRC)/dynamicMesh/lnInclude \ + -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude EXE_LIBS = \ @@ -18,4 +18,6 @@ EXE_LIBS = \ -lrhoCentralFoam \ -lturbulenceModels \ -lcompressibleTurbulenceModels \ + -ldynamicFvMesh \ + -ltopoChangerFvMesh \ -lmeshTools diff --git a/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/Make/files b/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/Make/files deleted file mode 100644 index f78400aa8d..0000000000 --- a/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -rhoCentralDyMFoam.C - -EXE = $(FOAM_APPBIN)/rhoCentralDyMFoam diff --git a/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/Make/options b/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/Make/options deleted file mode 100644 index 29b8a6faa4..0000000000 --- a/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/Make/options +++ /dev/null @@ -1,26 +0,0 @@ -EXE_INC = \ - -I.. \ - -I../BCs/lnInclude \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/transportModels/compressible/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ - -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ - -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ - -I$(LIB_SRC)/dynamicMesh/lnInclude \ - -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude - -EXE_LIBS = \ - -lfiniteVolume \ - -lfvOptions \ - -lcompressibleTransportModels \ - -lfluidThermophysicalModels \ - -lspecie \ - -lrhoCentralFoam \ - -lturbulenceModels \ - -lcompressibleTurbulenceModels \ - -ldynamicMesh \ - -ldynamicFvMesh \ - -ltopoChangerFvMesh \ - -lmeshTools diff --git a/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/rhoCentralDyMFoam.C b/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/rhoCentralDyMFoam.C deleted file mode 100644 index 898f2eba95..0000000000 --- a/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/rhoCentralDyMFoam.C +++ /dev/null @@ -1,269 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011-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 . - -Application - rhoCentralDyMFoam - -Description - Density-based compressible flow solver based on central-upwind schemes of - Kurganov and Tadmor with support for mesh-motion and topology changes. - -\*---------------------------------------------------------------------------*/ - -#include "fvCFD.H" -#include "dynamicFvMesh.H" -#include "psiThermo.H" -#include "turbulentFluidThermoModel.H" -#include "fixedRhoFvPatchScalarField.H" -#include "directionInterpolate.H" -#include "localEulerDdtScheme.H" -#include "fvcSmooth.H" -#include "motionSolver.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -int main(int argc, char *argv[]) -{ - #define NO_CONTROL - #include "postProcess.H" - - #include "setRootCaseLists.H" - #include "createTime.H" - #include "createDynamicFvMesh.H" - #include "createFields.H" - #include "createFieldRefs.H" - #include "createTimeControls.H" - - turbulence->validate(); - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - - #include "readFluxScheme.H" - - dimensionedScalar v_zero("v_zero", dimVolume/dimTime, 0.0); - - // Courant numbers used to adjust the time-step - scalar CoNum = 0.0; - scalar meanCoNum = 0.0; - - Info<< "\nStarting time loop\n" << endl; - - while (runTime.run()) - { - #include "readTimeControls.H" - #include "setDeltaT.H" - - runTime++; - - Info<< "Time = " << runTime.timeName() << nl << endl; - - // Do any mesh changes - mesh.update(); - - // --- Directed interpolation of primitive fields onto faces - - surfaceScalarField rho_pos(interpolate(rho, pos)); - surfaceScalarField rho_neg(interpolate(rho, neg)); - - surfaceVectorField rhoU_pos(interpolate(rhoU, pos, U.name())); - surfaceVectorField rhoU_neg(interpolate(rhoU, neg, U.name())); - - volScalarField rPsi("rPsi", 1.0/psi); - surfaceScalarField rPsi_pos(interpolate(rPsi, pos, T.name())); - surfaceScalarField rPsi_neg(interpolate(rPsi, neg, T.name())); - - surfaceScalarField e_pos(interpolate(e, pos, T.name())); - surfaceScalarField e_neg(interpolate(e, neg, T.name())); - - surfaceVectorField U_pos("U_pos", rhoU_pos/rho_pos); - surfaceVectorField U_neg("U_neg", rhoU_neg/rho_neg); - - surfaceScalarField p_pos("p_pos", rho_pos*rPsi_pos); - surfaceScalarField p_neg("p_neg", rho_neg*rPsi_neg); - - surfaceScalarField phiv_pos("phiv_pos", U_pos & mesh.Sf()); - surfaceScalarField phiv_neg("phiv_neg", U_neg & mesh.Sf()); - - // Make fluxes relative to mesh-motion - if (mesh.moving()) - { - phiv_pos -= mesh.phi(); - phiv_neg -= mesh.phi(); - } - - volScalarField c("c", sqrt(thermo.Cp()/thermo.Cv()*rPsi)); - surfaceScalarField cSf_pos - ( - "cSf_pos", - interpolate(c, pos, T.name())*mesh.magSf() - ); - surfaceScalarField cSf_neg - ( - "cSf_neg", - interpolate(c, neg, T.name())*mesh.magSf() - ); - - surfaceScalarField ap - ( - "ap", - max(max(phiv_pos + cSf_pos, phiv_neg + cSf_neg), v_zero) - ); - surfaceScalarField am - ( - "am", - min(min(phiv_pos - cSf_pos, phiv_neg - cSf_neg), v_zero) - ); - - surfaceScalarField a_pos("a_pos", ap/(ap - am)); - - surfaceScalarField amaxSf("amaxSf", max(mag(am), mag(ap))); - - surfaceScalarField aSf("aSf", am*a_pos); - - if (fluxScheme == "Tadmor") - { - aSf = -0.5*amaxSf; - a_pos = 0.5; - } - - surfaceScalarField a_neg("a_neg", 1.0 - a_pos); - - phiv_pos *= a_pos; - phiv_neg *= a_neg; - - surfaceScalarField aphiv_pos("aphiv_pos", phiv_pos - aSf); - surfaceScalarField aphiv_neg("aphiv_neg", phiv_neg + aSf); - - // Reuse amaxSf for the maximum positive and negative fluxes - // estimated by the central scheme - amaxSf = max(mag(aphiv_pos), mag(aphiv_neg)); - - #include "centralCourantNo.H" - - phi = aphiv_pos*rho_pos + aphiv_neg*rho_neg; - - surfaceVectorField phiUp - ( - (aphiv_pos*rhoU_pos + aphiv_neg*rhoU_neg) - + (a_pos*p_pos + a_neg*p_neg)*mesh.Sf() - ); - - surfaceScalarField phiEp - ( - "phiEp", - aphiv_pos*(rho_pos*(e_pos + 0.5*magSqr(U_pos)) + p_pos) - + aphiv_neg*(rho_neg*(e_neg + 0.5*magSqr(U_neg)) + p_neg) - + aSf*p_pos - aSf*p_neg - ); - - // Make flux for pressure-work absolute - if (mesh.moving()) - { - phiEp += mesh.phi()*(a_pos*p_pos + a_neg*p_neg); - } - - volScalarField muEff("muEff", turbulence->muEff()); - volTensorField tauMC("tauMC", muEff*dev2(Foam::T(fvc::grad(U)))); - - // --- Solve density - solve(fvm::ddt(rho) + fvc::div(phi)); - - // --- Solve momentum - solve(fvm::ddt(rhoU) + fvc::div(phiUp)); - - U.ref() = - rhoU() - /rho(); - U.correctBoundaryConditions(); - rhoU.boundaryFieldRef() == rho.boundaryField()*U.boundaryField(); - - if (!inviscid) - { - solve - ( - fvm::ddt(rho, U) - fvc::ddt(rho, U) - - fvm::laplacian(muEff, U) - - fvc::div(tauMC) - ); - rhoU = rho*U; - } - - // --- Solve energy - surfaceScalarField sigmaDotU - ( - "sigmaDotU", - ( - fvc::interpolate(muEff)*mesh.magSf()*fvc::snGrad(U) - + fvc::dotInterpolate(mesh.Sf(), tauMC) - ) - & (a_pos*U_pos + a_neg*U_neg) - ); - - solve - ( - fvm::ddt(rhoE) - + fvc::div(phiEp) - - fvc::div(sigmaDotU) - ); - - e = rhoE/rho - 0.5*magSqr(U); - e.correctBoundaryConditions(); - thermo.correct(); - rhoE.boundaryFieldRef() == - rho.boundaryField()* - ( - e.boundaryField() + 0.5*magSqr(U.boundaryField()) - ); - - if (!inviscid) - { - solve - ( - fvm::ddt(rho, e) - fvc::ddt(rho, e) - - fvm::laplacian(turbulence->alphaEff(), e) - ); - thermo.correct(); - rhoE = rho*(e + 0.5*magSqr(U)); - } - - p.ref() = - rho() - /psi(); - p.correctBoundaryConditions(); - rho.boundaryFieldRef() == psi.boundaryField()*p.boundaryField(); - - 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/rhoCentralFoam/rhoCentralFoam.C b/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C index ae735b1d7f..6510a37ec0 100644 --- a/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C +++ b/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C @@ -26,11 +26,12 @@ Application Description Density-based compressible flow solver based on central-upwind schemes of - Kurganov and Tadmor. + Kurganov and Tadmor with support for mesh-motion and topology changes. \*---------------------------------------------------------------------------*/ #include "fvCFD.H" +#include "dynamicFvMesh.H" #include "psiThermo.H" #include "turbulentFluidThermoModel.H" #include "fixedRhoFvPatchScalarField.H" @@ -47,7 +48,7 @@ int main(int argc, char *argv[]) #include "setRootCaseLists.H" #include "createTime.H" - #include "createMesh.H" + #include "createDynamicFvMesh.H" #include "createFields.H" #include "createFieldRefs.H" #include "createTimeControls.H" @@ -68,6 +69,17 @@ int main(int argc, char *argv[]) while (runTime.run()) { + #include "readTimeControls.H" + + if (!LTS) + { + #include "setDeltaT.H" + runTime++; + + // Do any mesh changes + mesh.update(); + } + // --- Directed interpolation of primitive fields onto faces surfaceScalarField rho_pos(interpolate(rho, pos)); @@ -92,6 +104,13 @@ int main(int argc, char *argv[]) surfaceScalarField phiv_pos("phiv_pos", U_pos & mesh.Sf()); surfaceScalarField phiv_neg("phiv_neg", U_neg & mesh.Sf()); + // Make fluxes relative to mesh-motion + if (mesh.moving()) + { + phiv_pos -= mesh.phi(); + phiv_neg -= mesh.phi(); + } + volScalarField c("c", sqrt(thermo.Cp()/thermo.Cv()*rPsi)); surfaceScalarField cSf_pos ( @@ -140,18 +159,12 @@ int main(int argc, char *argv[]) amaxSf = max(mag(aphiv_pos), mag(aphiv_neg)); #include "centralCourantNo.H" - #include "readTimeControls.H" if (LTS) { #include "setRDeltaT.H" + runTime++; } - else - { - #include "setDeltaT.H" - } - - runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; @@ -171,6 +184,12 @@ int main(int argc, char *argv[]) + aSf*p_pos - aSf*p_neg ); + // Make flux for pressure-work absolute + if (mesh.moving()) + { + phiEp += mesh.phi()*(a_pos*p_pos + a_neg*p_neg); + } + volScalarField muEff("muEff", turbulence->muEff()); volTensorField tauMC("tauMC", muEff*dev2(Foam::T(fvc::grad(U)))); diff --git a/bin/rhoCentralDyMFoam b/bin/rhoCentralDyMFoam new file mode 120000 index 0000000000..d9fcbed5a0 --- /dev/null +++ b/bin/rhoCentralDyMFoam @@ -0,0 +1 @@ +mergedDyM \ No newline at end of file diff --git a/tutorials/compressible/rhoCentralDyMFoam/movingCone/0/T b/tutorials/compressible/rhoCentralFoam/movingCone/0/T similarity index 100% rename from tutorials/compressible/rhoCentralDyMFoam/movingCone/0/T rename to tutorials/compressible/rhoCentralFoam/movingCone/0/T diff --git a/tutorials/compressible/rhoCentralDyMFoam/movingCone/0/U b/tutorials/compressible/rhoCentralFoam/movingCone/0/U similarity index 100% rename from tutorials/compressible/rhoCentralDyMFoam/movingCone/0/U rename to tutorials/compressible/rhoCentralFoam/movingCone/0/U diff --git a/tutorials/compressible/rhoCentralDyMFoam/movingCone/0/p b/tutorials/compressible/rhoCentralFoam/movingCone/0/p similarity index 100% rename from tutorials/compressible/rhoCentralDyMFoam/movingCone/0/p rename to tutorials/compressible/rhoCentralFoam/movingCone/0/p diff --git a/tutorials/compressible/rhoCentralDyMFoam/movingCone/0/pointMotionUx b/tutorials/compressible/rhoCentralFoam/movingCone/0/pointMotionUx similarity index 100% rename from tutorials/compressible/rhoCentralDyMFoam/movingCone/0/pointMotionUx rename to tutorials/compressible/rhoCentralFoam/movingCone/0/pointMotionUx diff --git a/tutorials/compressible/rhoCentralDyMFoam/movingCone/constant/dynamicMeshDict b/tutorials/compressible/rhoCentralFoam/movingCone/constant/dynamicMeshDict similarity index 100% rename from tutorials/compressible/rhoCentralDyMFoam/movingCone/constant/dynamicMeshDict rename to tutorials/compressible/rhoCentralFoam/movingCone/constant/dynamicMeshDict diff --git a/tutorials/compressible/rhoCentralDyMFoam/movingCone/constant/thermophysicalProperties b/tutorials/compressible/rhoCentralFoam/movingCone/constant/thermophysicalProperties similarity index 100% rename from tutorials/compressible/rhoCentralDyMFoam/movingCone/constant/thermophysicalProperties rename to tutorials/compressible/rhoCentralFoam/movingCone/constant/thermophysicalProperties diff --git a/tutorials/compressible/rhoCentralDyMFoam/movingCone/constant/turbulenceProperties b/tutorials/compressible/rhoCentralFoam/movingCone/constant/turbulenceProperties similarity index 100% rename from tutorials/compressible/rhoCentralDyMFoam/movingCone/constant/turbulenceProperties rename to tutorials/compressible/rhoCentralFoam/movingCone/constant/turbulenceProperties diff --git a/tutorials/compressible/rhoCentralDyMFoam/movingCone/system/blockMeshDict b/tutorials/compressible/rhoCentralFoam/movingCone/system/blockMeshDict similarity index 100% rename from tutorials/compressible/rhoCentralDyMFoam/movingCone/system/blockMeshDict rename to tutorials/compressible/rhoCentralFoam/movingCone/system/blockMeshDict diff --git a/tutorials/compressible/rhoCentralDyMFoam/movingCone/system/controlDict b/tutorials/compressible/rhoCentralFoam/movingCone/system/controlDict similarity index 97% rename from tutorials/compressible/rhoCentralDyMFoam/movingCone/system/controlDict rename to tutorials/compressible/rhoCentralFoam/movingCone/system/controlDict index 9458edb8dd..055217c72d 100644 --- a/tutorials/compressible/rhoCentralDyMFoam/movingCone/system/controlDict +++ b/tutorials/compressible/rhoCentralFoam/movingCone/system/controlDict @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -application rhoCentralDyMFoam; +application rhoCentralFoam; startFrom startTime; diff --git a/tutorials/compressible/rhoCentralDyMFoam/movingCone/system/cuttingPlane b/tutorials/compressible/rhoCentralFoam/movingCone/system/cuttingPlane similarity index 100% rename from tutorials/compressible/rhoCentralDyMFoam/movingCone/system/cuttingPlane rename to tutorials/compressible/rhoCentralFoam/movingCone/system/cuttingPlane diff --git a/tutorials/compressible/rhoCentralDyMFoam/movingCone/system/fvSchemes b/tutorials/compressible/rhoCentralFoam/movingCone/system/fvSchemes similarity index 100% rename from tutorials/compressible/rhoCentralDyMFoam/movingCone/system/fvSchemes rename to tutorials/compressible/rhoCentralFoam/movingCone/system/fvSchemes diff --git a/tutorials/compressible/rhoCentralDyMFoam/movingCone/system/fvSolution b/tutorials/compressible/rhoCentralFoam/movingCone/system/fvSolution similarity index 100% rename from tutorials/compressible/rhoCentralDyMFoam/movingCone/system/fvSolution rename to tutorials/compressible/rhoCentralFoam/movingCone/system/fvSolution From 97309e5538332c00890c64aacdef45e804e7a1fd Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Mon, 2 Jul 2018 21:51:58 +0100 Subject: [PATCH 05/15] potentialFreeSurfaceFoam: Merged with potentialFreeSurfaceDyMFoam potentialFreeSurfaceFoam can now run with static or dynamic meshes selected in the constant/dynamicMeshDict dictionary. --- .../potentialFreeSurfaceFoam/Make/options | 4 +- .../correctPhi.H | 0 .../potentialFreeSurfaceFoam/pEqn.H | 30 +++- .../potentialFreeSurfaceDyMFoam/Make/files | 3 - .../potentialFreeSurfaceDyMFoam/Make/options | 25 --- .../potentialFreeSurfaceDyMFoam/pEqn.H | 67 -------- .../potentialFreeSurfaceDyMFoam.C | 159 ------------------ .../potentialFreeSurfaceFoam.C | 73 +++++++- bin/potentialFreeSurfaceDyMFoam | 38 +++++ .../movingOscillatingBox}/0.orig/U | 0 .../movingOscillatingBox}/0.orig/p | 0 .../movingOscillatingBox}/0.orig/p_gh | 0 .../0.orig/pointDisplacement | 0 .../movingOscillatingBox}/Allclean | 0 .../movingOscillatingBox}/Allrun | 0 .../constant/dynamicMeshDict | 0 .../movingOscillatingBox}/constant/g | 0 .../constant/transportProperties | 0 .../constant/turbulenceProperties | 0 .../movingOscillatingBox}/extractHeightData | 0 .../system/blockMeshDict | 0 .../movingOscillatingBox}/system/controlDict | 2 +- .../system/createPatchDict | 0 .../movingOscillatingBox}/system/fvSchemes | 0 .../movingOscillatingBox}/system/fvSolution | 0 .../movingOscillatingBox}/system/topoSetDict | 0 .../system/topoSetDict-selectBottom | 0 27 files changed, 129 insertions(+), 272 deletions(-) rename applications/solvers/multiphase/potentialFreeSurfaceFoam/{potentialFreeSurfaceDyMFoam => }/correctPhi.H (100%) delete mode 100644 applications/solvers/multiphase/potentialFreeSurfaceFoam/potentialFreeSurfaceDyMFoam/Make/files delete mode 100644 applications/solvers/multiphase/potentialFreeSurfaceFoam/potentialFreeSurfaceDyMFoam/Make/options delete mode 100644 applications/solvers/multiphase/potentialFreeSurfaceFoam/potentialFreeSurfaceDyMFoam/pEqn.H delete mode 100644 applications/solvers/multiphase/potentialFreeSurfaceFoam/potentialFreeSurfaceDyMFoam/potentialFreeSurfaceDyMFoam.C create mode 100755 bin/potentialFreeSurfaceDyMFoam rename tutorials/multiphase/{potentialFreeSurfaceDyMFoam/oscillatingBox => potentialFreeSurfaceFoam/movingOscillatingBox}/0.orig/U (100%) rename tutorials/multiphase/{potentialFreeSurfaceDyMFoam/oscillatingBox => potentialFreeSurfaceFoam/movingOscillatingBox}/0.orig/p (100%) rename tutorials/multiphase/{potentialFreeSurfaceDyMFoam/oscillatingBox => potentialFreeSurfaceFoam/movingOscillatingBox}/0.orig/p_gh (100%) rename tutorials/multiphase/{potentialFreeSurfaceDyMFoam/oscillatingBox => potentialFreeSurfaceFoam/movingOscillatingBox}/0.orig/pointDisplacement (100%) rename tutorials/multiphase/{potentialFreeSurfaceDyMFoam/oscillatingBox => potentialFreeSurfaceFoam/movingOscillatingBox}/Allclean (100%) rename tutorials/multiphase/{potentialFreeSurfaceDyMFoam/oscillatingBox => potentialFreeSurfaceFoam/movingOscillatingBox}/Allrun (100%) rename tutorials/multiphase/{potentialFreeSurfaceDyMFoam/oscillatingBox => potentialFreeSurfaceFoam/movingOscillatingBox}/constant/dynamicMeshDict (100%) rename tutorials/multiphase/{potentialFreeSurfaceDyMFoam/oscillatingBox => potentialFreeSurfaceFoam/movingOscillatingBox}/constant/g (100%) rename tutorials/multiphase/{potentialFreeSurfaceDyMFoam/oscillatingBox => potentialFreeSurfaceFoam/movingOscillatingBox}/constant/transportProperties (100%) rename tutorials/multiphase/{potentialFreeSurfaceDyMFoam/oscillatingBox => potentialFreeSurfaceFoam/movingOscillatingBox}/constant/turbulenceProperties (100%) rename tutorials/multiphase/{potentialFreeSurfaceDyMFoam/oscillatingBox => potentialFreeSurfaceFoam/movingOscillatingBox}/extractHeightData (100%) rename tutorials/multiphase/{potentialFreeSurfaceDyMFoam/oscillatingBox => potentialFreeSurfaceFoam/movingOscillatingBox}/system/blockMeshDict (100%) rename tutorials/multiphase/{potentialFreeSurfaceDyMFoam/oscillatingBox => potentialFreeSurfaceFoam/movingOscillatingBox}/system/controlDict (97%) rename tutorials/multiphase/{potentialFreeSurfaceDyMFoam/oscillatingBox => potentialFreeSurfaceFoam/movingOscillatingBox}/system/createPatchDict (100%) rename tutorials/multiphase/{potentialFreeSurfaceDyMFoam/oscillatingBox => potentialFreeSurfaceFoam/movingOscillatingBox}/system/fvSchemes (100%) rename tutorials/multiphase/{potentialFreeSurfaceDyMFoam/oscillatingBox => potentialFreeSurfaceFoam/movingOscillatingBox}/system/fvSolution (100%) rename tutorials/multiphase/{potentialFreeSurfaceDyMFoam/oscillatingBox => potentialFreeSurfaceFoam/movingOscillatingBox}/system/topoSetDict (100%) rename tutorials/multiphase/{potentialFreeSurfaceDyMFoam/oscillatingBox => potentialFreeSurfaceFoam/movingOscillatingBox}/system/topoSetDict-selectBottom (100%) diff --git a/applications/solvers/multiphase/potentialFreeSurfaceFoam/Make/options b/applications/solvers/multiphase/potentialFreeSurfaceFoam/Make/options index 2026e36fb6..a4d71be758 100644 --- a/applications/solvers/multiphase/potentialFreeSurfaceFoam/Make/options +++ b/applications/solvers/multiphase/potentialFreeSurfaceFoam/Make/options @@ -4,15 +4,17 @@ EXE_INC = \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \ -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/sampling/lnInclude - EXE_LIBS = \ -lincompressibleTransportModels \ -lturbulenceModels \ -lincompressibleTurbulenceModels \ -lfiniteVolume \ + -ldynamicFvMesh \ + -ltopoChangerFvMesh \ -lmeshTools \ -lfvOptions \ -lsampling diff --git a/applications/solvers/multiphase/potentialFreeSurfaceFoam/potentialFreeSurfaceDyMFoam/correctPhi.H b/applications/solvers/multiphase/potentialFreeSurfaceFoam/correctPhi.H similarity index 100% rename from applications/solvers/multiphase/potentialFreeSurfaceFoam/potentialFreeSurfaceDyMFoam/correctPhi.H rename to applications/solvers/multiphase/potentialFreeSurfaceFoam/correctPhi.H diff --git a/applications/solvers/multiphase/potentialFreeSurfaceFoam/pEqn.H b/applications/solvers/multiphase/potentialFreeSurfaceFoam/pEqn.H index 0e259d8809..773efc099a 100644 --- a/applications/solvers/multiphase/potentialFreeSurfaceFoam/pEqn.H +++ b/applications/solvers/multiphase/potentialFreeSurfaceFoam/pEqn.H @@ -1,4 +1,4 @@ -volScalarField rAU(1.0/UEqn.A()); +rAU = 1.0/UEqn.A(); surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU)); volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_gh)); @@ -11,11 +11,17 @@ surfaceScalarField phiHbyA ( "phiHbyA", fvc::flux(HbyA) - + MRF.zeroFilter(rAUf*fvc::ddtCorr(U, phi)) + + MRF.zeroFilter(rAUf*fvc::ddtCorr(U, phi, Uf)) ); MRF.makeRelative(phiHbyA); -adjustPhi(phiHbyA, U, p_gh); + +if (p_gh.needReference()) +{ + fvc::makeRelative(phiHbyA, U); + adjustPhi(phiHbyA, U, p_gh); + fvc::makeAbsolute(phiHbyA, U); +} // Update the pressure BCs to ensure flux consistency constrainPressure(p_gh, U, phiHbyA, rAUf); @@ -35,16 +41,22 @@ while (pimple.correctNonOrthogonal()) if (pimple.finalNonOrthogonalIter()) { phi = phiHbyA - p_ghEqn.flux(); + + // Explicitly relax pressure for momentum corrector + p_gh.relax(); + + U = HbyA - rAU*fvc::grad(p_gh); + U.correctBoundaryConditions(); + fvOptions.correct(U); } } #include "continuityErrs.H" -// Explicitly relax pressure for momentum corrector -p_gh.relax(); +// Correct Uf if the mesh is moving +fvc::correctUf(Uf, U, phi); + +// Make the fluxes relative to the mesh motion +fvc::makeRelative(phi, U); p = p_gh + (g & mesh.C()); - -U = HbyA - rAU*fvc::grad(p_gh); -U.correctBoundaryConditions(); -fvOptions.correct(U); diff --git a/applications/solvers/multiphase/potentialFreeSurfaceFoam/potentialFreeSurfaceDyMFoam/Make/files b/applications/solvers/multiphase/potentialFreeSurfaceFoam/potentialFreeSurfaceDyMFoam/Make/files deleted file mode 100644 index b572d7b364..0000000000 --- a/applications/solvers/multiphase/potentialFreeSurfaceFoam/potentialFreeSurfaceDyMFoam/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -potentialFreeSurfaceDyMFoam.C - -EXE = $(FOAM_APPBIN)/potentialFreeSurfaceDyMFoam diff --git a/applications/solvers/multiphase/potentialFreeSurfaceFoam/potentialFreeSurfaceDyMFoam/Make/options b/applications/solvers/multiphase/potentialFreeSurfaceFoam/potentialFreeSurfaceDyMFoam/Make/options deleted file mode 100644 index eca0dd4fcc..0000000000 --- a/applications/solvers/multiphase/potentialFreeSurfaceFoam/potentialFreeSurfaceDyMFoam/Make/options +++ /dev/null @@ -1,25 +0,0 @@ -EXE_INC = \ - -I.. \ - -I../../interFoam \ - -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ - -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \ - -I$(LIB_SRC)/transportModels \ - -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/dynamicMesh/lnInclude \ - -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/sampling/lnInclude - - -EXE_LIBS = \ - -lincompressibleTransportModels \ - -lturbulenceModels \ - -lincompressibleTurbulenceModels \ - -lfiniteVolume \ - -ldynamicMesh \ - -ldynamicFvMesh \ - -ltopoChangerFvMesh \ - -lmeshTools \ - -lfvOptions \ - -lsampling diff --git a/applications/solvers/multiphase/potentialFreeSurfaceFoam/potentialFreeSurfaceDyMFoam/pEqn.H b/applications/solvers/multiphase/potentialFreeSurfaceFoam/potentialFreeSurfaceDyMFoam/pEqn.H deleted file mode 100644 index 9f7da03a11..0000000000 --- a/applications/solvers/multiphase/potentialFreeSurfaceFoam/potentialFreeSurfaceDyMFoam/pEqn.H +++ /dev/null @@ -1,67 +0,0 @@ -{ - rAU = 1.0/UEqn.A(); - surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU)); - volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_gh)); - - if (pimple.nCorrPISO() <= 1) - { - tUEqn.clear(); - } - - surfaceScalarField phiHbyA - ( - "phiHbyA", - fvc::flux(HbyA) - + MRF.zeroFilter(rAUf*fvc::ddtCorr(U, Uf)) - ); - - MRF.makeRelative(phiHbyA); - - if (p_gh.needReference()) - { - fvc::makeRelative(phiHbyA, U); - adjustPhi(phiHbyA, U, p_gh); - fvc::makeAbsolute(phiHbyA, U); - } - - // Update the pressure BCs to ensure flux consistency - constrainPressure(p_gh, U, phiHbyA, rAUf); - - // Non-orthogonal pressure corrector loop - while (pimple.correctNonOrthogonal()) - { - fvScalarMatrix p_ghEqn - ( - fvm::laplacian(rAUf, p_gh) == fvc::div(phiHbyA) - ); - - p_ghEqn.setReference(p_ghRefCell, p_ghRefValue); - - p_ghEqn.solve(mesh.solver(p_gh.select(pimple.finalInnerIter()))); - - if (pimple.finalNonOrthogonalIter()) - { - phi = phiHbyA - p_ghEqn.flux(); - - // Explicitly relax pressure for momentum corrector - p_gh.relax(); - - U = HbyA - rAU*fvc::grad(p_gh); - U.correctBoundaryConditions(); - fvOptions.correct(U); - } - } - - #include "continuityErrs.H" - - { - Uf = fvc::interpolate(U); - surfaceVectorField n(mesh.Sf()/mesh.magSf()); - Uf += n*(phi/mesh.magSf() - (n & Uf)); - } - - // Make the fluxes relative to the mesh motion - fvc::makeRelative(phi, U); - - p = p_gh + (g & mesh.C()); -} diff --git a/applications/solvers/multiphase/potentialFreeSurfaceFoam/potentialFreeSurfaceDyMFoam/potentialFreeSurfaceDyMFoam.C b/applications/solvers/multiphase/potentialFreeSurfaceFoam/potentialFreeSurfaceDyMFoam/potentialFreeSurfaceDyMFoam.C deleted file mode 100644 index c6c3184e55..0000000000 --- a/applications/solvers/multiphase/potentialFreeSurfaceFoam/potentialFreeSurfaceDyMFoam/potentialFreeSurfaceDyMFoam.C +++ /dev/null @@ -1,159 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2014-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 . - -Application - potentialFreeSurfaceDyMFoam - -Description - Incompressible Navier-Stokes solver with inclusion of a wave height field - to enable single-phase free-surface approximations, with optional mesh - motion and mesh topology changes. - - Wave height field, zeta, used by pressure boundary conditions. - - Optional mesh motion and mesh topology changes including adaptive - re-meshing. - - Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected. - -\*---------------------------------------------------------------------------*/ - -#include "fvCFD.H" -#include "dynamicFvMesh.H" -#include "singlePhaseTransportModel.H" -#include "turbulentTransportModel.H" -#include "pimpleControl.H" -#include "fvOptions.H" -#include "CorrectPhi.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -int main(int argc, char *argv[]) -{ - #include "postProcess.H" - - #include "setRootCaseLists.H" - #include "createTime.H" - #include "createDynamicFvMesh.H" - #include "initContinuityErrs.H" - #include "createDyMControls.H" - #include "createFields.H" - - volScalarField rAU - ( - IOobject - ( - "rAU", - runTime.timeName(), - mesh, - IOobject::READ_IF_PRESENT, - IOobject::AUTO_WRITE - ), - mesh, - dimensionedScalar("rAUf", dimTime, 1.0) - ); - - #include "correctPhi.H" - #include "createUf.H" - - turbulence->validate(); - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - - Info<< "\nStarting time loop\n" << endl; - - while (runTime.run()) - { - #include "readDyMControls.H" - #include "CourantNo.H" - #include "setDeltaT.H" - - runTime++; - - Info<< "Time = " << runTime.timeName() << nl << endl; - - // --- Pressure-velocity PIMPLE corrector loop - while (pimple.loop()) - { - if (pimple.firstIter() || moveMeshOuterCorrectors) - { - scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime(); - - mesh.update(); - - if (mesh.changing()) - { - Info<< "Execution time for mesh.update() = " - << runTime.elapsedCpuTime() - timeBeforeMeshUpdate - << " s" << endl; - - MRF.update(); - - if (correctPhi) - { - // Calculate absolute flux - // from the mapped surface velocity - phi = mesh.Sf() & Uf; - - #include "correctPhi.H" - - // Make the flux relative to the mesh motion - fvc::makeRelative(phi, U); - } - - if (checkMeshCourantNo) - { - #include "meshCourantNo.H" - } - } - } - - #include "UEqn.H" - - // --- Pressure corrector loop - while (pimple.correct()) - { - #include "pEqn.H" - } - - if (pimple.turbCorr()) - { - laminarTransport.correct(); - 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/multiphase/potentialFreeSurfaceFoam/potentialFreeSurfaceFoam.C b/applications/solvers/multiphase/potentialFreeSurfaceFoam/potentialFreeSurfaceFoam.C index 559f7608a5..7338435c34 100644 --- a/applications/solvers/multiphase/potentialFreeSurfaceFoam/potentialFreeSurfaceFoam.C +++ b/applications/solvers/multiphase/potentialFreeSurfaceFoam/potentialFreeSurfaceFoam.C @@ -26,19 +26,25 @@ Application Description Incompressible Navier-Stokes solver with inclusion of a wave height field - to enable single-phase free-surface approximations + to enable single-phase free-surface approximations, with optional mesh + motion and mesh topology changes. - Wave height field, zeta, used by pressure boundary conditions + Wave height field, zeta, used by pressure boundary conditions. + + Optional mesh motion and mesh topology changes including adaptive + re-meshing. Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected. \*---------------------------------------------------------------------------*/ #include "fvCFD.H" +#include "dynamicFvMesh.H" #include "singlePhaseTransportModel.H" #include "turbulentTransportModel.H" #include "pimpleControl.H" #include "fvOptions.H" +#include "CorrectPhi.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -48,11 +54,31 @@ int main(int argc, char *argv[]) #include "setRootCaseLists.H" #include "createTime.H" - #include "createMesh.H" - #include "createControl.H" - #include "createTimeControls.H" - #include "createFields.H" + #include "createDynamicFvMesh.H" #include "initContinuityErrs.H" + #include "createDyMControls.H" + #include "createFields.H" + + volScalarField rAU + ( + IOobject + ( + "rAU", + runTime.timeName(), + mesh, + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + mesh, + dimensionedScalar("rAUf", dimTime, 1.0) + ); + + if (correctPhi) + { + #include "correctPhi.H" + } + + #include "createUfIfPresent.H" turbulence->validate(); @@ -62,7 +88,7 @@ int main(int argc, char *argv[]) while (runTime.run()) { - #include "readTimeControls.H" + #include "readDyMControls.H" #include "CourantNo.H" #include "setDeltaT.H" @@ -73,6 +99,39 @@ int main(int argc, char *argv[]) // --- Pressure-velocity PIMPLE corrector loop while (pimple.loop()) { + if (pimple.firstIter() || moveMeshOuterCorrectors) + { + scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime(); + + mesh.update(); + + if (mesh.changing()) + { + Info<< "Execution time for mesh.update() = " + << runTime.elapsedCpuTime() - timeBeforeMeshUpdate + << " s" << endl; + + MRF.update(); + + if (correctPhi) + { + // Calculate absolute flux + // from the mapped surface velocity + phi = mesh.Sf() & Uf(); + + #include "correctPhi.H" + + // Make the flux relative to the mesh motion + fvc::makeRelative(phi, U); + } + + if (checkMeshCourantNo) + { + #include "meshCourantNo.H" + } + } + } + #include "UEqn.H" // --- Pressure corrector loop diff --git a/bin/potentialFreeSurfaceDyMFoam b/bin/potentialFreeSurfaceDyMFoam new file mode 100755 index 0000000000..be2ca1ee8c --- /dev/null +++ b/bin/potentialFreeSurfaceDyMFoam @@ -0,0 +1,38 @@ +#!/bin/sh +#------------------------------------------------------------------------------ +# ========= | +# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox +# \\ / O peration | +# \\ / A nd | Copyright (C) 2017-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. +# +#------------------------------------------------------------------------------ +DyMsolver=${0##*/} +solver=$(echo $DyMsolver | sed 's/DyM//') + +echo "The dynamic mesh functionality in $DyMsolver has been merged into $solver" +echo "and the $DyMsolver tutorials moved into the $solver tutorials directory" + +#------------------------------------------------------------------------------ diff --git a/tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/0.orig/U b/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/0.orig/U similarity index 100% rename from tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/0.orig/U rename to tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/0.orig/U diff --git a/tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/0.orig/p b/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/0.orig/p similarity index 100% rename from tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/0.orig/p rename to tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/0.orig/p diff --git a/tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/0.orig/p_gh b/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/0.orig/p_gh similarity index 100% rename from tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/0.orig/p_gh rename to tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/0.orig/p_gh diff --git a/tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/0.orig/pointDisplacement b/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/0.orig/pointDisplacement similarity index 100% rename from tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/0.orig/pointDisplacement rename to tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/0.orig/pointDisplacement diff --git a/tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/Allclean b/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/Allclean similarity index 100% rename from tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/Allclean rename to tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/Allclean diff --git a/tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/Allrun b/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/Allrun similarity index 100% rename from tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/Allrun rename to tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/Allrun diff --git a/tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/constant/dynamicMeshDict b/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/constant/dynamicMeshDict similarity index 100% rename from tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/constant/dynamicMeshDict rename to tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/constant/dynamicMeshDict diff --git a/tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/constant/g b/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/constant/g similarity index 100% rename from tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/constant/g rename to tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/constant/g diff --git a/tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/constant/transportProperties b/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/constant/transportProperties similarity index 100% rename from tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/constant/transportProperties rename to tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/constant/transportProperties diff --git a/tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/constant/turbulenceProperties b/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/constant/turbulenceProperties similarity index 100% rename from tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/constant/turbulenceProperties rename to tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/constant/turbulenceProperties diff --git a/tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/extractHeightData b/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/extractHeightData similarity index 100% rename from tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/extractHeightData rename to tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/extractHeightData diff --git a/tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/system/blockMeshDict b/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/system/blockMeshDict similarity index 100% rename from tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/system/blockMeshDict rename to tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/system/blockMeshDict diff --git a/tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/system/controlDict b/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/system/controlDict similarity index 97% rename from tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/system/controlDict rename to tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/system/controlDict index 15434ce121..688958a9f6 100644 --- a/tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/system/controlDict +++ b/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/system/controlDict @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -application potentialFreeSurfaceDyMFoam; +application potentialFreeSurfaceFoam; startFrom startTime; diff --git a/tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/system/createPatchDict b/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/system/createPatchDict similarity index 100% rename from tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/system/createPatchDict rename to tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/system/createPatchDict diff --git a/tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/system/fvSchemes b/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/system/fvSchemes similarity index 100% rename from tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/system/fvSchemes rename to tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/system/fvSchemes diff --git a/tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/system/fvSolution b/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/system/fvSolution similarity index 100% rename from tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/system/fvSolution rename to tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/system/fvSolution diff --git a/tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/system/topoSetDict b/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/system/topoSetDict similarity index 100% rename from tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/system/topoSetDict rename to tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/system/topoSetDict diff --git a/tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/system/topoSetDict-selectBottom b/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/system/topoSetDict-selectBottom similarity index 100% rename from tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/system/topoSetDict-selectBottom rename to tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/system/topoSetDict-selectBottom From ec875851275301e1634a5140a87e7ff1e5827e9a Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Tue, 3 Jul 2018 10:44:07 +0100 Subject: [PATCH 06/15] icoUncoupledKinematicParcelFoam: Merged with icoUncoupledKinematicParcelDyMFoam icoUncoupledKinematicParcelFoam can now run with static or dynamic meshes selected in the constant/dynamicMeshDict dictionary. --- .../Make/options | 21 ++-- .../Make/files | 3 - .../Make/options | 40 -------- .../icoUncoupledKinematicParcelDyMFoam.C | 95 ------------------- .../icoUncoupledKinematicParcelFoam.C | 16 +++- bin/icoUncoupledKinematicParcelDyMFoam | 1 + bin/potentialFreeSurfaceDyMFoam | 39 +------- .../mixerVesselAMI2D/0/U | 0 .../mixerVesselAMI2D/Allrun | 0 .../mixerVesselAMI2D/constant/dynamicMeshDict | 0 .../mixerVesselAMI2D/constant/g | 0 .../constant/kinematicCloudPositions | 0 .../constant/kinematicCloudProperties | 0 .../constant/transportProperties | 0 .../constant/turbulenceProperties | 0 .../mixerVesselAMI2D/system/blockMeshDict.m4 | 0 .../mixerVesselAMI2D/system/controlDict | 2 +- .../mixerVesselAMI2D/system/fvSchemes | 0 .../mixerVesselAMI2D/system/fvSolution | 0 19 files changed, 23 insertions(+), 194 deletions(-) delete mode 100644 applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/icoUncoupledKinematicParcelDyMFoam/Make/files delete mode 100644 applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/icoUncoupledKinematicParcelDyMFoam/Make/options delete mode 100644 applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/icoUncoupledKinematicParcelDyMFoam/icoUncoupledKinematicParcelDyMFoam.C create mode 120000 bin/icoUncoupledKinematicParcelDyMFoam mode change 100755 => 120000 bin/potentialFreeSurfaceDyMFoam rename tutorials/lagrangian/{icoUncoupledKinematicParcelDyMFoam => icoUncoupledKinematicParcelFoam}/mixerVesselAMI2D/0/U (100%) rename tutorials/lagrangian/{icoUncoupledKinematicParcelDyMFoam => icoUncoupledKinematicParcelFoam}/mixerVesselAMI2D/Allrun (100%) rename tutorials/lagrangian/{icoUncoupledKinematicParcelDyMFoam => icoUncoupledKinematicParcelFoam}/mixerVesselAMI2D/constant/dynamicMeshDict (100%) rename tutorials/lagrangian/{icoUncoupledKinematicParcelDyMFoam => icoUncoupledKinematicParcelFoam}/mixerVesselAMI2D/constant/g (100%) rename tutorials/lagrangian/{icoUncoupledKinematicParcelDyMFoam => icoUncoupledKinematicParcelFoam}/mixerVesselAMI2D/constant/kinematicCloudPositions (100%) rename tutorials/lagrangian/{icoUncoupledKinematicParcelDyMFoam => icoUncoupledKinematicParcelFoam}/mixerVesselAMI2D/constant/kinematicCloudProperties (100%) rename tutorials/lagrangian/{icoUncoupledKinematicParcelDyMFoam => icoUncoupledKinematicParcelFoam}/mixerVesselAMI2D/constant/transportProperties (100%) rename tutorials/lagrangian/{icoUncoupledKinematicParcelDyMFoam => icoUncoupledKinematicParcelFoam}/mixerVesselAMI2D/constant/turbulenceProperties (100%) rename tutorials/lagrangian/{icoUncoupledKinematicParcelDyMFoam => icoUncoupledKinematicParcelFoam}/mixerVesselAMI2D/system/blockMeshDict.m4 (100%) rename tutorials/lagrangian/{icoUncoupledKinematicParcelDyMFoam => icoUncoupledKinematicParcelFoam}/mixerVesselAMI2D/system/controlDict (95%) rename tutorials/lagrangian/{icoUncoupledKinematicParcelDyMFoam => icoUncoupledKinematicParcelFoam}/mixerVesselAMI2D/system/fvSchemes (100%) rename tutorials/lagrangian/{icoUncoupledKinematicParcelDyMFoam => icoUncoupledKinematicParcelFoam}/mixerVesselAMI2D/system/fvSolution (100%) diff --git a/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/Make/options b/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/Make/options index aebc4519bb..83385b8ab4 100644 --- a/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/Make/options +++ b/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/Make/options @@ -1,33 +1,26 @@ EXE_INC = \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \ -I$(LIB_SRC)/lagrangian/intermediate/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ - -I$(LIB_SRC)/transportModels/compressible/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \ -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/regionModels/regionModel/lnInclude \ - -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude + -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \ + -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude EXE_LIBS = \ -llagrangian \ -llagrangianIntermediate \ -llagrangianTurbulence \ - -lcompressibleTransportModels \ - -lfluidThermophysicalModels \ - -lspecie \ - -lradiationModels \ -lturbulenceModels \ -lincompressibleTurbulenceModels \ -lincompressibleTransportModels \ -lfiniteVolume \ - -lfvOptions \ - -lmeshTools \ -lregionModels \ - -lsurfaceFilmModels + -lsurfaceFilmModels \ + -ldynamicFvMesh \ + -ltopoChangerFvMesh \ + -lmeshTools diff --git a/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/icoUncoupledKinematicParcelDyMFoam/Make/files b/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/icoUncoupledKinematicParcelDyMFoam/Make/files deleted file mode 100644 index 2cce02e105..0000000000 --- a/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/icoUncoupledKinematicParcelDyMFoam/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -icoUncoupledKinematicParcelDyMFoam.C - -EXE = $(FOAM_APPBIN)/icoUncoupledKinematicParcelDyMFoam diff --git a/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/icoUncoupledKinematicParcelDyMFoam/Make/options b/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/icoUncoupledKinematicParcelDyMFoam/Make/options deleted file mode 100644 index 76fa725a3a..0000000000 --- a/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/icoUncoupledKinematicParcelDyMFoam/Make/options +++ /dev/null @@ -1,40 +0,0 @@ -EXE_INC = \ - -I.. \ - -I$(LIB_SRC)/lagrangian/basic/lnInclude \ - -I$(LIB_SRC)/lagrangian/intermediate/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ - -I$(LIB_SRC)/transportModels/compressible/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ - -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ - -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \ - -I$(LIB_SRC)/transportModels \ - -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/regionModels/regionModel/lnInclude \ - -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \ - -I$(LIB_SRC)/dynamicMesh/lnInclude \ - -I$(LIB_SRC)/dynamicFvMesh/lnInclude - - -EXE_LIBS = \ - -llagrangian \ - -llagrangianIntermediate \ - -llagrangianTurbulence \ - -lcompressibleTransportModels \ - -lfluidThermophysicalModels \ - -lspecie \ - -lradiationModels \ - -lturbulenceModels \ - -lincompressibleTurbulenceModels \ - -lincompressibleTransportModels \ - -lfiniteVolume \ - -lfvOptions \ - -lmeshTools \ - -lregionModels \ - -lsurfaceFilmModels \ - -ldynamicMesh \ - -ldynamicFvMesh \ - -ltopoChangerFvMesh diff --git a/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/icoUncoupledKinematicParcelDyMFoam/icoUncoupledKinematicParcelDyMFoam.C b/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/icoUncoupledKinematicParcelDyMFoam/icoUncoupledKinematicParcelDyMFoam.C deleted file mode 100644 index 3b22621a16..0000000000 --- a/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/icoUncoupledKinematicParcelDyMFoam/icoUncoupledKinematicParcelDyMFoam.C +++ /dev/null @@ -1,95 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011-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 . - -Application - uncoupledKinematicParcelDyMFoam - -Description - Transient solver for the passive transport of a single kinematic - particle cloud, with optional mesh motion and mesh topology changes. - - Uses a pre-calculated velocity field to evolve the cloud. - -\*---------------------------------------------------------------------------*/ - -#include "fvCFD.H" -#include "dynamicFvMesh.H" -#include "singlePhaseTransportModel.H" -#include "turbulentTransportModel.H" -#include "basicKinematicCollidingCloud.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -int main(int argc, char *argv[]) -{ - argList::addOption - ( - "cloudName", - "name", - "specify alternative cloud name. default is 'kinematicCloud'" - ); - - #include "postProcess.H" - - #include "setRootCaseLists.H" - #include "createTime.H" - #include "createDynamicFvMesh.H" - #include "createControl.H" - #include "createFields.H" - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - - Info<< "\nStarting time loop\n" << endl; - - while (runTime.loop()) - { - Info<< "Time = " << runTime.timeName() << nl << endl; - - kinematicCloud.storeGlobalPositions(); - - mesh.update(); - - U.correctBoundaryConditions(); - - Info<< "Evolving " << kinematicCloud.name() << endl; - - laminarTransport.correct(); - - mu = laminarTransport.nu()*rhoInfValue; - - kinematicCloud.evolve(); - - runTime.write(); - - Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" - << " ClockTime = " << runTime.elapsedClockTime() << " s" - << nl << endl; - } - - Info<< "End\n" << endl; - - return 0; -} - - -// ************************************************************************* // diff --git a/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/icoUncoupledKinematicParcelFoam.C b/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/icoUncoupledKinematicParcelFoam.C index 7b91a57e19..9143204a1f 100644 --- a/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/icoUncoupledKinematicParcelFoam.C +++ b/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/icoUncoupledKinematicParcelFoam.C @@ -22,17 +22,18 @@ License along with OpenFOAM. If not, see . Application - icoUncoupledKinematicParcelFoam + uncoupledKinematicParcelFoam Description Transient solver for the passive transport of a single kinematic - particle cloud. + particle cloud, with optional mesh motion and mesh topology changes. Uses a pre-calculated velocity field to evolve the cloud. \*---------------------------------------------------------------------------*/ #include "fvCFD.H" +#include "dynamicFvMesh.H" #include "singlePhaseTransportModel.H" #include "turbulentTransportModel.H" #include "basicKinematicCollidingCloud.H" @@ -52,7 +53,7 @@ int main(int argc, char *argv[]) #include "setRootCaseLists.H" #include "createTime.H" - #include "createMesh.H" + #include "createDynamicFvMesh.H" #include "createControl.H" #include "createFields.H" @@ -64,6 +65,15 @@ int main(int argc, char *argv[]) { Info<< "Time = " << runTime.timeName() << nl << endl; + kinematicCloud.storeGlobalPositions(); + + mesh.update(); + + if (mesh.changing()) + { + U.correctBoundaryConditions(); + } + Info<< "Evolving " << kinematicCloud.name() << endl; laminarTransport.correct(); diff --git a/bin/icoUncoupledKinematicParcelDyMFoam b/bin/icoUncoupledKinematicParcelDyMFoam new file mode 120000 index 0000000000..d9fcbed5a0 --- /dev/null +++ b/bin/icoUncoupledKinematicParcelDyMFoam @@ -0,0 +1 @@ +mergedDyM \ No newline at end of file diff --git a/bin/potentialFreeSurfaceDyMFoam b/bin/potentialFreeSurfaceDyMFoam deleted file mode 100755 index be2ca1ee8c..0000000000 --- a/bin/potentialFreeSurfaceDyMFoam +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh -#------------------------------------------------------------------------------ -# ========= | -# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox -# \\ / O peration | -# \\ / A nd | Copyright (C) 2017-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. -# -#------------------------------------------------------------------------------ -DyMsolver=${0##*/} -solver=$(echo $DyMsolver | sed 's/DyM//') - -echo "The dynamic mesh functionality in $DyMsolver has been merged into $solver" -echo "and the $DyMsolver tutorials moved into the $solver tutorials directory" - -#------------------------------------------------------------------------------ diff --git a/bin/potentialFreeSurfaceDyMFoam b/bin/potentialFreeSurfaceDyMFoam new file mode 120000 index 0000000000..d9fcbed5a0 --- /dev/null +++ b/bin/potentialFreeSurfaceDyMFoam @@ -0,0 +1 @@ +mergedDyM \ No newline at end of file diff --git a/tutorials/lagrangian/icoUncoupledKinematicParcelDyMFoam/mixerVesselAMI2D/0/U b/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/mixerVesselAMI2D/0/U similarity index 100% rename from tutorials/lagrangian/icoUncoupledKinematicParcelDyMFoam/mixerVesselAMI2D/0/U rename to tutorials/lagrangian/icoUncoupledKinematicParcelFoam/mixerVesselAMI2D/0/U diff --git a/tutorials/lagrangian/icoUncoupledKinematicParcelDyMFoam/mixerVesselAMI2D/Allrun b/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/mixerVesselAMI2D/Allrun similarity index 100% rename from tutorials/lagrangian/icoUncoupledKinematicParcelDyMFoam/mixerVesselAMI2D/Allrun rename to tutorials/lagrangian/icoUncoupledKinematicParcelFoam/mixerVesselAMI2D/Allrun diff --git a/tutorials/lagrangian/icoUncoupledKinematicParcelDyMFoam/mixerVesselAMI2D/constant/dynamicMeshDict b/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/mixerVesselAMI2D/constant/dynamicMeshDict similarity index 100% rename from tutorials/lagrangian/icoUncoupledKinematicParcelDyMFoam/mixerVesselAMI2D/constant/dynamicMeshDict rename to tutorials/lagrangian/icoUncoupledKinematicParcelFoam/mixerVesselAMI2D/constant/dynamicMeshDict diff --git a/tutorials/lagrangian/icoUncoupledKinematicParcelDyMFoam/mixerVesselAMI2D/constant/g b/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/mixerVesselAMI2D/constant/g similarity index 100% rename from tutorials/lagrangian/icoUncoupledKinematicParcelDyMFoam/mixerVesselAMI2D/constant/g rename to tutorials/lagrangian/icoUncoupledKinematicParcelFoam/mixerVesselAMI2D/constant/g diff --git a/tutorials/lagrangian/icoUncoupledKinematicParcelDyMFoam/mixerVesselAMI2D/constant/kinematicCloudPositions b/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/mixerVesselAMI2D/constant/kinematicCloudPositions similarity index 100% rename from tutorials/lagrangian/icoUncoupledKinematicParcelDyMFoam/mixerVesselAMI2D/constant/kinematicCloudPositions rename to tutorials/lagrangian/icoUncoupledKinematicParcelFoam/mixerVesselAMI2D/constant/kinematicCloudPositions diff --git a/tutorials/lagrangian/icoUncoupledKinematicParcelDyMFoam/mixerVesselAMI2D/constant/kinematicCloudProperties b/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/mixerVesselAMI2D/constant/kinematicCloudProperties similarity index 100% rename from tutorials/lagrangian/icoUncoupledKinematicParcelDyMFoam/mixerVesselAMI2D/constant/kinematicCloudProperties rename to tutorials/lagrangian/icoUncoupledKinematicParcelFoam/mixerVesselAMI2D/constant/kinematicCloudProperties diff --git a/tutorials/lagrangian/icoUncoupledKinematicParcelDyMFoam/mixerVesselAMI2D/constant/transportProperties b/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/mixerVesselAMI2D/constant/transportProperties similarity index 100% rename from tutorials/lagrangian/icoUncoupledKinematicParcelDyMFoam/mixerVesselAMI2D/constant/transportProperties rename to tutorials/lagrangian/icoUncoupledKinematicParcelFoam/mixerVesselAMI2D/constant/transportProperties diff --git a/tutorials/lagrangian/icoUncoupledKinematicParcelDyMFoam/mixerVesselAMI2D/constant/turbulenceProperties b/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/mixerVesselAMI2D/constant/turbulenceProperties similarity index 100% rename from tutorials/lagrangian/icoUncoupledKinematicParcelDyMFoam/mixerVesselAMI2D/constant/turbulenceProperties rename to tutorials/lagrangian/icoUncoupledKinematicParcelFoam/mixerVesselAMI2D/constant/turbulenceProperties diff --git a/tutorials/lagrangian/icoUncoupledKinematicParcelDyMFoam/mixerVesselAMI2D/system/blockMeshDict.m4 b/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/mixerVesselAMI2D/system/blockMeshDict.m4 similarity index 100% rename from tutorials/lagrangian/icoUncoupledKinematicParcelDyMFoam/mixerVesselAMI2D/system/blockMeshDict.m4 rename to tutorials/lagrangian/icoUncoupledKinematicParcelFoam/mixerVesselAMI2D/system/blockMeshDict.m4 diff --git a/tutorials/lagrangian/icoUncoupledKinematicParcelDyMFoam/mixerVesselAMI2D/system/controlDict b/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/mixerVesselAMI2D/system/controlDict similarity index 95% rename from tutorials/lagrangian/icoUncoupledKinematicParcelDyMFoam/mixerVesselAMI2D/system/controlDict rename to tutorials/lagrangian/icoUncoupledKinematicParcelFoam/mixerVesselAMI2D/system/controlDict index b615f9fd3d..2cbf720a08 100644 --- a/tutorials/lagrangian/icoUncoupledKinematicParcelDyMFoam/mixerVesselAMI2D/system/controlDict +++ b/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/mixerVesselAMI2D/system/controlDict @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -application icoUncoupledKinematicParcelDyMFoam; +application icoUncoupledKinematicParcelFoam; startFrom startTime; diff --git a/tutorials/lagrangian/icoUncoupledKinematicParcelDyMFoam/mixerVesselAMI2D/system/fvSchemes b/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/mixerVesselAMI2D/system/fvSchemes similarity index 100% rename from tutorials/lagrangian/icoUncoupledKinematicParcelDyMFoam/mixerVesselAMI2D/system/fvSchemes rename to tutorials/lagrangian/icoUncoupledKinematicParcelFoam/mixerVesselAMI2D/system/fvSchemes diff --git a/tutorials/lagrangian/icoUncoupledKinematicParcelDyMFoam/mixerVesselAMI2D/system/fvSolution b/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/mixerVesselAMI2D/system/fvSolution similarity index 100% rename from tutorials/lagrangian/icoUncoupledKinematicParcelDyMFoam/mixerVesselAMI2D/system/fvSolution rename to tutorials/lagrangian/icoUncoupledKinematicParcelFoam/mixerVesselAMI2D/system/fvSolution From 42cafa62b8c4481ba38d700032a4a86fb4a88d6a Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Wed, 4 Jul 2018 09:43:52 +0100 Subject: [PATCH 07/15] interPhaseChangeFoam: Merged with interPhaseChangeDyMFoam interPhaseChangeFoam can now run with static or dynamic meshes selected in the constant/dynamicMeshDict dictionary. --- .../compressibleInterFoam.C | 13 +- .../solvers/multiphase/interFoam/Make/options | 4 +- .../multiphase/interPhaseChangeFoam/Allwclean | 1 - .../multiphase/interPhaseChangeFoam/Allwmake | 1 - .../interPhaseChangeFoam/Make/options | 16 +- .../multiphase/interPhaseChangeFoam/UEqn.H | 11 +- .../interPhaseChangeFoam/alphaEqn.H | 5 +- .../interPhaseChangeFoam/alphaEqnSubCycle.H | 6 +- .../correctPhi.H | 2 +- .../interPhaseChangeFoam/createFields.H | 21 +- .../interPhaseChangeFoam/initCorrectPhi.H | 36 ++++ .../interPhaseChangeDyMFoam/Make/files | 3 - .../interPhaseChangeDyMFoam/Make/options | 30 --- .../interPhaseChangeDyMFoam.C | 190 ------------------ .../interPhaseChangeDyMFoam/pEqn.H | 80 -------- .../interPhaseChangeFoam.C | 65 +++++- .../multiphase/interPhaseChangeFoam/pEqn.H | 43 +++- .../phaseChangeTwoPhaseMixtures/Kunz/Kunz.C | 8 +- .../phaseChangeTwoPhaseMixtures/Make/options | 8 +- .../Merkle/Merkle.C | 6 +- .../SchnerrSauer/SchnerrSauer.C | 10 +- .../phaseChangeTwoPhaseMixture.C | 6 +- .../phaseChangeTwoPhaseMixture.H | 4 +- bin/interPhaseChangeDyMFoam | 1 + .../cavitatingBullet/system/controlDict | 4 +- .../propeller/0/U | 0 .../propeller/0/alpha.water | 0 .../propeller/0/epsilon | 0 .../propeller/0/k | 0 .../propeller/0/nut | 0 .../propeller/0/p_rgh | 0 .../propeller/Allclean | 0 .../propeller/Allmesh | 0 .../propeller/Allrun | 0 .../propeller/constant/dynamicMeshDict | 0 .../propeller/constant/g | 0 .../propeller/constant/transportProperties | 0 .../constant/triSurface/innerCylinder.obj | 0 .../triSurface/innerCylinderSmall.obj | 0 .../constant/triSurface/outerCylinder.obj | 0 .../constant/triSurface/propellerStem1.obj | 0 .../constant/triSurface/propellerStem2.obj | 0 .../constant/triSurface/propellerStem3.obj | 0 .../propeller/constant/turbulenceProperties | 0 .../propeller/system/blockMeshDict | 0 .../propeller/system/controlDict | 2 +- .../system/createInletOutletSets.topoSetDict | 0 .../propeller/system/createPatchDict | 0 .../propeller/system/decomposeParDict | 0 .../propeller/system/fvSchemes | 0 .../propeller/system/fvSolution | 0 .../propeller/system/snappyHexMeshDict | 0 .../propeller/system/surfaceFeaturesDict | 0 53 files changed, 189 insertions(+), 387 deletions(-) rename applications/solvers/multiphase/interPhaseChangeFoam/{interPhaseChangeDyMFoam => }/correctPhi.H (62%) create mode 100644 applications/solvers/multiphase/interPhaseChangeFoam/initCorrectPhi.H delete mode 100644 applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeDyMFoam/Make/files delete mode 100644 applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeDyMFoam/Make/options delete mode 100644 applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeDyMFoam/interPhaseChangeDyMFoam.C delete mode 100644 applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeDyMFoam/pEqn.H create mode 120000 bin/interPhaseChangeDyMFoam rename tutorials/multiphase/{interPhaseChangeDyMFoam => interPhaseChangeFoam}/propeller/0/U (100%) rename tutorials/multiphase/{interPhaseChangeDyMFoam => interPhaseChangeFoam}/propeller/0/alpha.water (100%) rename tutorials/multiphase/{interPhaseChangeDyMFoam => interPhaseChangeFoam}/propeller/0/epsilon (100%) rename tutorials/multiphase/{interPhaseChangeDyMFoam => interPhaseChangeFoam}/propeller/0/k (100%) rename tutorials/multiphase/{interPhaseChangeDyMFoam => interPhaseChangeFoam}/propeller/0/nut (100%) rename tutorials/multiphase/{interPhaseChangeDyMFoam => interPhaseChangeFoam}/propeller/0/p_rgh (100%) rename tutorials/multiphase/{interPhaseChangeDyMFoam => interPhaseChangeFoam}/propeller/Allclean (100%) rename tutorials/multiphase/{interPhaseChangeDyMFoam => interPhaseChangeFoam}/propeller/Allmesh (100%) rename tutorials/multiphase/{interPhaseChangeDyMFoam => interPhaseChangeFoam}/propeller/Allrun (100%) rename tutorials/multiphase/{interPhaseChangeDyMFoam => interPhaseChangeFoam}/propeller/constant/dynamicMeshDict (100%) rename tutorials/multiphase/{interPhaseChangeDyMFoam => interPhaseChangeFoam}/propeller/constant/g (100%) rename tutorials/multiphase/{interPhaseChangeDyMFoam => interPhaseChangeFoam}/propeller/constant/transportProperties (100%) rename tutorials/multiphase/{interPhaseChangeDyMFoam => interPhaseChangeFoam}/propeller/constant/triSurface/innerCylinder.obj (100%) rename tutorials/multiphase/{interPhaseChangeDyMFoam => interPhaseChangeFoam}/propeller/constant/triSurface/innerCylinderSmall.obj (100%) rename tutorials/multiphase/{interPhaseChangeDyMFoam => interPhaseChangeFoam}/propeller/constant/triSurface/outerCylinder.obj (100%) rename tutorials/multiphase/{interPhaseChangeDyMFoam => interPhaseChangeFoam}/propeller/constant/triSurface/propellerStem1.obj (100%) rename tutorials/multiphase/{interPhaseChangeDyMFoam => interPhaseChangeFoam}/propeller/constant/triSurface/propellerStem2.obj (100%) rename tutorials/multiphase/{interPhaseChangeDyMFoam => interPhaseChangeFoam}/propeller/constant/triSurface/propellerStem3.obj (100%) rename tutorials/multiphase/{interPhaseChangeDyMFoam => interPhaseChangeFoam}/propeller/constant/turbulenceProperties (100%) rename tutorials/multiphase/{interPhaseChangeDyMFoam => interPhaseChangeFoam}/propeller/system/blockMeshDict (100%) rename tutorials/multiphase/{interPhaseChangeDyMFoam => interPhaseChangeFoam}/propeller/system/controlDict (96%) rename tutorials/multiphase/{interPhaseChangeDyMFoam => interPhaseChangeFoam}/propeller/system/createInletOutletSets.topoSetDict (100%) rename tutorials/multiphase/{interPhaseChangeDyMFoam => interPhaseChangeFoam}/propeller/system/createPatchDict (100%) rename tutorials/multiphase/{interPhaseChangeDyMFoam => interPhaseChangeFoam}/propeller/system/decomposeParDict (100%) rename tutorials/multiphase/{interPhaseChangeDyMFoam => interPhaseChangeFoam}/propeller/system/fvSchemes (100%) rename tutorials/multiphase/{interPhaseChangeDyMFoam => interPhaseChangeFoam}/propeller/system/fvSolution (100%) rename tutorials/multiphase/{interPhaseChangeDyMFoam => interPhaseChangeFoam}/propeller/system/snappyHexMeshDict (100%) rename tutorials/multiphase/{interPhaseChangeDyMFoam => interPhaseChangeFoam}/propeller/system/surfaceFeaturesDict (100%) diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C index b40230935b..d4a0ef287e 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C @@ -106,22 +106,15 @@ int main(int argc, char *argv[]) { if (pimple.firstIter() || moveMeshOuterCorrectors) { - scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime(); - mesh.update(); if (mesh.changing()) { - - MRF.update(); - - Info<< "Execution time for mesh.update() = " - << runTime.elapsedCpuTime() - timeBeforeMeshUpdate - << " s" << endl; - gh = (g & mesh.C()) - ghRef; ghf = (g & mesh.Cf()) - ghRef; + MRF.update(); + if (correctPhi) { // Calculate absolute flux @@ -143,6 +136,8 @@ int main(int argc, char *argv[]) } } + divU = fvc::div(fvc::absolute(phi, U)); + #include "alphaControls.H" #include "compressibleAlphaEqnSubCycle.H" diff --git a/applications/solvers/multiphase/interFoam/Make/options b/applications/solvers/multiphase/interFoam/Make/options index 6ecfb3a658..e9366d55a8 100644 --- a/applications/solvers/multiphase/interFoam/Make/options +++ b/applications/solvers/multiphase/interFoam/Make/options @@ -18,6 +18,6 @@ EXE_LIBS = \ -lincompressibleTurbulenceModels \ -lfiniteVolume \ -ldynamicFvMesh \ + -ltopoChangerFvMesh \ -lfvOptions \ - -lmeshTools \ - -lsampling + -lmeshTools diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/Allwclean b/applications/solvers/multiphase/interPhaseChangeFoam/Allwclean index 573e235fdc..52d19bc530 100755 --- a/applications/solvers/multiphase/interPhaseChangeFoam/Allwclean +++ b/applications/solvers/multiphase/interPhaseChangeFoam/Allwclean @@ -3,6 +3,5 @@ cd ${0%/*} || exit 1 # Run from this directory wclean libso phaseChangeTwoPhaseMixtures wclean -wclean interPhaseChangeDyMFoam #------------------------------------------------------------------------------ diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/Allwmake b/applications/solvers/multiphase/interPhaseChangeFoam/Allwmake index dfcde284ea..9655af2bd3 100755 --- a/applications/solvers/multiphase/interPhaseChangeFoam/Allwmake +++ b/applications/solvers/multiphase/interPhaseChangeFoam/Allwmake @@ -6,6 +6,5 @@ cd ${0%/*} || exit 1 # Run from this directory wmake $targetType phaseChangeTwoPhaseMixtures wmake $targetType -wmake $targetType interPhaseChangeDyMFoam #------------------------------------------------------------------------------ diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/Make/options b/applications/solvers/multiphase/interPhaseChangeFoam/Make/options index a29ad660e8..509d511bbd 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/Make/options +++ b/applications/solvers/multiphase/interPhaseChangeFoam/Make/options @@ -1,14 +1,17 @@ EXE_INC = \ - -I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \ + -I. \ + -I../VoF \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ + -I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \ -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ + -I$(LIB_SRC)/transportModels/immiscibleIncompressibleTwoPhaseMixture/lnInclude \ + -IphaseChangeTwoPhaseMixtures/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \ - -IphaseChangeTwoPhaseMixtures/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/sampling/lnInclude + -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude EXE_LIBS = \ -lphaseChangeTwoPhaseMixtures \ @@ -19,6 +22,7 @@ EXE_LIBS = \ -lturbulenceModels \ -lincompressibleTurbulenceModels \ -lfiniteVolume \ - -lmeshTools \ + -ldynamicFvMesh \ + -ltopoChangerFvMesh \ -lfvOptions \ - -lsampling + -lmeshTools diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/UEqn.H b/applications/solvers/multiphase/interPhaseChangeFoam/UEqn.H index 1e27597292..622c5a8489 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/UEqn.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/UEqn.H @@ -1,13 +1,16 @@ fvVectorMatrix UEqn ( - fvm::ddt(rho, U) - + fvm::div(rhoPhi, U) + fvm::ddt(rho, U) + fvm::div(rhoPhi, U) - fvm::Sp(fvc::ddt(rho) + fvc::div(rhoPhi), U) + turbulence->divDevRhoReff(rho, U) + == + fvOptions(rho, U) ); UEqn.relax(); + fvOptions.constrain(UEqn); + if (pimple.momentumPredictor()) { solve @@ -17,10 +20,12 @@ fvc::reconstruct ( ( - interface.surfaceTensionForce() + mixture.surfaceTensionForce() - ghf*fvc::snGrad(rho) - fvc::snGrad(p_rgh) ) * mesh.magSf() ) ); + + fvOptions.correct(U); } diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H index e3bbba19d8..c94af99e52 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H @@ -2,10 +2,9 @@ word alphaScheme("div(phi,alpha)"); word alpharScheme("div(phirb,alpha)"); - surfaceScalarField phir("phir", phic*interface.nHatf()); + surfaceScalarField phir("phir", phic*mixture.nHatf()); - Pair> vDotAlphal = - mixture->vDotAlphal(); + Pair> vDotAlphal = mixture.vDotAlphal(); const volScalarField& vDotcAlphal = vDotAlphal[0](); const volScalarField& vDotvAlphal = vDotAlphal[1](); const volScalarField vDotvmcAlphal(vDotvAlphal - vDotcAlphal); diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqnSubCycle.H b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqnSubCycle.H index a04fc46947..534ed4a670 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqnSubCycle.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqnSubCycle.H @@ -1,16 +1,14 @@ { // Standard face-flux compression coefficient - surfaceScalarField phic(interface.cAlpha()*mag(phi/mesh.magSf())); + surfaceScalarField phic(mixture.cAlpha()*mag(phi/mesh.magSf())); // Add the optional isotropic compression contribution if (icAlpha > 0) { phic *= (1.0 - icAlpha); - phic += (interface.cAlpha()*icAlpha)*fvc::interpolate(mag(U)); + phic += (mixture.cAlpha()*icAlpha)*fvc::interpolate(mag(U)); } - volScalarField divU(fvc::div(phi)); - if (nAlphaSubCycles > 1) { dimensionedScalar totalDeltaT = runTime.deltaT(); diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeDyMFoam/correctPhi.H b/applications/solvers/multiphase/interPhaseChangeFoam/correctPhi.H similarity index 62% rename from applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeDyMFoam/correctPhi.H rename to applications/solvers/multiphase/interPhaseChangeFoam/correctPhi.H index 6c85d967a4..58b79bed40 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeDyMFoam/correctPhi.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/correctPhi.H @@ -3,7 +3,7 @@ CorrectPhi U, phi, p_rgh, - surfaceScalarField("rAUf", fvc::interpolate(rAU)), + surfaceScalarField("rAUf", fvc::interpolate(rAU())), divU, pimple ); diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/createFields.H b/applications/solvers/multiphase/interPhaseChangeFoam/createFields.H index 28c6b2c4eb..5838579caf 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/createFields.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/createFields.H @@ -30,14 +30,18 @@ volVectorField U Info<< "Creating phaseChangeTwoPhaseMixture\n" << endl; -autoPtr mixture = - phaseChangeTwoPhaseMixture::New(U, phi); +autoPtr mixturePtr +( + phaseChangeTwoPhaseMixture::New(U, phi) +); -volScalarField& alpha1(mixture->alpha1()); -volScalarField& alpha2(mixture->alpha2()); +phaseChangeTwoPhaseMixture& mixture = mixturePtr(); -const dimensionedScalar& rho1 = mixture->rho1(); -const dimensionedScalar& rho2 = mixture->rho2(); +volScalarField& alpha1(mixture.alpha1()); +volScalarField& alpha2(mixture.alpha2()); + +const dimensionedScalar& rho1 = mixture.rho1(); +const dimensionedScalar& rho2 = mixture.rho2(); // Need to store rho for ddt(rho, U) @@ -55,13 +59,10 @@ volScalarField rho rho.oldTime(); -// Construct interface from alpha1 distribution -interfaceProperties interface(alpha1, U, mixture()); - // Construct incompressible turbulence model autoPtr turbulence ( - incompressible::turbulenceModel::New(U, phi, mixture()) + incompressible::turbulenceModel::New(U, phi, mixture) ); diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/initCorrectPhi.H b/applications/solvers/multiphase/interPhaseChangeFoam/initCorrectPhi.H new file mode 100644 index 0000000000..59b96c87a9 --- /dev/null +++ b/applications/solvers/multiphase/interPhaseChangeFoam/initCorrectPhi.H @@ -0,0 +1,36 @@ +tmp rAU; + +if (correctPhi) +{ + rAU = new volScalarField + ( + IOobject + ( + "rAU", + runTime.timeName(), + mesh, + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + mesh, + dimensionedScalar("rAU", dimTime/dimDensity, 1) + ); + + volScalarField divU("divU0", fvc::div(fvc::absolute(phi, U))); + + #include "correctPhi.H" +} +else +{ + CorrectPhi + ( + U, + phi, + p_rgh, + dimensionedScalar("rAUf", dimTime/rho.dimensions(), 1), + geometricZeroField(), + pimple + ); + + #include "continuityErrs.H" +} diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeDyMFoam/Make/files b/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeDyMFoam/Make/files deleted file mode 100644 index 2d4521425f..0000000000 --- a/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeDyMFoam/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -interPhaseChangeDyMFoam.C - -EXE = $(FOAM_APPBIN)/interPhaseChangeDyMFoam diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeDyMFoam/Make/options b/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeDyMFoam/Make/options deleted file mode 100644 index 0a4397e063..0000000000 --- a/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeDyMFoam/Make/options +++ /dev/null @@ -1,30 +0,0 @@ -EXE_INC = \ - -I.. \ - -I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \ - -I$(LIB_SRC)/transportModels \ - -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ - -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ - -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ - -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \ - -I../phaseChangeTwoPhaseMixtures/lnInclude \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/dynamicMesh/lnInclude \ - -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/sampling/lnInclude - -EXE_LIBS = \ - -lphaseChangeTwoPhaseMixtures \ - -ltwoPhaseMixture \ - -linterfaceProperties \ - -ltwoPhaseProperties \ - -lincompressibleTransportModels \ - -lturbulenceModels \ - -lincompressibleTurbulenceModels \ - -lfiniteVolume \ - -ldynamicMesh \ - -ldynamicFvMesh \ - -ltopoChangerFvMesh \ - -lmeshTools \ - -lfvOptions \ - -lsampling diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeDyMFoam/interPhaseChangeDyMFoam.C b/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeDyMFoam/interPhaseChangeDyMFoam.C deleted file mode 100644 index 83912bee09..0000000000 --- a/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeDyMFoam/interPhaseChangeDyMFoam.C +++ /dev/null @@ -1,190 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011-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 . - -Application - interPhaseChangeDyMFoam - -Description - Solver for 2 incompressible, isothermal immiscible fluids with phase-change - (e.g. cavitation). Uses a VOF (volume of fluid) phase-fraction based - interface capturing approach, with optional mesh motion and mesh topology - changes including adaptive re-meshing. - - The momentum and other fluid properties are of the "mixture" and a - single momentum equation is solved. - - The set of phase-change models provided are designed to simulate cavitation - but other mechanisms of phase-change are supported within this solver - framework. - - Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected. - -\*---------------------------------------------------------------------------*/ - -#include "fvCFD.H" -#include "dynamicFvMesh.H" -#include "CMULES.H" -#include "subCycle.H" -#include "interfaceProperties.H" -#include "phaseChangeTwoPhaseMixture.H" -#include "turbulentTransportModel.H" -#include "pimpleControl.H" -#include "fvOptions.H" -#include "CorrectPhi.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -int main(int argc, char *argv[]) -{ - #include "postProcess.H" - - #include "setRootCaseLists.H" - #include "createTime.H" - #include "createDynamicFvMesh.H" - #include "createDyMControls.H" - #include "initContinuityErrs.H" - #include "createFields.H" - - volScalarField rAU - ( - IOobject - ( - "rAU", - runTime.timeName(), - mesh, - IOobject::READ_IF_PRESENT, - IOobject::AUTO_WRITE - ), - mesh, - dimensionedScalar("rAUf", dimTime/rho.dimensions(), 1.0) - ); - - #include "createUf.H" - #include "CourantNo.H" - #include "setInitialDeltaT.H" - - turbulence->validate(); - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - - Info<< "\nStarting time loop\n" << endl; - - while (runTime.run()) - { - #include "readDyMControls.H" - - // Store divU from the previous mesh so that it can be mapped - // and used in correctPhi to ensure the corrected phi has the - // same divergence - volScalarField divU("divU0", fvc::div(fvc::absolute(phi, U))); - - #include "CourantNo.H" - #include "setDeltaT.H" - - runTime++; - - Info<< "Time = " << runTime.timeName() << nl << endl; - - // --- Pressure-velocity PIMPLE corrector loop - while (pimple.loop()) - { - if (pimple.firstIter() || moveMeshOuterCorrectors) - { - scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime(); - - mesh.update(); - - if (mesh.changing()) - { - Info<< "Execution time for mesh.update() = " - << runTime.elapsedCpuTime() - timeBeforeMeshUpdate - << " s" << endl; - - gh = (g & mesh.C()) - ghRef; - ghf = (g & mesh.Cf()) - ghRef; - } - - if (mesh.changing() && correctPhi) - { - // Calculate absolute flux from the mapped surface velocity - phi = mesh.Sf() & Uf; - - #include "correctPhi.H" - - // Make the flux relative to the mesh motion - fvc::makeRelative(phi, U); - } - - if (mesh.changing() && checkMeshCourantNo) - { - #include "meshCourantNo.H" - } - } - - #include "alphaControls.H" - - surfaceScalarField rhoPhi - ( - IOobject - ( - "rhoPhi", - runTime.timeName(), - mesh - ), - mesh, - dimensionedScalar("0", dimMass/dimTime, 0) - ); - - mixture->correct(); - - #include "alphaEqnSubCycle.H" - interface.correct(); - - #include "UEqn.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/multiphase/interPhaseChangeFoam/interPhaseChangeDyMFoam/pEqn.H b/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeDyMFoam/pEqn.H deleted file mode 100644 index 8d992e80b0..0000000000 --- a/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeDyMFoam/pEqn.H +++ /dev/null @@ -1,80 +0,0 @@ -{ - rAU = 1.0/UEqn.A(); - surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU)); - volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh)); - surfaceScalarField phiHbyA - ( - "phiHbyA", - fvc::flux(HbyA) - + fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, Uf) - ); - - if (p_rgh.needReference()) - { - fvc::makeRelative(phiHbyA, U); - adjustPhi(phiHbyA, U, p_rgh); - fvc::makeAbsolute(phiHbyA, U); - } - - surfaceScalarField phig - ( - ( - interface.surfaceTensionForce() - - ghf*fvc::snGrad(rho) - )*rAUf*mesh.magSf() - ); - - phiHbyA += phig; - - // Update the pressure BCs to ensure flux consistency - constrainPressure(p_rgh, U, phiHbyA, rAUf); - - Pair> vDotP = mixture->vDotP(); - const volScalarField& vDotcP = vDotP[0](); - const volScalarField& vDotvP = vDotP[1](); - - while (pimple.correctNonOrthogonal()) - { - fvScalarMatrix p_rghEqn - ( - fvc::div(phiHbyA) - fvm::laplacian(rAUf, p_rgh) - - (vDotvP - vDotcP)*(mixture->pSat() - rho*gh) - + fvm::Sp(vDotvP - vDotcP, p_rgh) - ); - - p_rghEqn.setReference(pRefCell, pRefValue); - - p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter()))); - - if (pimple.finalNonOrthogonalIter()) - { - phi = phiHbyA + p_rghEqn.flux(); - - U = HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rAUf); - U.correctBoundaryConditions(); - fvOptions.correct(U); - } - } - - { - Uf = fvc::interpolate(U); - surfaceVectorField n(mesh.Sf()/mesh.magSf()); - Uf += n*(phi/mesh.magSf() - (n & Uf)); - } - - // Make the fluxes relative to the mesh motion - fvc::makeRelative(phi, U); - - p == p_rgh + rho*gh; - - if (p_rgh.needReference()) - { - p += dimensionedScalar - ( - "p", - p.dimensions(), - pRefValue - getRefCellValue(p, pRefCell) - ); - p_rgh = p - rho*gh; - } -} diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C b/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C index cfae36e927..90635e3096 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C @@ -27,7 +27,8 @@ Application Description Solver for 2 incompressible, isothermal immiscible fluids with phase-change (e.g. cavitation). Uses a VOF (volume of fluid) phase-fraction based - interface capturing approach. + interface capturing approach, with optional mesh motion and mesh topology + changes including adaptive re-meshing. The momentum and other fluid properties are of the "mixture" and a single momentum equation is solved. @@ -41,6 +42,7 @@ Description \*---------------------------------------------------------------------------*/ #include "fvCFD.H" +#include "dynamicFvMesh.H" #include "CMULES.H" #include "subCycle.H" #include "interfaceProperties.H" @@ -48,6 +50,7 @@ Description #include "turbulentTransportModel.H" #include "pimpleControl.H" #include "fvOptions.H" +#include "CorrectPhi.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -57,23 +60,33 @@ int main(int argc, char *argv[]) #include "setRootCaseLists.H" #include "createTime.H" - #include "createMesh.H" - #include "createControl.H" + #include "createDynamicFvMesh.H" + #include "createDyMControls.H" + #include "initContinuityErrs.H" #include "createFields.H" - #include "createTimeControls.H" - #include "CourantNo.H" - #include "setInitialDeltaT.H" + #include "initCorrectPhi.H" + #include "createUfIfPresent.H" turbulence->validate(); + #include "CourantNo.H" + #include "setInitialDeltaT.H" + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; while (runTime.run()) { - #include "readTimeControls.H" + #include "readDyMControls.H" + + // Store divU from the previous mesh so that it can be mapped + // and used in correctPhi to ensure the corrected phi has the + // same divergence + volScalarField divU("divU0", fvc::div(fvc::absolute(phi, U))); + #include "CourantNo.H" + #include "alphaCourantNo.H" #include "setDeltaT.H" runTime++; @@ -83,7 +96,37 @@ int main(int argc, char *argv[]) // --- Pressure-velocity PIMPLE corrector loop while (pimple.loop()) { - #include "alphaControls.H" + if (pimple.firstIter() || moveMeshOuterCorrectors) + { + mesh.update(); + + if (mesh.changing()) + { + gh = (g & mesh.C()) - ghRef; + ghf = (g & mesh.Cf()) - ghRef; + + if (correctPhi) + { + // Calculate absolute flux + // from the mapped surface velocity + phi = mesh.Sf() & Uf(); + + #include "correctPhi.H" + + // Make the flux relative to the mesh motion + fvc::makeRelative(phi, U); + + mixture.correct(); + } + + if (checkMeshCourantNo) + { + #include "meshCourantNo.H" + } + } + } + + divU = fvc::div(fvc::absolute(phi, U)); surfaceScalarField rhoPhi ( @@ -97,10 +140,10 @@ int main(int argc, char *argv[]) dimensionedScalar("0", dimMass/dimTime, 0) ); - mixture->correct(); - + #include "alphaControls.H" #include "alphaEqnSubCycle.H" - interface.correct(); + + mixture.correct(); #include "UEqn.H" diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H b/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H index c08deda403..50dabd056c 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H @@ -1,19 +1,33 @@ { - volScalarField rAU("rAU", 1.0/UEqn.A()); - surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU)); - volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh)); + if (correctPhi) + { + rAU.ref() = 1.0/UEqn.A(); + } + else + { + rAU = 1.0/UEqn.A(); + } + + surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU())); + volVectorField HbyA(constrainHbyA(rAU()*UEqn.H(), U, p_rgh)); surfaceScalarField phiHbyA ( "phiHbyA", fvc::flux(HbyA) - + fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi) + + fvc::interpolate(rho*rAU())*fvc::ddtCorr(U, phi, Uf) ); - adjustPhi(phiHbyA, U, p_rgh); + + if (p_rgh.needReference()) + { + fvc::makeRelative(phiHbyA, U); + adjustPhi(phiHbyA, U, p_rgh); + fvc::makeAbsolute(phiHbyA, U); + } surfaceScalarField phig ( ( - interface.surfaceTensionForce() + mixture.surfaceTensionForce() - ghf*fvc::snGrad(rho) )*rAUf*mesh.magSf() ); @@ -23,7 +37,7 @@ // Update the pressure BCs to ensure flux consistency constrainPressure(p_rgh, U, phiHbyA, rAUf); - Pair> vDotP = mixture->vDotP(); + Pair> vDotP = mixture.vDotP(); const volScalarField& vDotcP = vDotP[0](); const volScalarField& vDotvP = vDotP[1](); @@ -32,7 +46,7 @@ fvScalarMatrix p_rghEqn ( fvc::div(phiHbyA) - fvm::laplacian(rAUf, p_rgh) - - (vDotvP - vDotcP)*(mixture->pSat() - rho*gh) + - (vDotvP - vDotcP)*(mixture.pSat() - rho*gh) + fvm::Sp(vDotvP - vDotcP, p_rgh) ); @@ -44,12 +58,18 @@ { phi = phiHbyA + p_rghEqn.flux(); - U = HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rAUf); + U = HbyA + rAU()*fvc::reconstruct((phig + p_rghEqn.flux())/rAUf); U.correctBoundaryConditions(); fvOptions.correct(U); } } + // Correct Uf if the mesh is moving + fvc::correctUf(Uf, U, phi); + + // Make the fluxes relative to the mesh motion + fvc::makeRelative(phi, U); + p == p_rgh + rho*gh; if (p_rgh.needReference()) @@ -62,4 +82,9 @@ ); p_rgh = p - rho*gh; } + + if (!correctPhi) + { + rAU.clear(); + } } diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Kunz/Kunz.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Kunz/Kunz.C index 0f0cfac210..08de2c78b8 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Kunz/Kunz.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Kunz/Kunz.C @@ -66,8 +66,8 @@ Foam::phaseChangeTwoPhaseMixtures::Kunz::Kunz Foam::Pair> Foam::phaseChangeTwoPhaseMixtures::Kunz::mDotAlphal() const { - const volScalarField& p = alpha1_.db().lookupObject("p"); - volScalarField limitedAlpha1(min(max(alpha1_, scalar(0)), scalar(1))); + const volScalarField& p = alpha1().db().lookupObject("p"); + volScalarField limitedAlpha1(min(max(alpha1(), scalar(0)), scalar(1))); return Pair> ( @@ -81,8 +81,8 @@ Foam::phaseChangeTwoPhaseMixtures::Kunz::mDotAlphal() const Foam::Pair> Foam::phaseChangeTwoPhaseMixtures::Kunz::mDotP() const { - const volScalarField& p = alpha1_.db().lookupObject("p"); - volScalarField limitedAlpha1(min(max(alpha1_, scalar(0)), scalar(1))); + const volScalarField& p = alpha1().db().lookupObject("p"); + volScalarField limitedAlpha1(min(max(alpha1(), scalar(0)), scalar(1))); return Pair> ( diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Make/options b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Make/options index 2e61e4ba77..b83d5d1d48 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Make/options +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Make/options @@ -1,11 +1,11 @@ EXE_INC = \ - -I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ + -I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \ + -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ + -I$(LIB_SRC)/transportModels/immiscibleIncompressibleTwoPhaseMixture/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude LIB_LIBS = \ - -ltwoPhaseMixture \ - -ltwoPhaseProperties \ - -lincompressibleTransportModels \ + -limmiscibleIncompressibleTwoPhaseMixture \ -lfiniteVolume diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Merkle/Merkle.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Merkle/Merkle.C index e9b1b93588..7bab254a53 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Merkle/Merkle.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Merkle/Merkle.C @@ -66,7 +66,7 @@ Foam::phaseChangeTwoPhaseMixtures::Merkle::Merkle Foam::Pair> Foam::phaseChangeTwoPhaseMixtures::Merkle::mDotAlphal() const { - const volScalarField& p = alpha1_.db().lookupObject("p"); + const volScalarField& p = alpha1().db().lookupObject("p"); return Pair> ( @@ -78,8 +78,8 @@ Foam::phaseChangeTwoPhaseMixtures::Merkle::mDotAlphal() const Foam::Pair> Foam::phaseChangeTwoPhaseMixtures::Merkle::mDotP() const { - const volScalarField& p = alpha1_.db().lookupObject("p"); - volScalarField limitedAlpha1(min(max(alpha1_, scalar(0)), scalar(1))); + const volScalarField& p = alpha1().db().lookupObject("p"); + volScalarField limitedAlpha1(min(max(alpha1(), scalar(0)), scalar(1))); return Pair> ( diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C index cc21a86a4f..ed79c57147 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C @@ -96,7 +96,7 @@ Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::pCoeff const volScalarField& p ) const { - volScalarField limitedAlpha1(min(max(alpha1_, scalar(0)), scalar(1))); + volScalarField limitedAlpha1(min(max(alpha1(), scalar(0)), scalar(1))); volScalarField rho ( limitedAlpha1*rho1() + (scalar(1) - limitedAlpha1)*rho2() @@ -111,10 +111,10 @@ Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::pCoeff Foam::Pair> Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::mDotAlphal() const { - const volScalarField& p = alpha1_.db().lookupObject("p"); + const volScalarField& p = alpha1().db().lookupObject("p"); volScalarField pCoeff(this->pCoeff(p)); - volScalarField limitedAlpha1(min(max(alpha1_, scalar(0)), scalar(1))); + volScalarField limitedAlpha1(min(max(alpha1(), scalar(0)), scalar(1))); return Pair> ( @@ -128,10 +128,10 @@ Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::mDotAlphal() const Foam::Pair> Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::mDotP() const { - const volScalarField& p = alpha1_.db().lookupObject("p"); + const volScalarField& p = alpha1().db().lookupObject("p"); volScalarField pCoeff(this->pCoeff(p)); - volScalarField limitedAlpha1(min(max(alpha1_, scalar(0)), scalar(1))); + volScalarField limitedAlpha1(min(max(alpha1(), scalar(0)), scalar(1))); volScalarField apCoeff(limitedAlpha1*pCoeff); return Pair> diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.C index c4fe701a2f..0c1524056c 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.C @@ -42,7 +42,7 @@ Foam::phaseChangeTwoPhaseMixture::phaseChangeTwoPhaseMixture const surfaceScalarField& phi ) : - incompressibleTwoPhaseMixture(U, phi), + immiscibleIncompressibleTwoPhaseMixture(U, phi), phaseChangeTwoPhaseMixtureCoeffs_(optionalSubDict(type + "Coeffs")), pSat_("pSat", dimPressure, lookup("pSat")) {} @@ -53,7 +53,7 @@ Foam::phaseChangeTwoPhaseMixture::phaseChangeTwoPhaseMixture Foam::Pair> Foam::phaseChangeTwoPhaseMixture::vDotAlphal() const { - volScalarField alphalCoeff(1.0/rho1() - alpha1_*(1.0/rho1() - 1.0/rho2())); + volScalarField alphalCoeff(1.0/rho1() - alpha1()*(1.0/rho1() - 1.0/rho2())); Pair> mDotAlphal = this->mDotAlphal(); return Pair> @@ -75,7 +75,7 @@ Foam::phaseChangeTwoPhaseMixture::vDotP() const bool Foam::phaseChangeTwoPhaseMixture::read() { - if (incompressibleTwoPhaseMixture::read()) + if (immiscibleIncompressibleTwoPhaseMixture::read()) { phaseChangeTwoPhaseMixtureCoeffs_ = optionalSubDict(type() + "Coeffs"); lookup("pSat") >> pSat_; diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.H b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.H index dedc97a9e9..5ad087d661 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.H @@ -35,7 +35,7 @@ SourceFiles #ifndef phaseChangeTwoPhaseMixture_H #define phaseChangeTwoPhaseMixture_H -#include "incompressibleTwoPhaseMixture.H" +#include "immiscibleIncompressibleTwoPhaseMixture.H" #include "typeInfo.H" #include "runTimeSelectionTables.H" #include "volFields.H" @@ -54,7 +54,7 @@ namespace Foam class phaseChangeTwoPhaseMixture : - public incompressibleTwoPhaseMixture + public immiscibleIncompressibleTwoPhaseMixture { protected: diff --git a/bin/interPhaseChangeDyMFoam b/bin/interPhaseChangeDyMFoam new file mode 120000 index 0000000000..d9fcbed5a0 --- /dev/null +++ b/bin/interPhaseChangeDyMFoam @@ -0,0 +1 @@ +mergedDyM \ No newline at end of file diff --git a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/controlDict b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/controlDict index 36fa73f5d6..46599f7153 100644 --- a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/controlDict +++ b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/controlDict @@ -32,7 +32,7 @@ writeInterval 0.001; purgeWrite 0; -writeFormat ascii; +writeFormat binary; writePrecision 6; @@ -45,6 +45,6 @@ runTimeModifiable yes; adjustTimeStep on; maxCo 5; - +maxAlphaCo 2; // ************************************************************************* // diff --git a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/0/U b/tutorials/multiphase/interPhaseChangeFoam/propeller/0/U similarity index 100% rename from tutorials/multiphase/interPhaseChangeDyMFoam/propeller/0/U rename to tutorials/multiphase/interPhaseChangeFoam/propeller/0/U diff --git a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/0/alpha.water b/tutorials/multiphase/interPhaseChangeFoam/propeller/0/alpha.water similarity index 100% rename from tutorials/multiphase/interPhaseChangeDyMFoam/propeller/0/alpha.water rename to tutorials/multiphase/interPhaseChangeFoam/propeller/0/alpha.water diff --git a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/0/epsilon b/tutorials/multiphase/interPhaseChangeFoam/propeller/0/epsilon similarity index 100% rename from tutorials/multiphase/interPhaseChangeDyMFoam/propeller/0/epsilon rename to tutorials/multiphase/interPhaseChangeFoam/propeller/0/epsilon diff --git a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/0/k b/tutorials/multiphase/interPhaseChangeFoam/propeller/0/k similarity index 100% rename from tutorials/multiphase/interPhaseChangeDyMFoam/propeller/0/k rename to tutorials/multiphase/interPhaseChangeFoam/propeller/0/k diff --git a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/0/nut b/tutorials/multiphase/interPhaseChangeFoam/propeller/0/nut similarity index 100% rename from tutorials/multiphase/interPhaseChangeDyMFoam/propeller/0/nut rename to tutorials/multiphase/interPhaseChangeFoam/propeller/0/nut diff --git a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/0/p_rgh b/tutorials/multiphase/interPhaseChangeFoam/propeller/0/p_rgh similarity index 100% rename from tutorials/multiphase/interPhaseChangeDyMFoam/propeller/0/p_rgh rename to tutorials/multiphase/interPhaseChangeFoam/propeller/0/p_rgh diff --git a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/Allclean b/tutorials/multiphase/interPhaseChangeFoam/propeller/Allclean similarity index 100% rename from tutorials/multiphase/interPhaseChangeDyMFoam/propeller/Allclean rename to tutorials/multiphase/interPhaseChangeFoam/propeller/Allclean diff --git a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/Allmesh b/tutorials/multiphase/interPhaseChangeFoam/propeller/Allmesh similarity index 100% rename from tutorials/multiphase/interPhaseChangeDyMFoam/propeller/Allmesh rename to tutorials/multiphase/interPhaseChangeFoam/propeller/Allmesh diff --git a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/Allrun b/tutorials/multiphase/interPhaseChangeFoam/propeller/Allrun similarity index 100% rename from tutorials/multiphase/interPhaseChangeDyMFoam/propeller/Allrun rename to tutorials/multiphase/interPhaseChangeFoam/propeller/Allrun diff --git a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/constant/dynamicMeshDict b/tutorials/multiphase/interPhaseChangeFoam/propeller/constant/dynamicMeshDict similarity index 100% rename from tutorials/multiphase/interPhaseChangeDyMFoam/propeller/constant/dynamicMeshDict rename to tutorials/multiphase/interPhaseChangeFoam/propeller/constant/dynamicMeshDict diff --git a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/constant/g b/tutorials/multiphase/interPhaseChangeFoam/propeller/constant/g similarity index 100% rename from tutorials/multiphase/interPhaseChangeDyMFoam/propeller/constant/g rename to tutorials/multiphase/interPhaseChangeFoam/propeller/constant/g diff --git a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/constant/transportProperties b/tutorials/multiphase/interPhaseChangeFoam/propeller/constant/transportProperties similarity index 100% rename from tutorials/multiphase/interPhaseChangeDyMFoam/propeller/constant/transportProperties rename to tutorials/multiphase/interPhaseChangeFoam/propeller/constant/transportProperties diff --git a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/constant/triSurface/innerCylinder.obj b/tutorials/multiphase/interPhaseChangeFoam/propeller/constant/triSurface/innerCylinder.obj similarity index 100% rename from tutorials/multiphase/interPhaseChangeDyMFoam/propeller/constant/triSurface/innerCylinder.obj rename to tutorials/multiphase/interPhaseChangeFoam/propeller/constant/triSurface/innerCylinder.obj diff --git a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/constant/triSurface/innerCylinderSmall.obj b/tutorials/multiphase/interPhaseChangeFoam/propeller/constant/triSurface/innerCylinderSmall.obj similarity index 100% rename from tutorials/multiphase/interPhaseChangeDyMFoam/propeller/constant/triSurface/innerCylinderSmall.obj rename to tutorials/multiphase/interPhaseChangeFoam/propeller/constant/triSurface/innerCylinderSmall.obj diff --git a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/constant/triSurface/outerCylinder.obj b/tutorials/multiphase/interPhaseChangeFoam/propeller/constant/triSurface/outerCylinder.obj similarity index 100% rename from tutorials/multiphase/interPhaseChangeDyMFoam/propeller/constant/triSurface/outerCylinder.obj rename to tutorials/multiphase/interPhaseChangeFoam/propeller/constant/triSurface/outerCylinder.obj diff --git a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/constant/triSurface/propellerStem1.obj b/tutorials/multiphase/interPhaseChangeFoam/propeller/constant/triSurface/propellerStem1.obj similarity index 100% rename from tutorials/multiphase/interPhaseChangeDyMFoam/propeller/constant/triSurface/propellerStem1.obj rename to tutorials/multiphase/interPhaseChangeFoam/propeller/constant/triSurface/propellerStem1.obj diff --git a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/constant/triSurface/propellerStem2.obj b/tutorials/multiphase/interPhaseChangeFoam/propeller/constant/triSurface/propellerStem2.obj similarity index 100% rename from tutorials/multiphase/interPhaseChangeDyMFoam/propeller/constant/triSurface/propellerStem2.obj rename to tutorials/multiphase/interPhaseChangeFoam/propeller/constant/triSurface/propellerStem2.obj diff --git a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/constant/triSurface/propellerStem3.obj b/tutorials/multiphase/interPhaseChangeFoam/propeller/constant/triSurface/propellerStem3.obj similarity index 100% rename from tutorials/multiphase/interPhaseChangeDyMFoam/propeller/constant/triSurface/propellerStem3.obj rename to tutorials/multiphase/interPhaseChangeFoam/propeller/constant/triSurface/propellerStem3.obj diff --git a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/constant/turbulenceProperties b/tutorials/multiphase/interPhaseChangeFoam/propeller/constant/turbulenceProperties similarity index 100% rename from tutorials/multiphase/interPhaseChangeDyMFoam/propeller/constant/turbulenceProperties rename to tutorials/multiphase/interPhaseChangeFoam/propeller/constant/turbulenceProperties diff --git a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/system/blockMeshDict b/tutorials/multiphase/interPhaseChangeFoam/propeller/system/blockMeshDict similarity index 100% rename from tutorials/multiphase/interPhaseChangeDyMFoam/propeller/system/blockMeshDict rename to tutorials/multiphase/interPhaseChangeFoam/propeller/system/blockMeshDict diff --git a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/system/controlDict b/tutorials/multiphase/interPhaseChangeFoam/propeller/system/controlDict similarity index 96% rename from tutorials/multiphase/interPhaseChangeDyMFoam/propeller/system/controlDict rename to tutorials/multiphase/interPhaseChangeFoam/propeller/system/controlDict index 3ff478fa50..1861e69364 100644 --- a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/system/controlDict +++ b/tutorials/multiphase/interPhaseChangeFoam/propeller/system/controlDict @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -application interPhaseChangeDyMFoam; +application interPhaseChangeFoam; startFrom startTime; diff --git a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/system/createInletOutletSets.topoSetDict b/tutorials/multiphase/interPhaseChangeFoam/propeller/system/createInletOutletSets.topoSetDict similarity index 100% rename from tutorials/multiphase/interPhaseChangeDyMFoam/propeller/system/createInletOutletSets.topoSetDict rename to tutorials/multiphase/interPhaseChangeFoam/propeller/system/createInletOutletSets.topoSetDict diff --git a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/system/createPatchDict b/tutorials/multiphase/interPhaseChangeFoam/propeller/system/createPatchDict similarity index 100% rename from tutorials/multiphase/interPhaseChangeDyMFoam/propeller/system/createPatchDict rename to tutorials/multiphase/interPhaseChangeFoam/propeller/system/createPatchDict diff --git a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/system/decomposeParDict b/tutorials/multiphase/interPhaseChangeFoam/propeller/system/decomposeParDict similarity index 100% rename from tutorials/multiphase/interPhaseChangeDyMFoam/propeller/system/decomposeParDict rename to tutorials/multiphase/interPhaseChangeFoam/propeller/system/decomposeParDict diff --git a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/system/fvSchemes b/tutorials/multiphase/interPhaseChangeFoam/propeller/system/fvSchemes similarity index 100% rename from tutorials/multiphase/interPhaseChangeDyMFoam/propeller/system/fvSchemes rename to tutorials/multiphase/interPhaseChangeFoam/propeller/system/fvSchemes diff --git a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/system/fvSolution b/tutorials/multiphase/interPhaseChangeFoam/propeller/system/fvSolution similarity index 100% rename from tutorials/multiphase/interPhaseChangeDyMFoam/propeller/system/fvSolution rename to tutorials/multiphase/interPhaseChangeFoam/propeller/system/fvSolution diff --git a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/system/snappyHexMeshDict b/tutorials/multiphase/interPhaseChangeFoam/propeller/system/snappyHexMeshDict similarity index 100% rename from tutorials/multiphase/interPhaseChangeDyMFoam/propeller/system/snappyHexMeshDict rename to tutorials/multiphase/interPhaseChangeFoam/propeller/system/snappyHexMeshDict diff --git a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/system/surfaceFeaturesDict b/tutorials/multiphase/interPhaseChangeFoam/propeller/system/surfaceFeaturesDict similarity index 100% rename from tutorials/multiphase/interPhaseChangeDyMFoam/propeller/system/surfaceFeaturesDict rename to tutorials/multiphase/interPhaseChangeFoam/propeller/system/surfaceFeaturesDict From 648989d50ce1c55e0a0bd777e3f053121abb7d96 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Wed, 4 Jul 2018 17:03:16 +0100 Subject: [PATCH 08/15] cavitatingFoam: Merged with cavitatingDyMFoam cavitatingFoam can now run with static or dynamic meshes selected in the constant/dynamicMeshDict dictionary. --- .../multiphase/cavitatingFoam/Make/options | 2 + .../cavitatingDyMFoam/Make/files | 3 - .../cavitatingDyMFoam/Make/options | 23 ---- .../cavitatingDyMFoam/cavitatingDyMFoam.C | 125 ------------------ .../cavitatingDyMFoam/createControls.H | 6 - .../cavitatingFoam/cavitatingDyMFoam/pEqn.H | 88 ------------ .../cavitatingDyMFoam/readControls.H | 3 - .../cavitatingFoam/cavitatingFoam.C | 38 ++++-- .../{cavitatingDyMFoam => }/correctPhi.H | 0 .../cavitatingFoam/createControls.H | 2 +- .../createPcorrTypes.H | 0 .../solvers/multiphase/cavitatingFoam/pEqn.H | 21 ++- .../multiphase/cavitatingFoam/readControls.H | 2 +- bin/cavitatingDyMFoam | 1 + 14 files changed, 45 insertions(+), 269 deletions(-) delete mode 100644 applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/Make/files delete mode 100644 applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/Make/options delete mode 100644 applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/cavitatingDyMFoam.C delete mode 100644 applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/createControls.H delete mode 100644 applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/pEqn.H delete mode 100644 applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/readControls.H rename applications/solvers/multiphase/cavitatingFoam/{cavitatingDyMFoam => }/correctPhi.H (100%) rename applications/solvers/multiphase/cavitatingFoam/{cavitatingDyMFoam => }/createPcorrTypes.H (100%) create mode 120000 bin/cavitatingDyMFoam diff --git a/applications/solvers/multiphase/cavitatingFoam/Make/options b/applications/solvers/multiphase/cavitatingFoam/Make/options index 02d5a1cc3e..157057ceb8 100644 --- a/applications/solvers/multiphase/cavitatingFoam/Make/options +++ b/applications/solvers/multiphase/cavitatingFoam/Make/options @@ -7,6 +7,7 @@ EXE_INC = \ -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/barotropicCompressibilityModel/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude EXE_LIBS = \ @@ -14,5 +15,6 @@ EXE_LIBS = \ -lincompressibleTurbulenceModels \ -lbarotropicCompressibilityModel \ -lfiniteVolume \ + -ldynamicFvMesh \ -lfvOptions \ -lmeshTools diff --git a/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/Make/files b/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/Make/files deleted file mode 100644 index 57cd74e01d..0000000000 --- a/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -cavitatingDyMFoam.C - -EXE = $(FOAM_APPBIN)/cavitatingDyMFoam diff --git a/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/Make/options b/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/Make/options deleted file mode 100644 index b5d7b2cdfa..0000000000 --- a/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/Make/options +++ /dev/null @@ -1,23 +0,0 @@ -EXE_INC = \ - -I.. \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \ - -I$(LIB_SRC)/transportModels \ - -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ - -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ - -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ - -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/barotropicCompressibilityModel/lnInclude \ - -I$(LIB_SRC)/dynamicMesh/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/dynamicFvMesh/lnInclude - -EXE_LIBS = \ - -lturbulenceModels \ - -lincompressibleTurbulenceModels \ - -lbarotropicCompressibilityModel \ - -lfiniteVolume \ - -lfvOptions \ - -ldynamicMesh \ - -ldynamicFvMesh \ - -lmeshTools diff --git a/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/cavitatingDyMFoam.C b/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/cavitatingDyMFoam.C deleted file mode 100644 index c9db98e755..0000000000 --- a/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/cavitatingDyMFoam.C +++ /dev/null @@ -1,125 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2012-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 . - -Application - cavitatingFoam - -Description - Transient cavitation code based on the homogeneous equilibrium model - from which the compressibility of the liquid/vapour "mixture" is obtained, - with optional mesh motion and mesh topology changes. - - Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected. - -\*---------------------------------------------------------------------------*/ - -#include "fvCFD.H" -#include "dynamicFvMesh.H" -#include "barotropicCompressibilityModel.H" -#include "incompressibleTwoPhaseMixture.H" -#include "turbulentTransportModel.H" -#include "CorrectPhi.H" -#include "pimpleControl.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -int main(int argc, char *argv[]) -{ - #include "postProcess.H" - - #include "setRootCaseLists.H" - #include "createTime.H" - #include "createDynamicFvMesh.H" - #include "createControls.H" - #include "createFields.H" - #include "createUf.H" - #include "createPcorrTypes.H" - #include "CourantNo.H" - #include "setInitialDeltaT.H" - - turbulence->validate(); - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - - Info<< "\nStarting time loop\n" << endl; - - while (runTime.run()) - { - #include "readControls.H" - - { - #include "CourantNo.H" - #include "setDeltaT.H" - - runTime++; - - Info<< "Time = " << runTime.timeName() << nl << endl; - - // Do any mesh changes - mesh.update(); - - if (mesh.changing() && correctPhi) - { - // Calculate absolute flux from the mapped surface velocity - phi = mesh.Sf() & Uf; - - #include "correctPhi.H" - - // Make the flux relative to the mesh motion - fvc::makeRelative(phi, U); - } - } - - // --- Pressure-velocity PIMPLE corrector loop - while (pimple.loop()) - { - #include "rhoEqn.H" - #include "alphavPsi.H" - #include "UEqn.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/multiphase/cavitatingFoam/cavitatingDyMFoam/createControls.H b/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/createControls.H deleted file mode 100644 index d47cf78b5a..0000000000 --- a/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/createControls.H +++ /dev/null @@ -1,6 +0,0 @@ -#include "createDyMControls.H" - -scalar maxAcousticCo -( - readScalar(runTime.controlDict().lookup("maxAcousticCo")) -); diff --git a/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/pEqn.H b/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/pEqn.H deleted file mode 100644 index f0ead3619b..0000000000 --- a/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/pEqn.H +++ /dev/null @@ -1,88 +0,0 @@ -{ - if (pimple.nCorrPimple() == 1) - { - p = - ( - rho - - alphal*rhol0 - - ((alphav*psiv + alphal*psil) - psi)*pSat - )/psi; - } - - surfaceScalarField rhof("rhof", fvc::interpolate(rho)); - - volScalarField rAU(1.0/UEqn.A()); - surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU)); - volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p)); - - phi = fvc::flux(HbyA) - + rhorAUf*fvc::ddtCorr(U, Uf); - fvc::makeRelative(phi, U); - - surfaceScalarField phiGradp(rhorAUf*mesh.magSf()*fvc::snGrad(p)); - - phi -= phiGradp/rhof; - - volScalarField rho0(rho - psi*p); - - while (pimple.correctNonOrthogonal()) - { - fvScalarMatrix pEqn - ( - fvc::ddt(rho) - + psi*correction(fvm::ddt(p)) - + fvc::div(phi, rho) - + fvc::div(phiGradp) - - fvm::laplacian(rhorAUf, p) - ); - - pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); - - if (pimple.finalNonOrthogonalIter()) - { - phi += (phiGradp + pEqn.flux())/rhof; - } - } - - Info<< "Predicted p max-min : " << max(p).value() - << " " << min(p).value() << endl; - - rho == max(rho0 + psi*p, rhoMin); - - #include "alphavPsi.H" - - p = - ( - rho - - alphal*rhol0 - - ((alphav*psiv + alphal*psil) - psi)*pSat - )/psi; - - p.correctBoundaryConditions(); - - Info<< "Phase-change corrected p max-min : " << max(p).value() - << " " << min(p).value() << endl; - - // Correct velocity - - U = HbyA - rAU*fvc::grad(p); - - // Remove the swirl component of velocity for "wedge" cases - if (pimple.dict().found("removeSwirl")) - { - label swirlCmpt(readLabel(pimple.dict().lookup("removeSwirl"))); - - Info<< "Removing swirl component-" << swirlCmpt << " of U" << endl; - U.field().replace(swirlCmpt, 0.0); - } - - U.correctBoundaryConditions(); - - Info<< "max(U) " << max(mag(U)).value() << endl; - - { - Uf = fvc::interpolate(U); - surfaceVectorField n(mesh.Sf()/mesh.magSf()); - Uf += n*(phi/mesh.magSf() - (n & Uf)); - } -} diff --git a/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/readControls.H b/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/readControls.H deleted file mode 100644 index 84ef52ce65..0000000000 --- a/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/readControls.H +++ /dev/null @@ -1,3 +0,0 @@ -#include "readDyMControls.H" - -maxAcousticCo = readScalar(runTime.controlDict().lookup("maxAcousticCo")); diff --git a/applications/solvers/multiphase/cavitatingFoam/cavitatingFoam.C b/applications/solvers/multiphase/cavitatingFoam/cavitatingFoam.C index 3a16ea026b..5dfd61641a 100644 --- a/applications/solvers/multiphase/cavitatingFoam/cavitatingFoam.C +++ b/applications/solvers/multiphase/cavitatingFoam/cavitatingFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,16 +26,19 @@ Application Description Transient cavitation code based on the homogeneous equilibrium model - from which the compressibility of the liquid/vapour "mixture" is obtained. + from which the compressibility of the liquid/vapour "mixture" is obtained, + with optional mesh motion and mesh topology changes. Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected. \*---------------------------------------------------------------------------*/ #include "fvCFD.H" +#include "dynamicFvMesh.H" #include "barotropicCompressibilityModel.H" #include "incompressibleTwoPhaseMixture.H" #include "turbulentTransportModel.H" +#include "CorrectPhi.H" #include "pimpleControl.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -46,10 +49,11 @@ int main(int argc, char *argv[]) #include "setRootCaseLists.H" #include "createTime.H" - #include "createMesh.H" - #include "createControl.H" + #include "createDynamicFvMesh.H" #include "createControls.H" #include "createFields.H" + #include "createUfIfPresent.H" + #include "createPcorrTypes.H" #include "CourantNo.H" #include "setInitialDeltaT.H" @@ -62,11 +66,29 @@ int main(int argc, char *argv[]) while (runTime.run()) { #include "readControls.H" - #include "CourantNo.H" - #include "setDeltaT.H" - runTime++; - Info<< "Time = " << runTime.timeName() << nl << endl; + { + #include "CourantNo.H" + #include "setDeltaT.H" + + runTime++; + + Info<< "Time = " << runTime.timeName() << nl << endl; + + // Do any mesh changes + mesh.update(); + + if (mesh.changing() && correctPhi) + { + // Calculate absolute flux from the mapped surface velocity + phi = mesh.Sf() & Uf(); + + #include "correctPhi.H" + + // Make the flux relative to the mesh motion + fvc::makeRelative(phi, U); + } + } // --- Pressure-velocity PIMPLE corrector loop while (pimple.loop()) diff --git a/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/correctPhi.H b/applications/solvers/multiphase/cavitatingFoam/correctPhi.H similarity index 100% rename from applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/correctPhi.H rename to applications/solvers/multiphase/cavitatingFoam/correctPhi.H diff --git a/applications/solvers/multiphase/cavitatingFoam/createControls.H b/applications/solvers/multiphase/cavitatingFoam/createControls.H index e5c7eea9f7..d47cf78b5a 100644 --- a/applications/solvers/multiphase/cavitatingFoam/createControls.H +++ b/applications/solvers/multiphase/cavitatingFoam/createControls.H @@ -1,4 +1,4 @@ -#include "createTimeControls.H" +#include "createDyMControls.H" scalar maxAcousticCo ( diff --git a/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/createPcorrTypes.H b/applications/solvers/multiphase/cavitatingFoam/createPcorrTypes.H similarity index 100% rename from applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/createPcorrTypes.H rename to applications/solvers/multiphase/cavitatingFoam/createPcorrTypes.H diff --git a/applications/solvers/multiphase/cavitatingFoam/pEqn.H b/applications/solvers/multiphase/cavitatingFoam/pEqn.H index 8f5707fcde..716327bf74 100644 --- a/applications/solvers/multiphase/cavitatingFoam/pEqn.H +++ b/applications/solvers/multiphase/cavitatingFoam/pEqn.H @@ -15,19 +15,21 @@ surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU)); volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p)); - phi = fvc::flux(HbyA) - + rhorAUf*fvc::ddtCorr(U, phi); + phi = fvc::flux(HbyA) + rhorAUf*fvc::ddtCorr(U, phi, Uf); + fvc::makeRelative(phi, U); surfaceScalarField phiGradp(rhorAUf*mesh.magSf()*fvc::snGrad(p)); phi -= phiGradp/rhof; + volScalarField rho0(rho - psi*p); + while (pimple.correctNonOrthogonal()) { fvScalarMatrix pEqn ( - fvm::ddt(psi, p) - - (rhol0 + (psil - psiv)*pSat)*fvc::ddt(alphav) - pSat*fvc::ddt(psi) + fvc::ddt(rho) + + psi*correction(fvm::ddt(p)) + fvc::div(phi, rho) + fvc::div(phiGradp) - fvm::laplacian(rhorAUf, p) @@ -44,13 +46,7 @@ Info<< "Predicted p max-min : " << max(p).value() << " " << min(p).value() << endl; - rho == max - ( - psi*p - + alphal*rhol0 - + ((alphav*psiv + alphal*psil) - psi)*pSat, - rhoMin - ); + rho == max(rho0 + psi*p, rhoMin); #include "alphavPsi.H" @@ -82,4 +78,7 @@ U.correctBoundaryConditions(); Info<< "max(U) " << max(mag(U)).value() << endl; + + // Correct Uf if the mesh is moving + fvc::correctUf(Uf, U, phi); } diff --git a/applications/solvers/multiphase/cavitatingFoam/readControls.H b/applications/solvers/multiphase/cavitatingFoam/readControls.H index a2d4dc80a7..84ef52ce65 100644 --- a/applications/solvers/multiphase/cavitatingFoam/readControls.H +++ b/applications/solvers/multiphase/cavitatingFoam/readControls.H @@ -1,3 +1,3 @@ -#include "readTimeControls.H" +#include "readDyMControls.H" maxAcousticCo = readScalar(runTime.controlDict().lookup("maxAcousticCo")); diff --git a/bin/cavitatingDyMFoam b/bin/cavitatingDyMFoam new file mode 120000 index 0000000000..d9fcbed5a0 --- /dev/null +++ b/bin/cavitatingDyMFoam @@ -0,0 +1 @@ +mergedDyM \ No newline at end of file From 0262ee1364805bf034e8c9aac5b2e0036878e613 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Wed, 4 Jul 2018 17:37:36 +0100 Subject: [PATCH 09/15] icoUncoupledKinematicParcelFoam: Merged with icoUncoupledKinematicParcelDyMFoam icoUncoupledKinematicParcelFoam can now run with static or dynamic meshes selected in the constant/dynamicMeshDict dictionary. --- .../icoUncoupledKinematicParcelFoam.C | 6 +- .../uncoupledKinematicParcelFoam/Make/options | 6 +- .../Make/files | 3 - .../Make/options | 36 -------- .../uncoupledKinematicParcelDyMFoam.C | 90 ------------------- .../uncoupledKinematicParcelFoam.C | 12 ++- bin/uncoupledKinematicParcelDyMFoam | 1 + 7 files changed, 19 insertions(+), 135 deletions(-) delete mode 100644 applications/solvers/lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelDyMFoam/Make/files delete mode 100644 applications/solvers/lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelDyMFoam/Make/options delete mode 100644 applications/solvers/lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelDyMFoam/uncoupledKinematicParcelDyMFoam.C create mode 120000 bin/uncoupledKinematicParcelDyMFoam diff --git a/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/icoUncoupledKinematicParcelFoam.C b/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/icoUncoupledKinematicParcelFoam.C index 9143204a1f..e8636f0b78 100644 --- a/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/icoUncoupledKinematicParcelFoam.C +++ b/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/icoUncoupledKinematicParcelFoam.C @@ -49,13 +49,14 @@ int main(int argc, char *argv[]) "specify alternative cloud name. default is 'kinematicCloud'" ); + #define NO_CONTROL #include "postProcess.H" #include "setRootCaseLists.H" #include "createTime.H" #include "createDynamicFvMesh.H" - #include "createControl.H" #include "createFields.H" + #include "CourantNo.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -74,10 +75,9 @@ int main(int argc, char *argv[]) U.correctBoundaryConditions(); } - Info<< "Evolving " << kinematicCloud.name() << endl; - laminarTransport.correct(); + Info<< "Evolving " << kinematicCloud.name() << endl; mu = laminarTransport.nu()*rhoInfValue; kinematicCloud.evolve(); diff --git a/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/Make/options b/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/Make/options index 639909b38e..45524dff69 100644 --- a/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/Make/options +++ b/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/Make/options @@ -11,7 +11,8 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/regionModels/regionModel/lnInclude \ - -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude + -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \ + -I$(LIB_SRC)/dynamicFvMesh/lnInclude EXE_LIBS = \ -llagrangian \ @@ -27,4 +28,5 @@ EXE_LIBS = \ -lfvOptions \ -lmeshTools \ -lregionModels \ - -lsurfaceFilmModels + -lsurfaceFilmModels \ + -ldynamicFvMesh diff --git a/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelDyMFoam/Make/files b/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelDyMFoam/Make/files deleted file mode 100644 index 430b1df24f..0000000000 --- a/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelDyMFoam/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -uncoupledKinematicParcelDyMFoam.C - -EXE = $(FOAM_APPBIN)/uncoupledKinematicParcelDyMFoam diff --git a/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelDyMFoam/Make/options b/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelDyMFoam/Make/options deleted file mode 100644 index 2d385f9853..0000000000 --- a/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelDyMFoam/Make/options +++ /dev/null @@ -1,36 +0,0 @@ -EXE_INC = \ - -I.. \ - -I$(LIB_SRC)/lagrangian/basic/lnInclude \ - -I$(LIB_SRC)/lagrangian/intermediate/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ - -I$(LIB_SRC)/transportModels/compressible/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ - -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ - -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/regionModels/regionModel/lnInclude \ - -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \ - -I$(LIB_SRC)/dynamicMesh/lnInclude \ - -I$(LIB_SRC)/dynamicFvMesh/lnInclude - -EXE_LIBS = \ - -llagrangian \ - -llagrangianIntermediate \ - -llagrangianTurbulence \ - -lcompressibleTransportModels \ - -lfluidThermophysicalModels \ - -lspecie \ - -lradiationModels \ - -lturbulenceModels \ - -lcompressibleTurbulenceModels \ - -lfiniteVolume \ - -lfvOptions \ - -lmeshTools \ - -lregionModels \ - -lsurfaceFilmModels \ - -ldynamicMesh \ - -ldynamicFvMesh \ - -ltopoChangerFvMesh diff --git a/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelDyMFoam/uncoupledKinematicParcelDyMFoam.C b/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelDyMFoam/uncoupledKinematicParcelDyMFoam.C deleted file mode 100644 index f0c7674835..0000000000 --- a/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelDyMFoam/uncoupledKinematicParcelDyMFoam.C +++ /dev/null @@ -1,90 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2017-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 . - -Application - uncoupledKinematicParcelDyMFoam - -Description - Transient solver for the passive transport of a particle cloud. - - Uses a pre- calculated velocity field to evolve the cloud. - -\*---------------------------------------------------------------------------*/ - -#include "fvCFD.H" -#include "dynamicFvMesh.H" -#include "psiThermo.H" -#include "turbulentFluidThermoModel.H" -#include "basicKinematicCloud.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -int main(int argc, char *argv[]) -{ - argList::addOption - ( - "cloudName", - "name", - "specify alternative cloud name. default is 'kinematicCloud'" - ); - - #define NO_CONTROL - #include "postProcess.H" - - #include "setRootCaseLists.H" - #include "createTime.H" - #include "createDynamicFvMesh.H" - #include "createFields.H" - #include "compressibleCourantNo.H" - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - - Info<< "\nStarting time loop\n" << endl; - - while (runTime.loop()) - { - Info<< "Time = " << runTime.timeName() << nl << endl; - - kinematicCloud.storeGlobalPositions(); - - mesh.update(); - - U.correctBoundaryConditions(); - - Info<< "Evolving " << kinematicCloud.name() << endl; - kinematicCloud.evolve(); - - runTime.write(); - - Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" - << " ClockTime = " << runTime.elapsedClockTime() << " s" - << nl << endl; - } - - Info<< "End\n" << endl; - - return 0; -} - - -// ************************************************************************* // diff --git a/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelFoam.C b/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelFoam.C index 55b2037547..207b1a3166 100644 --- a/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelFoam.C +++ b/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelFoam.C @@ -32,6 +32,7 @@ Description \*---------------------------------------------------------------------------*/ #include "fvCFD.H" +#include "dynamicFvMesh.H" #include "psiThermo.H" #include "turbulentFluidThermoModel.H" #include "basicKinematicCloud.H" @@ -52,7 +53,7 @@ int main(int argc, char *argv[]) #include "setRootCaseLists.H" #include "createTime.H" - #include "createMesh.H" + #include "createDynamicFvMesh.H" #include "createFields.H" #include "compressibleCourantNo.H" @@ -64,6 +65,15 @@ int main(int argc, char *argv[]) { Info<< "Time = " << runTime.timeName() << nl << endl; + kinematicCloud.storeGlobalPositions(); + + mesh.update(); + + if (mesh.changing()) + { + U.correctBoundaryConditions(); + } + Info<< "Evolving " << kinematicCloud.name() << endl; kinematicCloud.evolve(); diff --git a/bin/uncoupledKinematicParcelDyMFoam b/bin/uncoupledKinematicParcelDyMFoam new file mode 120000 index 0000000000..d9fcbed5a0 --- /dev/null +++ b/bin/uncoupledKinematicParcelDyMFoam @@ -0,0 +1 @@ +mergedDyM \ No newline at end of file From cba52dfad0cf1215dab71a166a5adaa8c0d4783a Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Wed, 4 Jul 2018 17:38:36 +0100 Subject: [PATCH 10/15] sprayFoam: Merged with sprayDyMFoam sprayFoam can now run with static or dynamic meshes selected in the constant/dynamicMeshDict dictionary. --- .../solvers/lagrangian/sprayFoam/Make/options | 7 +- .../solvers/lagrangian/sprayFoam/pEqn.H | 18 +- .../sprayFoam/sprayDyMFoam/Make/options | 5 +- .../lagrangian/sprayFoam/sprayDyMFoam/pEqn.H | 122 -------------- .../sprayFoam/sprayDyMFoam/sprayDyMFoam.C | 159 ------------------ .../solvers/lagrangian/sprayFoam/sprayFoam.C | 102 +++++++---- 6 files changed, 92 insertions(+), 321 deletions(-) delete mode 100644 applications/solvers/lagrangian/sprayFoam/sprayDyMFoam/pEqn.H delete mode 100644 applications/solvers/lagrangian/sprayFoam/sprayDyMFoam/sprayDyMFoam.C diff --git a/applications/solvers/lagrangian/sprayFoam/Make/options b/applications/solvers/lagrangian/sprayFoam/Make/options index 2a27738259..38dd84ca10 100644 --- a/applications/solvers/lagrangian/sprayFoam/Make/options +++ b/applications/solvers/lagrangian/sprayFoam/Make/options @@ -1,6 +1,7 @@ EXE_INC = \ -I. \ -I../reactingParcelFoam \ + -I../../compressible/rhoPimpleFoam \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/sampling/lnInclude \ @@ -21,7 +22,9 @@ EXE_INC = \ -I$(LIB_SRC)/ODE/lnInclude \ -I$(LIB_SRC)/regionModels/regionModel/lnInclude \ -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \ - -I$(LIB_SRC)/combustionModels/lnInclude + -I$(LIB_SRC)/combustionModels/lnInclude \ + -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude EXE_LIBS = \ -lturbulenceModels \ @@ -43,6 +46,8 @@ EXE_LIBS = \ -lsurfaceFilmModels \ -lcombustionModels \ -lfiniteVolume \ + -ldynamicFvMesh \ + -ltopoChangerFvMesh \ -lfvOptions \ -lmeshTools \ -lsampling diff --git a/applications/solvers/lagrangian/sprayFoam/pEqn.H b/applications/solvers/lagrangian/sprayFoam/pEqn.H index 10c49d1811..cb5fd1a45b 100644 --- a/applications/solvers/lagrangian/sprayFoam/pEqn.H +++ b/applications/solvers/lagrangian/sprayFoam/pEqn.H @@ -22,11 +22,12 @@ if (pimple.transonic()) fvc::flux(HbyA) + MRF.zeroFilter ( - rhorAUf*fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho) + rhorAUf*fvc::ddtCorr(rho, U, phi, rhoUf)/fvc::interpolate(rho) ) ) ); + fvc::makeRelative(phid, psi, U); MRF.makeRelative(fvc::interpolate(psi), phid); while (pimple.correctNonOrthogonal()) @@ -54,12 +55,11 @@ else surfaceScalarField phiHbyA ( "phiHbyA", - ( - fvc::flux(rho*HbyA) - + rhorAUf*fvc::ddtCorr(rho, U, phi) - ) + fvc::flux(rho*HbyA) + + MRF.zeroFilter(rhorAUf*fvc::ddtCorr(rho, U, phi, rhoUf)) ); + fvc::makeRelative(phiHbyA, rho, U); MRF.makeRelative(fvc::interpolate(rho), phiHbyA); // Update the pressure BCs to ensure flux consistency @@ -105,7 +105,15 @@ U.correctBoundaryConditions(); fvOptions.correct(U); K = 0.5*magSqr(U); +// Correct rhoUf if the mesh is moving +fvc::correctRhoUf(rhoUf, rho, U, phi); + if (thermo.dpdt()) { dpdt = fvc::ddt(p); + + if (mesh.moving()) + { + dpdt -= fvc::div(fvc::meshPhi(rho, U), p); + } } diff --git a/applications/solvers/lagrangian/sprayFoam/sprayDyMFoam/Make/options b/applications/solvers/lagrangian/sprayFoam/sprayDyMFoam/Make/options index d53d6614e4..4a32bfe0c5 100644 --- a/applications/solvers/lagrangian/sprayFoam/sprayDyMFoam/Make/options +++ b/applications/solvers/lagrangian/sprayFoam/sprayDyMFoam/Make/options @@ -24,7 +24,6 @@ EXE_INC = \ -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \ -I$(LIB_SRC)/combustionModels/lnInclude \ -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ - -I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude EXE_LIBS = \ @@ -46,9 +45,9 @@ EXE_LIBS = \ -lregionModels \ -lsurfaceFilmModels \ -lcombustionModels \ - -lfiniteVolume \ - -lfvOptions \ + -lfiniteVolume \ -ldynamicFvMesh \ -ltopoChangerFvMesh \ + -lfvOptions \ -ldynamicMesh \ -lmeshTools diff --git a/applications/solvers/lagrangian/sprayFoam/sprayDyMFoam/pEqn.H b/applications/solvers/lagrangian/sprayFoam/sprayDyMFoam/pEqn.H deleted file mode 100644 index a08bcf9fd1..0000000000 --- a/applications/solvers/lagrangian/sprayFoam/sprayDyMFoam/pEqn.H +++ /dev/null @@ -1,122 +0,0 @@ -rho = thermo.rho(); -rho = max(rho, rhoMin); -rho = min(rho, rhoMax); -rho.relax(); - -volScalarField rAU(1.0/UEqn.A()); -surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU)); -volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p)); - -if (pimple.nCorrPISO() <= 1) -{ - tUEqn.clear(); -} - -if (pimple.transonic()) -{ - surfaceScalarField phid - ( - "phid", - fvc::interpolate(psi) - *( - fvc::flux(HbyA) - + MRF.zeroFilter - ( - rhorAUf*fvc::ddtCorr(rho, U, rhoUf)/fvc::interpolate(rho) - ) - ) - ); - - fvc::makeRelative(phid, psi, U); - MRF.makeRelative(fvc::interpolate(psi), phid); - - while (pimple.correctNonOrthogonal()) - { - fvScalarMatrix pEqn - ( - fvm::ddt(psi, p) - + fvm::div(phid, p) - - fvm::laplacian(rhorAUf, p) - == - parcels.Srho() - + fvOptions(psi, p, rho.name()) - ); - - pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); - - if (pimple.finalNonOrthogonalIter()) - { - phi == pEqn.flux(); - } - } -} -else -{ - surfaceScalarField phiHbyA - ( - "phiHbyA", - fvc::flux(rho*HbyA) - + MRF.zeroFilter(rhorAUf*fvc::ddtCorr(rho, U, rhoUf)) - ); - - fvc::makeRelative(phiHbyA, rho, U); - MRF.makeRelative(fvc::interpolate(rho), phiHbyA); - - // Update the pressure BCs to ensure flux consistency - constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF); - - while (pimple.correctNonOrthogonal()) - { - fvScalarMatrix pEqn - ( - fvm::ddt(psi, p) - + fvc::div(phiHbyA) - - fvm::laplacian(rhorAUf, p) - == - parcels.Srho() - + fvOptions(psi, p, rho.name()) - ); - - pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); - - if (pimple.finalNonOrthogonalIter()) - { - phi = phiHbyA + pEqn.flux(); - } - } -} - -#include "rhoEqn.H" -#include "compressibleContinuityErrs.H" - -// Explicitly relax pressure for momentum corrector -p.relax(); - -// Recalculate density from the relaxed pressure -rho = thermo.rho(); -rho = max(rho, rhoMin); -rho = min(rho, rhoMax); -rho.relax(); -Info<< "rho max/min : " << max(rho).value() - << " " << min(rho).value() << endl; - -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)); -} - -if (thermo.dpdt()) -{ - dpdt = fvc::ddt(p); - - if (mesh.moving()) - { - dpdt -= fvc::div(fvc::meshPhi(rho, U), p); - } -} diff --git a/applications/solvers/lagrangian/sprayFoam/sprayDyMFoam/sprayDyMFoam.C b/applications/solvers/lagrangian/sprayFoam/sprayDyMFoam/sprayDyMFoam.C deleted file mode 100644 index 112279e061..0000000000 --- a/applications/solvers/lagrangian/sprayFoam/sprayDyMFoam/sprayDyMFoam.C +++ /dev/null @@ -1,159 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2015-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 . - -Application - sprayDyMFoam - -Description - Transient solver for compressible, turbulent flow with a spray particle - cloud, with optional mesh motion and mesh topology changes. - -\*---------------------------------------------------------------------------*/ - -#include "fvCFD.H" -#include "dynamicFvMesh.H" -#include "turbulenceModel.H" -#include "basicSprayCloud.H" -#include "psiReactionThermo.H" -#include "CombustionModel.H" -#include "radiationModel.H" -#include "SLGThermo.H" -#include "pimpleControl.H" -#include "CorrectPhi.H" -#include "fvOptions.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -int main(int argc, char *argv[]) -{ - #include "postProcess.H" - - #include "setRootCaseLists.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 time-step/mesh for the correctPhi - 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); - - // Store the particle positions - parcels.storeGlobalPositions(); - - // 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" - } - } - } - - parcels.evolve(); - - #include "rhoEqn.H" - - // --- Pressure-velocity PIMPLE corrector loop - while (pimple.loop()) - { - #include "UEqn.H" - #include "YEqn.H" - #include "EEqn.H" - - // --- Pressure corrector loop - while (pimple.correct()) - { - #include "pEqn.H" - } - - if (pimple.turbCorr()) - { - turbulence->correct(); - } - } - - rho = thermo.rho(); - - if (runTime.write()) - { - combustion->Qdot()().write(); - } - - Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" - << " ClockTime = " << runTime.elapsedClockTime() << " s" - << nl << endl; - } - - Info<< "End\n" << endl; - - return 0; -} - - -// ************************************************************************* // diff --git a/applications/solvers/lagrangian/sprayFoam/sprayFoam.C b/applications/solvers/lagrangian/sprayFoam/sprayFoam.C index b86412870d..7dec9fab55 100644 --- a/applications/solvers/lagrangian/sprayFoam/sprayFoam.C +++ b/applications/solvers/lagrangian/sprayFoam/sprayFoam.C @@ -26,18 +26,20 @@ Application Description Transient solver for compressible, turbulent flow with a spray particle - cloud. + cloud, with optional mesh motion and mesh topology changes. \*---------------------------------------------------------------------------*/ #include "fvCFD.H" -#include "turbulentFluidThermoModel.H" +#include "dynamicFvMesh.H" +#include "turbulenceModel.H" #include "basicSprayCloud.H" #include "psiReactionThermo.H" #include "CombustionModel.H" #include "radiationModel.H" #include "SLGThermo.H" #include "pimpleControl.H" +#include "CorrectPhi.H" #include "fvOptions.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -48,14 +50,14 @@ int main(int argc, char *argv[]) #include "setRootCaseLists.H" #include "createTime.H" - #include "createMesh.H" - #include "createControl.H" - #include "createTimeControls.H" + #include "createDynamicFvMesh.H" + #include "createDyMControls.H" #include "createFields.H" #include "createFieldRefs.H" #include "compressibleCourantNo.H" #include "setInitialDeltaT.H" #include "initContinuityErrs.H" + #include "createRhoUfIfPresent.H" turbulence->validate(); @@ -65,7 +67,21 @@ int main(int argc, char *argv[]) while (runTime.run()) { - #include "readTimeControls.H" + #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 + autoPtr divrhoU; + if (correctPhi) + { + divrhoU = new volScalarField + ( + "divrhoU", + fvc::div(fvc::absolute(phi, rho, U)) + ); + } + #include "compressibleCourantNo.H" #include "setDeltaT.H" @@ -73,44 +89,68 @@ int main(int argc, char *argv[]) Info<< "Time = " << runTime.timeName() << nl << endl; - parcels.evolve(); - - if (!pimple.frozenFlow()) + // Store momentum to set rhoUf for introduced faces. + autoPtr rhoU; + if (rhoUf.valid()) { - #include "rhoEqn.H" + rhoU = new volVectorField("rhoU", rho*U); + } - // --- Pressure-velocity PIMPLE corrector loop - while (pimple.loop()) + // Store the particle positions + parcels.storeGlobalPositions(); + + // Do any mesh changes + mesh.update(); + + if (mesh.changing()) + { + MRF.update(); + + if (correctPhi) { - #include "UEqn.H" - #include "YEqn.H" - #include "EEqn.H" + // Calculate absolute flux from the mapped surface velocity + phi = mesh.Sf() & rhoUf(); - // --- Pressure corrector loop - while (pimple.correct()) - { - #include "pEqn.H" - } + #include "correctPhi.H" - if (pimple.turbCorr()) - { - turbulence->correct(); - } + // Make the fluxes relative to the mesh-motion + fvc::makeRelative(phi, rho, U); } - rho = thermo.rho(); - - if (runTime.write()) + if (checkMeshCourantNo) { - combustion->Qdot()().write(); + #include "meshCourantNo.H" } } - else + + parcels.evolve(); + + #include "rhoEqn.H" + + // --- Pressure-velocity PIMPLE corrector loop + while (pimple.loop()) { - if (runTime.writeTime()) + #include "UEqn.H" + #include "YEqn.H" + #include "EEqn.H" + + // --- Pressure corrector loop + while (pimple.correct()) { - parcels.write(); + #include "pEqn.H" } + + if (pimple.turbCorr()) + { + turbulence->correct(); + } + } + + rho = thermo.rho(); + + if (runTime.write()) + { + combustion->Qdot()().write(); } Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" From d5e27b1ed5effe8d74dac3c28788df662a064b03 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Wed, 4 Jul 2018 17:39:20 +0100 Subject: [PATCH 11/15] shallowWaterFoam: declare h0 const --- .../solvers/incompressible/shallowWaterFoam/createFields.H | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/solvers/incompressible/shallowWaterFoam/createFields.H b/applications/solvers/incompressible/shallowWaterFoam/createFields.H index 2e987664ec..e81dc5ee0a 100644 --- a/applications/solvers/incompressible/shallowWaterFoam/createFields.H +++ b/applications/solvers/incompressible/shallowWaterFoam/createFields.H @@ -15,7 +15,7 @@ volScalarField h ); Info<< "Reading field h0 if present\n" << endl; -volScalarField h0 +const volScalarField h0 ( IOobject ( From fb13414f5be6cc7da979c4b960c0dd78bb14e0b9 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Wed, 4 Jul 2018 17:39:36 +0100 Subject: [PATCH 12/15] Added bin/sprayDyMFoam link --- bin/sprayDyMFoam | 1 + 1 file changed, 1 insertion(+) create mode 120000 bin/sprayDyMFoam diff --git a/bin/sprayDyMFoam b/bin/sprayDyMFoam new file mode 120000 index 0000000000..d9fcbed5a0 --- /dev/null +++ b/bin/sprayDyMFoam @@ -0,0 +1 @@ +mergedDyM \ No newline at end of file From 0af5c9061f67b15c507073fb1c6ea85e3167fc48 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Thu, 5 Jul 2018 10:25:51 +0100 Subject: [PATCH 13/15] DPMFoam: Merged with DPMDyMFoam DPMFoam can now run with static or dynamic meshes selected in the constant/dynamicMeshDict dictionary. --- .../solvers/lagrangian/DPMFoam/Allwclean | 2 - .../solvers/lagrangian/DPMFoam/Allwmake | 2 - .../DPMFoam/DPMDyMFoam/DPMDyMFoam.C | 166 ------------------ .../DPMDyMFoam/MPPICDyMFoam/Make/files | 3 - .../DPMDyMFoam/MPPICDyMFoam/Make/options | 42 ----- .../lagrangian/DPMFoam/DPMDyMFoam/Make/files | 3 - .../DPMFoam/DPMDyMFoam/Make/options | 41 ----- .../lagrangian/DPMFoam/DPMDyMFoam/pEqn.H | 62 ------- .../solvers/lagrangian/DPMFoam/DPMFoam.C | 36 +++- .../lagrangian/DPMFoam/MPPICFoam/Make/options | 18 +- .../solvers/lagrangian/DPMFoam/Make/options | 8 +- .../DPMFoam/{DPMDyMFoam => }/correctPhic.H | 0 .../DPMFoam/{DPMDyMFoam => }/createUcf.H | 0 .../MPPICDyMFoam.C => createUcfIfPresent.H} | 34 ++-- .../solvers/lagrangian/DPMFoam/pEqn.H | 13 +- .../sprayFoam/engineFoam/Make/options | 1 - .../sprayFoam/engineFoam/engineFoam.C | 2 +- .../sprayFoam/sprayDyMFoam/Make/files | 3 - .../sprayFoam/sprayDyMFoam/Make/options | 53 ------ bin/DPMDyMFoam | 1 + bin/MPPICDyMFoam | 1 + .../compressible/createRhoUfIfPresent.H | 2 +- .../incompressible/createUfIfPresent.H | 2 +- 23 files changed, 82 insertions(+), 413 deletions(-) delete mode 100644 applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/DPMDyMFoam.C delete mode 100644 applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/MPPICDyMFoam/Make/files delete mode 100644 applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/MPPICDyMFoam/Make/options delete mode 100644 applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/Make/files delete mode 100644 applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/Make/options delete mode 100644 applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/pEqn.H rename applications/solvers/lagrangian/DPMFoam/{DPMDyMFoam => }/correctPhic.H (100%) rename applications/solvers/lagrangian/DPMFoam/{DPMDyMFoam => }/createUcf.H (100%) rename applications/solvers/lagrangian/DPMFoam/{DPMDyMFoam/MPPICDyMFoam/MPPICDyMFoam.C => createUcfIfPresent.H} (64%) delete mode 100644 applications/solvers/lagrangian/sprayFoam/sprayDyMFoam/Make/files delete mode 100644 applications/solvers/lagrangian/sprayFoam/sprayDyMFoam/Make/options create mode 120000 bin/DPMDyMFoam create mode 120000 bin/MPPICDyMFoam diff --git a/applications/solvers/lagrangian/DPMFoam/Allwclean b/applications/solvers/lagrangian/DPMFoam/Allwclean index b78c67f661..3c1cb65d84 100755 --- a/applications/solvers/lagrangian/DPMFoam/Allwclean +++ b/applications/solvers/lagrangian/DPMFoam/Allwclean @@ -5,7 +5,5 @@ wclean libso DPMTurbulenceModels wclean wclean MPPICFoam -wclean DPMDyMFoam -wclean DPMDyMFoam/MPPICDyMFoam #------------------------------------------------------------------------------ diff --git a/applications/solvers/lagrangian/DPMFoam/Allwmake b/applications/solvers/lagrangian/DPMFoam/Allwmake index e3c5370297..c43d3b37b7 100755 --- a/applications/solvers/lagrangian/DPMFoam/Allwmake +++ b/applications/solvers/lagrangian/DPMFoam/Allwmake @@ -8,7 +8,5 @@ wmake $targetType DPMTurbulenceModels wmake $targetType wmake $targetType MPPICFoam -wmake $targetType DPMDyMFoam -wmake $targetType DPMDyMFoam/MPPICDyMFoam #------------------------------------------------------------------------------ diff --git a/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/DPMDyMFoam.C b/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/DPMDyMFoam.C deleted file mode 100644 index 5822b7ca63..0000000000 --- a/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/DPMDyMFoam.C +++ /dev/null @@ -1,166 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2017-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 . - -Application - DPMDyMFoam - -Description - Transient solver for the coupled transport of a single kinematic particle - cloud including the effect of the volume fraction of particles on the - continuous phase, with optional mesh motion and mesh topology changes. - -\*---------------------------------------------------------------------------*/ - -#include "fvCFD.H" -#include "dynamicFvMesh.H" -#include "singlePhaseTransportModel.H" -#include "PhaseIncompressibleTurbulenceModel.H" -#include "pimpleControl.H" -#include "CorrectPhi.H" - -#ifdef MPPIC - #include "basicKinematicMPPICCloud.H" - #define basicKinematicTypeCloud basicKinematicMPPICCloud -#else - #include "basicKinematicCollidingCloud.H" - #define basicKinematicTypeCloud basicKinematicCollidingCloud -#endif - -int main(int argc, char *argv[]) -{ - argList::addOption - ( - "cloudName", - "name", - "specify alternative cloud name. default is 'kinematicCloud'" - ); - - #include "postProcess.H" - - #include "setRootCaseLists.H" - #include "createTime.H" - #include "createDynamicFvMesh.H" - #include "createDyMControls.H" - #include "createFields.H" - #include "createUcf.H" - #include "initContinuityErrs.H" - - Info<< "\nStarting time loop\n" << endl; - - while (runTime.run()) - { - #include "readDyMControls.H" - #include "CourantNo.H" - #include "setDeltaT.H" - - runTime++; - - Info<< "Time = " << runTime.timeName() << nl << endl; - - // Store the particle positions - kinematicCloud.storeGlobalPositions(); - - mesh.update(); - - // Calculate absolute flux from the mapped surface velocity - phic = mesh.Sf() & Ucf; - - if (mesh.changing() && correctPhi) - { - #include "correctPhic.H" - } - - // Make the flux relative to the mesh motion - fvc::makeRelative(phic, Uc); - - if (mesh.changing() && checkMeshCourantNo) - { - #include "meshCourantNo.H" - } - - continuousPhaseTransport.correct(); - muc = rhoc*continuousPhaseTransport.nu(); - - Info<< "Evolving " << kinematicCloud.name() << endl; - kinematicCloud.evolve(); - - // Update continuous phase volume fraction field - alphac = max(1.0 - kinematicCloud.theta(), alphacMin); - alphac.correctBoundaryConditions(); - alphacf = fvc::interpolate(alphac); - alphaPhic = alphacf*phic; - - fvVectorMatrix cloudSU(kinematicCloud.SU(Uc)); - volVectorField cloudVolSUSu - ( - IOobject - ( - "cloudVolSUSu", - runTime.timeName(), - mesh - ), - mesh, - dimensionedVector - ( - "0", - cloudSU.dimensions()/dimVolume, - Zero - ), - zeroGradientFvPatchVectorField::typeName - ); - - cloudVolSUSu.primitiveFieldRef() = -cloudSU.source()/mesh.V(); - cloudVolSUSu.correctBoundaryConditions(); - cloudSU.source() = Zero; - - // --- Pressure-velocity PIMPLE corrector loop - while (pimple.loop()) - { - #include "UcEqn.H" - - // --- PISO loop - while (pimple.correct()) - { - #include "pEqn.H" - } - - if (pimple.turbCorr()) - { - continuousPhaseTurbulence->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/lagrangian/DPMFoam/DPMDyMFoam/MPPICDyMFoam/Make/files b/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/MPPICDyMFoam/Make/files deleted file mode 100644 index d25393d1ff..0000000000 --- a/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/MPPICDyMFoam/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -MPPICDyMFoam.C - -EXE = $(FOAM_APPBIN)/MPPICDyMFoam diff --git a/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/MPPICDyMFoam/Make/options b/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/MPPICDyMFoam/Make/options deleted file mode 100644 index 741b07f6cf..0000000000 --- a/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/MPPICDyMFoam/Make/options +++ /dev/null @@ -1,42 +0,0 @@ -EXE_INC = \ - -I.. \ - -I../.. \ - -I../../DPMTurbulenceModels/lnInclude \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/lagrangian/basic/lnInclude \ - -I$(LIB_SRC)/lagrangian/intermediate/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ - -I$(LIB_SRC)/transportModels/compressible/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ - -I$(LIB_SRC)/transportModels \ - -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \ - -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ - -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \ - -I$(LIB_SRC)/TurbulenceModels/phaseIncompressible/lnInclude \ - -I$(LIB_SRC)/regionModels/regionModel/lnInclude \ - -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \ - -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ - -I$(LIB_SRC)/dynamicMesh/lnInclude - -EXE_LIBS = \ - -lfiniteVolume \ - -lfvOptions \ - -lmeshTools \ - -llagrangian \ - -llagrangianIntermediate \ - -llagrangianTurbulence \ - -lspecie \ - -lradiationModels \ - -lincompressibleTransportModels \ - -lturbulenceModels \ - -lincompressibleTurbulenceModels \ - -lDPMTurbulenceModels \ - -lregionModels \ - -lsurfaceFilmModels \ - -lsampling \ - -ldynamicFvMesh \ - -ltopoChangerFvMesh \ - -ldynamicMesh diff --git a/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/Make/files b/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/Make/files deleted file mode 100644 index c3354998ef..0000000000 --- a/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -DPMDyMFoam.C - -EXE = $(FOAM_APPBIN)/DPMDyMFoam diff --git a/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/Make/options b/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/Make/options deleted file mode 100644 index a4c0fcc139..0000000000 --- a/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/Make/options +++ /dev/null @@ -1,41 +0,0 @@ -EXE_INC = \ - -I.. \ - -I../DPMTurbulenceModels/lnInclude \ - -I$(LIB_SRC)/lagrangian/basic/lnInclude \ - -I$(LIB_SRC)/lagrangian/intermediate/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ - -I$(LIB_SRC)/transportModels/compressible/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ - -I$(LIB_SRC)/transportModels \ - -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \ - -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ - -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \ - -I$(LIB_SRC)/TurbulenceModels/phaseIncompressible/lnInclude \ - -I$(LIB_SRC)/regionModels/regionModel/lnInclude \ - -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ - -I$(LIB_SRC)/dynamicMesh/lnInclude - -EXE_LIBS = \ - -llagrangian \ - -llagrangianIntermediate \ - -llagrangianTurbulence \ - -lspecie \ - -lradiationModels \ - -lincompressibleTransportModels \ - -lturbulenceModels \ - -lincompressibleTurbulenceModels \ - -lDPMTurbulenceModels \ - -lregionModels \ - -lsurfaceFilmModels \ - -lsampling \ - -lfiniteVolume \ - -lfvOptions \ - -lmeshTools \ - -ldynamicFvMesh \ - -ltopoChangerFvMesh \ - -ldynamicMesh diff --git a/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/pEqn.H b/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/pEqn.H deleted file mode 100644 index dd4d382bef..0000000000 --- a/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/pEqn.H +++ /dev/null @@ -1,62 +0,0 @@ -{ - volVectorField HbyA(constrainHbyA(rAUc*UcEqn.H(), Uc, p)); - - surfaceScalarField phiHbyA - ( - "phiHbyA", - ( - fvc::flux(HbyA) - + alphacf*rAUcf*fvc::ddtCorr(Uc, Ucf) - ) - ); - - if (p.needReference()) - { - fvc::makeRelative(phiHbyA, Uc); - adjustPhi(phiHbyA, Uc, p); - fvc::makeAbsolute(phiHbyA, Uc); - } - - phiHbyA += phicForces; - - // Update the pressure BCs to ensure flux consistency - constrainPressure(p, Uc, phiHbyA, rAUcf); - - // Non-orthogonal pressure corrector loop - while (pimple.correctNonOrthogonal()) - { - fvScalarMatrix pEqn - ( - fvm::laplacian(alphacf*rAUcf, p) - == - fvc::ddt(alphac) + fvc::div(alphacf*phiHbyA) - ); - - pEqn.setReference(pRefCell, pRefValue); - - pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); - - if (pimple.finalNonOrthogonalIter()) - { - phic = phiHbyA - pEqn.flux()/alphacf; - - p.relax(); - - Uc = HbyA - + rAUc - *fvc::reconstruct((phicForces - pEqn.flux()/alphacf)/rAUcf); - Uc.correctBoundaryConditions(); - - { - Ucf = fvc::interpolate(Uc); - surfaceVectorField n(mesh.Sf()/mesh.magSf()); - Ucf += n*(phic/mesh.magSf() - (n & Ucf)); - } - - // Make the fluxes relative to the mesh motion - fvc::makeRelative(phic, Uc); - } - } -} - -#include "continuityErrs.H" diff --git a/applications/solvers/lagrangian/DPMFoam/DPMFoam.C b/applications/solvers/lagrangian/DPMFoam/DPMFoam.C index 919c671a05..71e59b3350 100644 --- a/applications/solvers/lagrangian/DPMFoam/DPMFoam.C +++ b/applications/solvers/lagrangian/DPMFoam/DPMFoam.C @@ -27,14 +27,16 @@ Application Description Transient solver for the coupled transport of a single kinematic particle cloud including the effect of the volume fraction of particles on the - continuous phase. + continuous phase, with optional mesh motion and mesh topology changes. \*---------------------------------------------------------------------------*/ #include "fvCFD.H" +#include "dynamicFvMesh.H" #include "singlePhaseTransportModel.H" #include "PhaseIncompressibleTurbulenceModel.H" #include "pimpleControl.H" +#include "CorrectPhi.H" #ifdef MPPIC #include "basicKinematicMPPICCloud.H" @@ -57,17 +59,17 @@ int main(int argc, char *argv[]) #include "setRootCaseLists.H" #include "createTime.H" - #include "createMesh.H" - #include "createControl.H" - #include "createTimeControls.H" + #include "createDynamicFvMesh.H" + #include "createDyMControls.H" #include "createFields.H" + #include "createUcfIfPresent.H" #include "initContinuityErrs.H" Info<< "\nStarting time loop\n" << endl; while (runTime.run()) { - #include "readTimeControls.H" + #include "readDyMControls.H" #include "CourantNo.H" #include "setDeltaT.H" @@ -75,6 +77,30 @@ int main(int argc, char *argv[]) Info<< "Time = " << runTime.timeName() << nl << endl; + // Store the particle positions + kinematicCloud.storeGlobalPositions(); + + mesh.update(); + + if (mesh.changing()) + { + if (correctPhi) + { + // Calculate absolute flux from the mapped surface velocity + phic = mesh.Sf() & Ucf(); + + #include "correctPhic.H" + + // Make the flux relative to the mesh motion + fvc::makeRelative(phic, Uc); + } + + if (checkMeshCourantNo) + { + #include "meshCourantNo.H" + } + } + continuousPhaseTransport.correct(); muc = rhoc*continuousPhaseTransport.nu(); diff --git a/applications/solvers/lagrangian/DPMFoam/MPPICFoam/Make/options b/applications/solvers/lagrangian/DPMFoam/MPPICFoam/Make/options index b0eaf6453e..74f9041da0 100644 --- a/applications/solvers/lagrangian/DPMFoam/MPPICFoam/Make/options +++ b/applications/solvers/lagrangian/DPMFoam/MPPICFoam/Make/options @@ -1,8 +1,6 @@ EXE_INC = \ -I.. \ -I../DPMTurbulenceModels/lnInclude \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \ -I$(LIB_SRC)/lagrangian/intermediate/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ @@ -17,20 +15,20 @@ EXE_INC = \ -I$(LIB_SRC)/TurbulenceModels/phaseIncompressible/lnInclude \ -I$(LIB_SRC)/regionModels/regionModel/lnInclude \ -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude EXE_LIBS = \ - -lfiniteVolume \ - -lfvOptions \ - -lmeshTools \ -llagrangian \ -llagrangianIntermediate \ -llagrangianTurbulence \ - -lspecie \ - -lradiationModels \ -lincompressibleTransportModels \ -lturbulenceModels \ -lincompressibleTurbulenceModels \ -lDPMTurbulenceModels \ - -lregionModels \ - -lsurfaceFilmModels \ - -lsampling + -lfiniteVolume \ + -ldynamicFvMesh \ + -ltopoChangerFvMesh \ + -lfvOptions \ + -lmeshTools diff --git a/applications/solvers/lagrangian/DPMFoam/Make/options b/applications/solvers/lagrangian/DPMFoam/Make/options index b1f295e294..67374724f9 100644 --- a/applications/solvers/lagrangian/DPMFoam/Make/options +++ b/applications/solvers/lagrangian/DPMFoam/Make/options @@ -15,21 +15,19 @@ EXE_INC = \ -I$(LIB_SRC)/regionModels/regionModel/lnInclude \ -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude EXE_LIBS = \ -llagrangian \ -llagrangianIntermediate \ -llagrangianTurbulence \ - -lspecie \ - -lradiationModels \ -lincompressibleTransportModels \ -lturbulenceModels \ -lincompressibleTurbulenceModels \ -lDPMTurbulenceModels \ - -lregionModels \ - -lsurfaceFilmModels \ - -lsampling \ -lfiniteVolume \ + -ldynamicFvMesh \ + -ltopoChangerFvMesh \ -lfvOptions \ -lmeshTools diff --git a/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/correctPhic.H b/applications/solvers/lagrangian/DPMFoam/correctPhic.H similarity index 100% rename from applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/correctPhic.H rename to applications/solvers/lagrangian/DPMFoam/correctPhic.H diff --git a/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/createUcf.H b/applications/solvers/lagrangian/DPMFoam/createUcf.H similarity index 100% rename from applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/createUcf.H rename to applications/solvers/lagrangian/DPMFoam/createUcf.H diff --git a/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/MPPICDyMFoam/MPPICDyMFoam.C b/applications/solvers/lagrangian/DPMFoam/createUcfIfPresent.H similarity index 64% rename from applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/MPPICDyMFoam/MPPICDyMFoam.C rename to applications/solvers/lagrangian/DPMFoam/createUcfIfPresent.H index ba5dc1bc85..38bcf6a635 100644 --- a/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/MPPICDyMFoam/MPPICDyMFoam.C +++ b/applications/solvers/lagrangian/DPMFoam/createUcfIfPresent.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2017 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -21,21 +21,35 @@ License You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . -Application - MPPICDyMFoam +Global + createUcfIfPresent Description - Transient solver for the coupled transport of a single kinematic particle - cloud including the effect of the volume fraction of particles on the - continuous phase. Multi-Phase Particle In Cell (MPPIC) modeling is used to - represent collisions without resolving particle-particle interactions, - with optional mesh motion and mesh topology changes. + Creates and initialises the continuous phase face velocity field Ufc + if required. \*---------------------------------------------------------------------------*/ -#define MPPIC +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "DPMDyMFoam.C" +autoPtr Ucf; +if (mesh.dynamic()) +{ + Info<< "Constructing continuous phase face velocity Ucf\n" << endl; + + Ucf = new surfaceVectorField + ( + IOobject + ( + "Ucf", + runTime.timeName(), + mesh, + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + fvc::interpolate(Uc) + ); +} // ************************************************************************* // diff --git a/applications/solvers/lagrangian/DPMFoam/pEqn.H b/applications/solvers/lagrangian/DPMFoam/pEqn.H index ea0bd1c101..81efb9b9ff 100644 --- a/applications/solvers/lagrangian/DPMFoam/pEqn.H +++ b/applications/solvers/lagrangian/DPMFoam/pEqn.H @@ -6,13 +6,15 @@ "phiHbyA", ( fvc::flux(HbyA) - + alphacf*rAUcf*fvc::ddtCorr(Uc, phic) + + alphacf*rAUcf*fvc::ddtCorr(Uc, phic, Ucf) ) ); if (p.needReference()) { + fvc::makeRelative(phiHbyA, Uc); adjustPhi(phiHbyA, Uc, p); + fvc::makeAbsolute(phiHbyA, Uc); } phiHbyA += phicForces; @@ -41,8 +43,15 @@ p.relax(); Uc = HbyA - + rAUc*fvc::reconstruct((phicForces - pEqn.flux()/alphacf)/rAUcf); + + rAUc + *fvc::reconstruct((phicForces - pEqn.flux()/alphacf)/rAUcf); Uc.correctBoundaryConditions(); + + // Correct Ucf if the mesh is moving + fvc::correctUf(Ucf, Uc, phic); + + // Make the fluxes relative to the mesh motion + fvc::makeRelative(phic, Uc); } } } diff --git a/applications/solvers/lagrangian/sprayFoam/engineFoam/Make/options b/applications/solvers/lagrangian/sprayFoam/engineFoam/Make/options index 4dc1ac0367..f4506588f7 100644 --- a/applications/solvers/lagrangian/sprayFoam/engineFoam/Make/options +++ b/applications/solvers/lagrangian/sprayFoam/engineFoam/Make/options @@ -1,6 +1,5 @@ EXE_INC = \ -I. \ - -I../sprayDyMFoam \ -I.. \ -I../../reactingParcelFoam \ -I$(LIB_SRC)/finiteVolume/lnInclude \ diff --git a/applications/solvers/lagrangian/sprayFoam/engineFoam/engineFoam.C b/applications/solvers/lagrangian/sprayFoam/engineFoam/engineFoam.C index e17eb9b21f..1e6896c6de 100644 --- a/applications/solvers/lagrangian/sprayFoam/engineFoam/engineFoam.C +++ b/applications/solvers/lagrangian/sprayFoam/engineFoam/engineFoam.C @@ -57,10 +57,10 @@ int main(int argc, char *argv[]) #include "readEngineTimeControls.H" #include "createFields.H" #include "createFieldRefs.H" - #include "createRhoUf.H" #include "compressibleCourantNo.H" #include "setInitialDeltaT.H" #include "initContinuityErrs.H" + #include "createRhoUfIfPresent.H" #include "startSummary.H" turbulence->validate(); diff --git a/applications/solvers/lagrangian/sprayFoam/sprayDyMFoam/Make/files b/applications/solvers/lagrangian/sprayFoam/sprayDyMFoam/Make/files deleted file mode 100644 index b8c30b71e9..0000000000 --- a/applications/solvers/lagrangian/sprayFoam/sprayDyMFoam/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -sprayDyMFoam.C - -EXE = $(FOAM_APPBIN)/sprayDyMFoam diff --git a/applications/solvers/lagrangian/sprayFoam/sprayDyMFoam/Make/options b/applications/solvers/lagrangian/sprayFoam/sprayDyMFoam/Make/options deleted file mode 100644 index 4a32bfe0c5..0000000000 --- a/applications/solvers/lagrangian/sprayFoam/sprayDyMFoam/Make/options +++ /dev/null @@ -1,53 +0,0 @@ -EXE_INC = \ - -I.. \ - -I../../reactingParcelFoam \ - -I../../../compressible/rhoPimpleFoam \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/sampling/lnInclude \ - -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ - -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ - -I$(LIB_SRC)/lagrangian/basic/lnInclude \ - -I$(LIB_SRC)/lagrangian/intermediate/lnInclude \ - -I$(LIB_SRC)/lagrangian/spray/lnInclude \ - -I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ - -I$(LIB_SRC)/transportModels/compressible/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ - -I$(LIB_SRC)/ODE/lnInclude \ - -I$(LIB_SRC)/regionModels/regionModel/lnInclude \ - -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \ - -I$(LIB_SRC)/combustionModels/lnInclude \ - -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude - -EXE_LIBS = \ - -lturbulenceModels \ - -lcompressibleTurbulenceModels \ - -llagrangian \ - -llagrangianIntermediate \ - -llagrangianTurbulence \ - -llagrangianSpray \ - -lspecie \ - -lcompressibleTransportModels \ - -lfluidThermophysicalModels \ - -lthermophysicalProperties \ - -lreactionThermophysicalModels \ - -lSLGThermo \ - -lchemistryModel \ - -lradiationModels \ - -lODE \ - -lregionModels \ - -lsurfaceFilmModels \ - -lcombustionModels \ - -lfiniteVolume \ - -ldynamicFvMesh \ - -ltopoChangerFvMesh \ - -lfvOptions \ - -ldynamicMesh \ - -lmeshTools diff --git a/bin/DPMDyMFoam b/bin/DPMDyMFoam new file mode 120000 index 0000000000..d9fcbed5a0 --- /dev/null +++ b/bin/DPMDyMFoam @@ -0,0 +1 @@ +mergedDyM \ No newline at end of file diff --git a/bin/MPPICDyMFoam b/bin/MPPICDyMFoam new file mode 120000 index 0000000000..d9fcbed5a0 --- /dev/null +++ b/bin/MPPICDyMFoam @@ -0,0 +1 @@ +mergedDyM \ No newline at end of file diff --git a/src/finiteVolume/cfdTools/compressible/createRhoUfIfPresent.H b/src/finiteVolume/cfdTools/compressible/createRhoUfIfPresent.H index 38445c3e22..2968ffe1ef 100644 --- a/src/finiteVolume/cfdTools/compressible/createRhoUfIfPresent.H +++ b/src/finiteVolume/cfdTools/compressible/createRhoUfIfPresent.H @@ -22,7 +22,7 @@ License along with OpenFOAM. If not, see . Global - createRhoUf + createRhoUfIfPresent Description Creates and initialises the velocity field rhoUf if required. diff --git a/src/finiteVolume/cfdTools/incompressible/createUfIfPresent.H b/src/finiteVolume/cfdTools/incompressible/createUfIfPresent.H index e19515ec8a..907dae8596 100644 --- a/src/finiteVolume/cfdTools/incompressible/createUfIfPresent.H +++ b/src/finiteVolume/cfdTools/incompressible/createUfIfPresent.H @@ -22,7 +22,7 @@ License along with OpenFOAM. If not, see . Global - createUf + createUfIfPresent Description Creates and initialises the velocity field Uf if required. From ae765688961295ac6b129a75c553296856964577 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Thu, 5 Jul 2018 21:07:38 +0100 Subject: [PATCH 14/15] rhoReactingFoam: Added moving and changing mesh functionality Re-based on the latest rhoPimpleFoam which includes moving and changing mesh functionality. --- .../reactingFoam/rhoReactingFoam/Make/options | 31 +++++---- .../rhoReactingFoam/rhoReactingFoam.C | 64 +++++++++++++++++-- .../compressible/rhoPimpleFoam/Make/options | 10 ++- .../rhoPimpleFoam/rhoPimpleFoam.C | 1 - 4 files changed, 79 insertions(+), 27 deletions(-) diff --git a/applications/solvers/combustion/reactingFoam/rhoReactingFoam/Make/options b/applications/solvers/combustion/reactingFoam/rhoReactingFoam/Make/options index b403a0268e..45c9d929fa 100644 --- a/applications/solvers/combustion/reactingFoam/rhoReactingFoam/Make/options +++ b/applications/solvers/combustion/reactingFoam/rhoReactingFoam/Make/options @@ -1,9 +1,6 @@ EXE_INC = \ -I. \ -I$(FOAM_SOLVERS)/combustion/reactingFoam \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/sampling/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ @@ -12,20 +9,26 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \ -I$(LIB_SRC)/ODE/lnInclude \ - -I$(LIB_SRC)/combustionModels/lnInclude - + -I$(LIB_SRC)/combustionModels/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/finiteVolume/cfdTools \ + -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/sampling/lnInclude \ + -I$(LIB_SRC)/dynamicFvMesh/lnInclude EXE_LIBS = \ - -lfiniteVolume \ - -lfvOptions \ - -lmeshTools \ - -lsampling \ - -lturbulenceModels \ - -lcompressibleTurbulenceModels \ - -lreactionThermophysicalModels \ - -lspecie \ -lcompressibleTransportModels \ -lfluidThermophysicalModels \ + -lspecie \ -lchemistryModel \ -lODE \ - -lcombustionModels + -lcombustionModels \ + -lreactionThermophysicalModels \ + -lturbulenceModels \ + -lcompressibleTurbulenceModels \ + -lfiniteVolume \ + -ldynamicFvMesh \ + -ltopoChangerFvMesh \ + -lmeshTools \ + -lsampling \ + -lfvOptions diff --git a/applications/solvers/combustion/reactingFoam/rhoReactingFoam/rhoReactingFoam.C b/applications/solvers/combustion/reactingFoam/rhoReactingFoam/rhoReactingFoam.C index 73939f9102..39a8ee5b75 100644 --- a/applications/solvers/combustion/reactingFoam/rhoReactingFoam/rhoReactingFoam.C +++ b/applications/solvers/combustion/reactingFoam/rhoReactingFoam/rhoReactingFoam.C @@ -31,12 +31,14 @@ Description \*---------------------------------------------------------------------------*/ #include "fvCFD.H" +#include "dynamicFvMesh.H" #include "rhoReactionThermo.H" #include "CombustionModel.H" #include "turbulentFluidThermoModel.H" #include "multivariateScheme.H" #include "pimpleControl.H" #include "pressureControl.H" +#include "CorrectPhi.H" #include "fvOptions.H" #include "localEulerDdtScheme.H" #include "fvcSmooth.H" @@ -49,13 +51,12 @@ int main(int argc, char *argv[]) #include "setRootCaseLists.H" #include "createTime.H" - #include "createMesh.H" - #include "createControl.H" + #include "createDynamicFvMesh.H" + #include "createDyMControls.H" #include "initContinuityErrs.H" #include "createFields.H" #include "createFieldRefs.H" #include "createRhoUfIfPresent.H" - #include "createTimeControls.H" turbulence->validate(); @@ -71,7 +72,20 @@ int main(int argc, char *argv[]) while (runTime.run()) { - #include "readTimeControls.H" + #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 + autoPtr divrhoU; + if (correctPhi) + { + divrhoU = new volScalarField + ( + "divrhoU", + fvc::div(fvc::absolute(phi, rho, U)) + ); + } if (LTS) { @@ -87,11 +101,49 @@ int main(int argc, char *argv[]) Info<< "Time = " << runTime.timeName() << nl << endl; - #include "rhoEqn.H" - // --- Pressure-velocity PIMPLE corrector loop while (pimple.loop()) { + if (pimple.firstIter() || moveMeshOuterCorrectors) + { + // Store momentum to set rhoUf for introduced faces. + autoPtr rhoU; + if (rhoUf.valid()) + { + rhoU = new volVectorField("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 "../../../compressible/rhoPimpleFoam/correctPhi.H" + + // Make the fluxes relative to the mesh-motion + fvc::makeRelative(phi, rho, U); + } + + if (checkMeshCourantNo) + { + #include "meshCourantNo.H" + } + } + } + + if (pimple.firstIter() && !pimple.simpleRho()) + { + #include "rhoEqn.H" + } + #include "UEqn.H" #include "YEqn.H" #include "EEqn.H" diff --git a/applications/solvers/compressible/rhoPimpleFoam/Make/options b/applications/solvers/compressible/rhoPimpleFoam/Make/options index c3f820e3be..94658ff20f 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/Make/options +++ b/applications/solvers/compressible/rhoPimpleFoam/Make/options @@ -7,8 +7,7 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/sampling/lnInclude \ - -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ - -I$(LIB_SRC)/dynamicMesh/lnInclude + -I$(LIB_SRC)/dynamicFvMesh/lnInclude EXE_LIBS = \ -lcompressibleTransportModels \ @@ -17,9 +16,8 @@ EXE_LIBS = \ -lturbulenceModels \ -lcompressibleTurbulenceModels \ -lfiniteVolume \ - -lmeshTools \ - -lsampling \ - -lfvOptions \ -ldynamicFvMesh \ -ltopoChangerFvMesh \ - -ldynamicMesh + -lmeshTools \ + -lsampling \ + -lfvOptions diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C index f438e6799e..3c24d39879 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C @@ -37,7 +37,6 @@ Description #include "dynamicFvMesh.H" #include "fluidThermo.H" #include "turbulentFluidThermoModel.H" -#include "bound.H" #include "pimpleControl.H" #include "pressureControl.H" #include "CorrectPhi.H" From 68f948688427394e1128f45fc90fd2ebf1b71221 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Tue, 10 Jul 2018 21:28:08 +0100 Subject: [PATCH 15/15] tutorials/compressible/rhoPimpleFoam/laminar/decompressionTank: Updated headers --- .../laminar/decompressionTank/decompressionTank/0/T | 10 +++++----- .../constant/thermophysicalProperties | 10 +++++----- .../decompressionTank/constant/turbulenceProperties | 10 +++++----- .../decompressionTank/system/fvSchemes | 10 +++++----- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/tutorials/compressible/rhoPimpleFoam/laminar/decompressionTank/decompressionTank/0/T b/tutorials/compressible/rhoPimpleFoam/laminar/decompressionTank/decompressionTank/0/T index a3e0a8746b..d0bc5d1c88 100644 --- a/tutorials/compressible/rhoPimpleFoam/laminar/decompressionTank/decompressionTank/0/T +++ b/tutorials/compressible/rhoPimpleFoam/laminar/decompressionTank/decompressionTank/0/T @@ -1,9 +1,9 @@ /*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { diff --git a/tutorials/compressible/rhoPimpleFoam/laminar/decompressionTank/decompressionTank/constant/thermophysicalProperties b/tutorials/compressible/rhoPimpleFoam/laminar/decompressionTank/decompressionTank/constant/thermophysicalProperties index 8ec23fd2d6..a096d6945b 100644 --- a/tutorials/compressible/rhoPimpleFoam/laminar/decompressionTank/decompressionTank/constant/thermophysicalProperties +++ b/tutorials/compressible/rhoPimpleFoam/laminar/decompressionTank/decompressionTank/constant/thermophysicalProperties @@ -1,9 +1,9 @@ /*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { diff --git a/tutorials/compressible/rhoPimpleFoam/laminar/decompressionTank/decompressionTank/constant/turbulenceProperties b/tutorials/compressible/rhoPimpleFoam/laminar/decompressionTank/decompressionTank/constant/turbulenceProperties index aefe0c27d7..46b3810858 100644 --- a/tutorials/compressible/rhoPimpleFoam/laminar/decompressionTank/decompressionTank/constant/turbulenceProperties +++ b/tutorials/compressible/rhoPimpleFoam/laminar/decompressionTank/decompressionTank/constant/turbulenceProperties @@ -1,9 +1,9 @@ /*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { diff --git a/tutorials/compressible/rhoPimpleFoam/laminar/decompressionTank/decompressionTank/system/fvSchemes b/tutorials/compressible/rhoPimpleFoam/laminar/decompressionTank/decompressionTank/system/fvSchemes index 89f900b561..d1d604d3af 100644 --- a/tutorials/compressible/rhoPimpleFoam/laminar/decompressionTank/decompressionTank/system/fvSchemes +++ b/tutorials/compressible/rhoPimpleFoam/laminar/decompressionTank/decompressionTank/system/fvSchemes @@ -1,9 +1,9 @@ /*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile {