diff --git a/applications/solvers/multiphase/compressibleInterFoam/Allwmake b/applications/solvers/multiphase/compressibleInterFoam/Allwmake index dfd9db7d52..89be748128 100755 --- a/applications/solvers/multiphase/compressibleInterFoam/Allwmake +++ b/applications/solvers/multiphase/compressibleInterFoam/Allwmake @@ -10,5 +10,6 @@ wmake $targetType surfaceTensionModels wmake $targetType wmake $targetType compressibleInterDyMFoam wmake $targetType compressibleInterFilmFoam +compressibleInterPhaseTransportFoam/Allwmake $targetType $* #------------------------------------------------------------------------------ diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/Allwclean b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/Allwclean new file mode 100755 index 0000000000..1a0905bd5f --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/Allwclean @@ -0,0 +1,7 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory + +wclean libso VoFphaseCompressibleTurbulenceModels +wclean + +#------------------------------------------------------------------------------ diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/Allwmake b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/Allwmake new file mode 100755 index 0000000000..cc23fb0ef9 --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/Allwmake @@ -0,0 +1,10 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory + +# Parse arguments for library compilation +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments + +wmake $targetType VoFphaseCompressibleTurbulenceModels +wmake $targetType + +#------------------------------------------------------------------------------ diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/Make/files b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/Make/files new file mode 100644 index 0000000000..0b8f6c19f0 --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/Make/files @@ -0,0 +1,3 @@ +compressibleInterPhaseTransportFoam.C + +EXE = $(FOAM_APPBIN)/compressibleInterPhaseTransportFoam diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/Make/options b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/Make/options new file mode 100644 index 0000000000..765d6c5768 --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/Make/options @@ -0,0 +1,31 @@ +EXE_INC = \ + -I. \ + -I$(FOAM_SOLVERS)/multiphase/VoF \ + -I$(FOAM_SOLVERS)/multiphase/compressibleInterFoam/twoPhaseMixtureThermo \ + -I$(FOAM_SOLVERS)/multiphase/compressibleInterFoam \ + -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 \ + -IVoFphaseCompressibleTurbulenceModels/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude + +EXE_LIBS = \ + -ltwoPhaseMixtureThermo \ + -ltwoPhaseSurfaceTension \ + -lcompressibleTransportModels \ + -lfluidThermophysicalModels \ + -lspecie \ + -ltwoPhaseMixture \ + -ltwoPhaseProperties \ + -linterfaceProperties \ + -lturbulenceModels \ + -lcompressibleTurbulenceModels \ + -lVoFphaseCompressibleTurbulenceModels \ + -lfiniteVolume \ + -lfvOptions \ + -lmeshTools diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/TEqn.H b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/TEqn.H new file mode 100644 index 0000000000..8f64a90584 --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/TEqn.H @@ -0,0 +1,37 @@ +{ + fvScalarMatrix TEqn + ( + fvm::ddt(rho, T) + fvm::div(rhoPhi, T) + - fvm::Sp(contErr, T) + - fvm::laplacian + ( + mixture.alphaEff + ( + alpha1*turbulence1->mut() + + alpha2*turbulence2->mut() + ), + T + ) + + ( + fvc::div(fvc::absolute(phi, U), p) + + fvc::ddt(rho, K) + fvc::div(rhoPhi, K) + ) + *( + alpha1/mixture.thermo1().Cv() + + alpha2/mixture.thermo2().Cv() + ) + == + fvOptions(rho, T) + ); + + TEqn.relax(); + + fvOptions.constrain(TEqn); + + TEqn.solve(); + + fvOptions.correct(T); + + mixture.correctThermo(); + mixture.correct(); +} diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/UEqn.H b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/UEqn.H new file mode 100644 index 0000000000..15f39cf523 --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/UEqn.H @@ -0,0 +1,35 @@ + fvVectorMatrix UEqn + ( + fvm::ddt(rho, U) + fvm::div(rhoPhi, U) + - fvm::Sp(contErr, U) + + MRF.DDt(rho, U) + + turbulence1->divDevRhoReff(U) + + turbulence2->divDevRhoReff(U) + == + fvOptions(rho, U) + ); + + UEqn.relax(); + + fvOptions.constrain(UEqn); + + if (pimple.momentumPredictor()) + { + solve + ( + UEqn + == + fvc::reconstruct + ( + ( + mixture.surfaceTensionForce() + - ghf*fvc::snGrad(rho) + - fvc::snGrad(p_rgh) + ) * mesh.magSf() + ) + ); + + fvOptions.correct(U); + + K = 0.5*magSqr(U); + } diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/Make/files b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/Make/files new file mode 100644 index 0000000000..7442bf38ad --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/Make/files @@ -0,0 +1,3 @@ +VoFphaseCompressibleTurbulenceModels.C + +LIB = $(FOAM_LIBBIN)/libVoFphaseCompressibleTurbulenceModels diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/Make/options b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/Make/options new file mode 100644 index 0000000000..df993c9ba1 --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/Make/options @@ -0,0 +1,20 @@ +EXE_INC = \ + -I$(LIB_SRC)/transportModels/compressible/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/transportModels/incompressible/transportModel \ + -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/phaseCompressible/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude + +LIB_LIBS = \ + -lcompressibleTransportModels \ + -lfluidThermophysicalModels \ + -lspecie \ + -lturbulenceModels \ + -lcompressibleTurbulenceModels \ + -lincompressibleTransportModels \ + -lfiniteVolume \ + -lfvOptions \ + -lmeshTools diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/VoFphaseCompressibleTurbulenceModel.H b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/VoFphaseCompressibleTurbulenceModel.H new file mode 100644 index 0000000000..0f0aebf7f6 --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/VoFphaseCompressibleTurbulenceModel.H @@ -0,0 +1,52 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 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 . + +Typedef + Foam::VoFphaseCompressibleTurbulenceModel + +Description + Typedef for VoFphaseCompressibleTurbulenceModel + +\*---------------------------------------------------------------------------*/ + +#ifndef VoFphaseCompressibleTurbulenceModel_H +#define VoFphaseCompressibleTurbulenceModel_H + +#include "VoFphaseCompressibleTurbulenceModelFwd.H" +#include "PhaseCompressibleTurbulenceModel.H" +#include "ThermalDiffusivity.H" +#include "fluidThermo.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + typedef ThermalDiffusivity> + VoFphaseCompressibleTurbulenceModel; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/VoFphaseCompressibleTurbulenceModelFwd.H b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/VoFphaseCompressibleTurbulenceModelFwd.H new file mode 100644 index 0000000000..f2b88268fa --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/VoFphaseCompressibleTurbulenceModelFwd.H @@ -0,0 +1,55 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 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 . + +Typedef + Foam::VoFphaseCompressibleTurbulenceModel + +Description + Forward declaration of typedef for VoFphaseCompressibleTurbulenceModel + +\*---------------------------------------------------------------------------*/ + +#ifndef VoFphaseCompressibleTurbulenceModelFwd_H +#define VoFphaseCompressibleTurbulenceModelFwd_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + class fluidThermo; + + template + class PhaseCompressibleTurbulenceModel; + + template + class ThermalDiffusivity; + + typedef ThermalDiffusivity> + VoFphaseCompressibleTurbulenceModel; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/VoFphaseCompressibleTurbulenceModels.C b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/VoFphaseCompressibleTurbulenceModels.C new file mode 100644 index 0000000000..bdee8e066f --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/VoFphaseCompressibleTurbulenceModels.C @@ -0,0 +1,90 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 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 . + +\*---------------------------------------------------------------------------*/ + +#include "PhaseCompressibleTurbulenceModel.H" +#include "fluidThermo.H" +#include "addToRunTimeSelectionTable.H" +#include "makeTurbulenceModel.H" + +#include "ThermalDiffusivity.H" +#include "EddyDiffusivity.H" + +#include "laminarModel.H" +#include "RASModel.H" +#include "LESModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makeTurbulenceModelTypes +( + volScalarField, + volScalarField, + compressibleTurbulenceModel, + PhaseCompressibleTurbulenceModel, + ThermalDiffusivity, + fluidThermo +); + +makeBaseTurbulenceModel +( + volScalarField, + volScalarField, + compressibleTurbulenceModel, + PhaseCompressibleTurbulenceModel, + ThermalDiffusivity, + fluidThermo +); + +#define makeLaminarModel(Type) \ + makeTemplatedLaminarModel \ + (fluidThermoPhaseCompressibleTurbulenceModel, laminar, Type) + +#define makeRASModel(Type) \ + makeTemplatedTurbulenceModel \ + (fluidThermoPhaseCompressibleTurbulenceModel, RAS, Type) + +#define makeLESModel(Type) \ + makeTemplatedTurbulenceModel \ + (fluidThermoPhaseCompressibleTurbulenceModel, LES, Type) + +#include "Stokes.H" +makeLaminarModel(Stokes); + +#include "Maxwell.H" +makeLaminarModel(Maxwell); + +#include "kEpsilon.H" +makeRASModel(kEpsilon); + +#include "kOmegaSST.H" +makeRASModel(kOmegaSST); + +#include "Smagorinsky.H" +makeLESModel(Smagorinsky); + +#include "kEqn.H" +makeLESModel(kEqn); + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/compressibleInterPhaseTransportFoam.C b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/compressibleInterPhaseTransportFoam.C new file mode 100644 index 0000000000..81d03d31e5 --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/compressibleInterPhaseTransportFoam.C @@ -0,0 +1,180 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 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 + compressibleInterPhaseTransportFoam + +Description + Solver for 2 compressible, non-isothermal immiscible fluids using a VOF + (volume of fluid) phase-fraction based interface capturing approach. + + The momentum and other fluid properties are of the "mixture" and a single + momentum equation is solved. + + The fluid stress modelling is generic Euler-Euler two-phase in which + separate laminar, RAS or LES are selected for each of the phases. + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "CMULES.H" +#include "EulerDdtScheme.H" +#include "localEulerDdtScheme.H" +#include "CrankNicolsonDdtScheme.H" +#include "subCycle.H" +#include "rhoThermo.H" +#include "twoPhaseMixture.H" +#include "twoPhaseMixtureThermo.H" +#include "turbulentFluidThermoModel.H" +#include "pimpleControl.H" +#include "fvOptions.H" +#include "fvcSmooth.H" +#include "VoFphaseCompressibleTurbulenceModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + #include "postProcess.H" + + #include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + #include "createControl.H" + #include "createTimeControls.H" + #include "createFields.H" + #include "createAlphaFluxes.H" + + volScalarField& p = mixture.p(); + volScalarField& T = mixture.T(); + const volScalarField& psi1 = mixture.thermo1().psi(); + const volScalarField& psi2 = mixture.thermo2().psi(); + + + surfaceScalarField alphaRhoPhi1 + ( + IOobject::groupName("alphaRhoPhi", alpha1.group()), + fvc::interpolate(rho1)*alphaPhi10 + ); + + autoPtr> turbulence1 + ( + PhaseCompressibleTurbulenceModel::New + ( + alpha1, + rho1, + U, + alphaRhoPhi1, + phi, + mixture.thermo1() + ) + ); + + surfaceScalarField alphaRhoPhi2 + ( + IOobject::groupName("alphaRhoPhi", alpha2.group()), + fvc::interpolate(rho2)*(phi - alphaPhi10) + ); + + autoPtr> turbulence2 + ( + PhaseCompressibleTurbulenceModel::New + ( + alpha2, + rho2, + U, + alphaRhoPhi2, + phi, + mixture.thermo2() + ) + ); + + if (!LTS) + { + #include "readTimeControls.H" + #include "CourantNo.H" + #include "setInitialDeltaT.H" + } + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + Info<< "\nStarting time loop\n" << endl; + + while (runTime.run()) + { + #include "readTimeControls.H" + + 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()) + { + #include "alphaControls.H" + #include "compressibleAlphaEqnSubCycle.H" + + alphaRhoPhi1 = fvc::interpolate(rho1)*alphaPhi10; + alphaRhoPhi2 = fvc::interpolate(rho2)*(phi - alphaPhi10); + + #include "UEqn.H" + #include "TEqn.H" + + // --- Pressure corrector loop + while (pimple.correct()) + { + #include "pEqn.H" + } + + if (pimple.turbCorr()) + { + turbulence1->correct(); + turbulence2->correct(); + } + } + + runTime.write(); + + Info<< "ExecutionTime = " + << runTime.elapsedCpuTime() + << " s\n\n" << endl; + } + + Info<< "End\n" << endl; + + return 0; +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/createFields.H b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/createFields.H new file mode 100644 index 0000000000..4052a10b2f --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/createFields.H @@ -0,0 +1,96 @@ +#include "createRDeltaT.H" + +Info<< "Reading field p_rgh\n" << endl; +volScalarField p_rgh +( + IOobject + ( + "p_rgh", + 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 +); + +#include "createPhi.H" + +Info<< "Constructing twoPhaseMixtureThermo\n" << endl; +twoPhaseMixtureThermo mixture(U, phi); + +volScalarField& alpha1(mixture.alpha1()); +volScalarField& alpha2(mixture.alpha2()); + +Info<< "Reading thermophysical properties\n" << endl; + +const volScalarField& rho1 = mixture.thermo1().rho(); +const volScalarField& rho2 = mixture.thermo2().rho(); + +volScalarField rho +( + IOobject + ( + "rho", + runTime.timeName(), + mesh, + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + alpha1*rho1 + alpha2*rho2 +); + + +dimensionedScalar pMin +( + "pMin", + dimPressure, + mixture +); + +mesh.setFluxRequired(p_rgh.name()); +mesh.setFluxRequired(alpha1.name()); + + +#include "readGravitationalAcceleration.H" +#include "readhRef.H" +#include "gh.H" + + +// Mass flux +// Initialisation does not matter because rhoPhi is reset after the +// alpha1 solution before it is used in the U equation. +surfaceScalarField rhoPhi +( + IOobject + ( + "rhoPhi", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + fvc::interpolate(rho)*phi +); + +volScalarField dgdt(alpha1*fvc::div(phi)); + +Info<< "Creating field kinetic energy K\n" << endl; +volScalarField K("K", 0.5*magSqr(U)); + +#include "createMRF.H" +#include "createFvOptions.H" diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/T b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/T new file mode 100644 index 0000000000..4d5be8a068 --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/T @@ -0,0 +1,37 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object T; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 300; + +boundaryField +{ + wall + { + type zeroGradient; + } + + atmosphere + { + type inletOutlet; + inletValue $internalField; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/U b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/U new file mode 100644 index 0000000000..d4936877e1 --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/U @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + location "0"; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + rod + { + type rotatingWallVelocity; + axis (0 1 0); + origin (0 0 0); + omega constant 13.2; // 2.1 rev/s + value uniform (0 0 0); + } + vessel + { + type noSlip; + } + + atmosphere + { + type pressureInletOutletVelocity; + value $internalField; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/alpha.liquid b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/alpha.liquid new file mode 100644 index 0000000000..dd46eb29eb --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/alpha.liquid @@ -0,0 +1,37 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object alpha.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + wall + { + type zeroGradient; + } + + atmosphere + { + type inletOutlet; + inletValue $internalField; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/p b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/p new file mode 100644 index 0000000000..bf53993b29 --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/p @@ -0,0 +1,38 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 1e5; + +boundaryField +{ + wall + { + type calculated; + value $internalField; + } + + atmosphere + { + type calculated; + value $internalField; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/p_rgh b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/p_rgh new file mode 100644 index 0000000000..7864dbd7ed --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/p_rgh @@ -0,0 +1,38 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p_rgh; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 1e5; + +boundaryField +{ + wall + { + type fixedFluxPressure; + value $internalField; + } + + atmosphere + { + type totalPressure; + p0 $internalField; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/sigma.liquid b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/sigma.liquid new file mode 100644 index 0000000000..8fe65f6629 --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/sigma.liquid @@ -0,0 +1,38 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volSymmTensorField; + object sigma.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform (0 0 0 0 0 0); + +boundaryField +{ + wall + { + type zeroGradient; + } + + atmosphere + { + type inletOutlet; + inletValue $internalField; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/Allclean b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/Allclean new file mode 100755 index 0000000000..7bafa25531 --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/Allclean @@ -0,0 +1,10 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory + +# Source tutorial clean functions +. $WM_PROJECT_DIR/bin/tools/CleanFunctions + +cleanCase +rm -rf 0 2> /dev/null + +#------------------------------------------------------------------------------ diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/Allrun b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/Allrun new file mode 100755 index 0000000000..f182e99ff0 --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/Allrun @@ -0,0 +1,18 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +# Get application name +application=`getApplication` + +runApplication blockMesh +runApplication extrudeMesh + +rm -rf 0 2> /dev/null +cp -r 0.orig 0 +runApplication setFields +runApplication $application + +#------------------------------------------------------------------------------ diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/README b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/README new file mode 100644 index 0000000000..35bf18558d --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/README @@ -0,0 +1,40 @@ +Reference: + + Figueiredo, R. A., Oishi, C. M., Afonso, A. M., Tasso, I. V. M., & + Cuminato, J. A. (2016). + A two-phase solver for complex fluids: Studies of the Weissenberg effect. + International Journal of Multiphase Flow, 84, 98-115. + +In compressibleInterPhaseTransportFoam, separate stress models +(laminar, non-Newtonian, LES or RAS) are instantiated for each of the +two phases allowing for different modeling for the phases. + +This example case uses: +- phases "air" and "liquid" +- air phase + - constant/turbulenceProperties.air: + - stress model set to laminar, Newtonian + - constant/thermophysicalProperties.air: + - transport set to const (Newtonian) + - mu (dynamic viscoity) = 1.84e-5 +- liquid phase + - constant/turbulenceProperties.liquid: + - stress model set to laminar, Maxwell non-Newtonian + - nuM (kinematic viscosity) = 0.01476 + - lambda = 0.018225 + - constant/thermophysicalProperties.liquid + - transport set to const (Newtonian) + - mu (dynamic viscoity) = 1.46 + +Liquid phase properties were calculated from the relations given in the paper: +- rho = 890 kg/m^3 +- mu = mu_{s} + mu_{p} = 146 poise = 14.6 Pa.s + s = solvent (Newtonian), p = polymer (Maxwell) +- mu_{s}/mu_{p} = 1/9 + +=> mu_{s} = 14.6/10 = 1.46 Pa.s +=> nu_{p} = nuM = (9/10)*14.6/890 = 0.01476 m^2/s + +compressibleInterPhaseTransportFoam solves the energy equation, despite not +being needed in this example. The case is simply initialised at a uniform +temperature of 300K throughout the domain and at the atmosphere boundary. \ No newline at end of file diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/fvOptions b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/fvOptions new file mode 100644 index 0000000000..5f0b57c1ea --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/fvOptions @@ -0,0 +1,28 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object fvOptions; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +stabilization +{ + type symmTensorPhaseLimitStabilization; + + field sigma.liquid; + rate rLambda.liquid; + residualAlpha 1e-3; +} + + +//************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/g b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/g new file mode 100644 index 0000000000..0cc222ca34 --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/g @@ -0,0 +1,22 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class uniformDimensionedVectorField; + location "constant"; + object g; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -2 0 0 0 0]; +value (0 -9.81 0); + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/thermophysicalProperties b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/thermophysicalProperties new file mode 100644 index 0000000000..3aa71489a8 --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/thermophysicalProperties @@ -0,0 +1,24 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object thermophysicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +phases (liquid air); + +pMin 10000; + +sigma 0.0309; + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/thermophysicalProperties.air b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/thermophysicalProperties.air new file mode 100644 index 0000000000..382cde79f4 --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/thermophysicalProperties.air @@ -0,0 +1,52 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object thermophysicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + transport const; + thermo hConst; + equationOfState rhoConst; + specie specie; + energy sensibleInternalEnergy; +} + +mixture +{ + specie + { + molWeight 28.9; + } + equationOfState + { + rho 1.2; + } + thermodynamics + { + Cp 1007; + Hf 0; + } + transport + { + mu 1.84e-05; + Pr 0.7; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/thermophysicalProperties.liquid b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/thermophysicalProperties.liquid new file mode 100644 index 0000000000..27c9c7b8fa --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/thermophysicalProperties.liquid @@ -0,0 +1,52 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object thermophysicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + transport const; + thermo hConst; + equationOfState rhoConst; + specie specie; + energy sensibleInternalEnergy; +} + +mixture +{ + specie + { + molWeight 18.0; + } + equationOfState + { + rho 890; + } + thermodynamics + { + Cp 4195; + Hf 0; + } + transport + { + mu 1.46; + Pr 2.289; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/turbulenceProperties.air b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/turbulenceProperties.air new file mode 100644 index 0000000000..c2c3b28a1b --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/turbulenceProperties.air @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType laminar; + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/turbulenceProperties.liquid b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/turbulenceProperties.liquid new file mode 100644 index 0000000000..2d83fbfd6a --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/turbulenceProperties.liquid @@ -0,0 +1,29 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType laminar; + +laminar +{ + laminarModel Maxwell; + + nuM 0.01476; + lambda 0.018225; +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/blockMeshDict b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/blockMeshDict new file mode 100644 index 0000000000..984fcfe209 --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/blockMeshDict @@ -0,0 +1,114 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 0.001; + +// H 77; +R 6.35; +Rc 152.25; +hTotal 110; + +rCells 80; +hCells 80; + +rGrading +( + (0.1 1 1) + (0.9 2.25 10) +); + +hGrading +( + (0.65 2 0.1) + (0.2 2.4 1) + (0.15 1.2 2) +); + +vertices +( + ($R 0 -1) + ($Rc 0 -1) + ($R $hTotal -1) + ($Rc $hTotal -1) + + ($R 0 0) + ($Rc 0 0) + ($R $hTotal 0) + ($Rc $hTotal 0) + +); + +blocks +( + hex (0 1 3 2 4 5 7 6) + ($rCells $hCells 1) + simpleGrading ($rGrading $hGrading 1) +); + +edges +( +); + +boundary +( + rod + { + type wall; + faces + ( + (0 2 6 4) + ); + } + vessel + { + type wall; + faces + ( + (1 3 7 5) + (0 1 5 4) + ); + } + atmosphere + { + type patch; + faces + ( + (2 3 7 6) + ); + } + back + { + type symmetry; + faces + ( + (0 2 3 1) + ); + } + front + { + type symmetry; + faces + ( + (4 5 7 6) + ); + } +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/controlDict b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/controlDict new file mode 100644 index 0000000000..69d4146a96 --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/controlDict @@ -0,0 +1,56 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application compressibleInterPhaseTransportFoam; + +startFrom latestTime; + +startTime 0; + +stopAt endTime; + +endTime 25; + +deltaT 1e-3; + +writeControl adjustableRunTime; + +writeInterval 0.5; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 10; + +writeCompression uncompressed; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +adjustTimeStep yes; + +maxCo 1; +maxAlphaCo 1; + +maxDeltaT 1; + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/extrudeMeshDict b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/extrudeMeshDict new file mode 100644 index 0000000000..2beaba7b0f --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/extrudeMeshDict @@ -0,0 +1,35 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object extrudeProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +constructFrom patch; +sourceCase "$FOAM_CASE"; + +sourcePatches (front); +exposedPatchName back; + +extrudeModel wedge; + +sectorCoeffs +{ + axisPt (0 0 0); + axis (0 -1 0); + angle 1; +} + +flipNormals false; +mergeFaces false; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/fvSchemes b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/fvSchemes new file mode 100644 index 0000000000..5162d1947d --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/fvSchemes @@ -0,0 +1,65 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + div(rhoPhi,U) Gauss linearUpwindV grad(U); + div(rhoPhi,T) Gauss linearUpwind grad(T); + + div(phi,alpha) Gauss vanLeer; + div(phirb,alpha) Gauss linear; + + div(phi,p) Gauss upwind; + div(rhoPhi,K) Gauss upwind; + + div(alphaRhoPhi.liquid,sigma.liquid) Gauss linearUpwind grad(sigma); + + div(((alpha.liquid*thermo:rho.liquid)*sigma.liquid)) Gauss linear; + div((((alpha.liquid*thermo:rho.liquid)*nuM)*grad(U))) Gauss linear; + div((((alpha.liquid*thermo:rho.liquid)*(thermo:mu.liquid|thermo:rho.liquid))*dev2(T(grad(U))))) Gauss linear; + + div((((alpha.air*thermo:rho.air)*nuEff.air)*dev2(T(grad(U))))) Gauss linear; + div((((alpha.liquid*thermo:rho.liquid)*nuEff.liquid)*dev2(T(grad(U))))) Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/fvSolution b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/fvSolution new file mode 100644 index 0000000000..580bbce0aa --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/fvSolution @@ -0,0 +1,91 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + "alpha.liquid.*" + { + nAlphaCorr 2; + nAlphaSubCycles 1; + cAlpha 1; + + MULESCorr yes; + nLimiterIter 5; + + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-8; + relTol 0; + } + + "pcorr.*" + { + solver PCG; + preconditioner DIC; + tolerance 1e-5; + relTol 0; + } + + p_rgh + { + solver PCG; + preconditioner DIC; + tolerance 1e-9; + relTol 0.05; + } + + p_rghFinal + { + $p_rgh; + relTol 0; + } + + "U.*" + { + solver PBiCGStab; + preconditioner DILU; + tolerance 1e-6; + relTol 0; + } + + "(T|k|B|nuTilda|sigma).*" + { + solver PBiCGStab; + preconditioner DILU; + tolerance 1e-8; + relTol 0; + } +} + +PIMPLE +{ + momentumPredictor no; + nOuterCorrectors 1; + nCorrectors 2; + nNonOrthogonalCorrectors 0; +} + +relaxationFactors +{ + equations + { + ".*" 1; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/setFieldsDict b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/setFieldsDict new file mode 100644 index 0000000000..da250c8b06 --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/setFieldsDict @@ -0,0 +1,36 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object setFieldsDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +defaultFieldValues +( + volScalarFieldValue alpha.liquid 0 +); + +regions +( + boxToCell + { + box (0 0 -1) (1 0.0771 1); + fieldValues + ( + volScalarFieldValue alpha.liquid 1 + ); + } +); + + +// ************************************************************************* //