From 1f967d5cd842c1d400e14125ab02e60814da29a0 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Thu, 15 Jun 2017 16:43:04 +0100 Subject: [PATCH] reactingEulerFoam::IsothermalPhaseModel: Added support for isothermal compressible flow Based on patch contributed by Ronald Oertel, HZDR Resolves bug-report https://bugs.openfoam.org/view.php?id=2583 --- .../AnisothermalPhaseModel.C | 16 ++++++++-------- .../AnisothermalPhaseModel.H | 15 ++++++--------- .../IsothermalPhaseModel/IsothermalPhaseModel.C | 9 ++++++++- .../IsothermalPhaseModel/IsothermalPhaseModel.H | 5 ++++- 4 files changed, 26 insertions(+), 19 deletions(-) diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.C index cabb9e2ebf..3e7e62ea31 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -60,6 +60,13 @@ Foam::AnisothermalPhaseModel::~AnisothermalPhaseModel() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template +bool Foam::AnisothermalPhaseModel::compressible() const +{ + return !this->thermo().incompressible(); +} + + template void Foam::AnisothermalPhaseModel::correctKinematics() { @@ -156,13 +163,6 @@ Foam::AnisothermalPhaseModel::heEqn() } -template -bool Foam::AnisothermalPhaseModel::compressible() const -{ - return !this->thermo().incompressible(); -} - - template const Foam::volScalarField& Foam::AnisothermalPhaseModel::K() const diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.H b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.H index 86edbcd1f8..95f7437f0a 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.H +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -85,6 +85,9 @@ public: // Member Functions + //- Return true if the phase is compressible otherwise false + virtual bool compressible() const; + //- Correct the kinematics virtual void correctKinematics(); @@ -94,14 +97,8 @@ public: //- Return the enthalpy equation virtual tmp heEqn(); - - // Compressibility (variable density) - - //- Return true if the phase is compressible otherwise false - virtual bool compressible() const; - - //- Return the phase kinetic energy - virtual const volScalarField& K() const; + //- Return the phase kinetic energy + virtual const volScalarField& K() const; }; diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/IsothermalPhaseModel/IsothermalPhaseModel.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/IsothermalPhaseModel/IsothermalPhaseModel.C index 19b7b73ebe..95a9f0c38b 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/IsothermalPhaseModel/IsothermalPhaseModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/IsothermalPhaseModel/IsothermalPhaseModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -49,6 +49,13 @@ Foam::IsothermalPhaseModel::~IsothermalPhaseModel() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template +bool Foam::IsothermalPhaseModel::compressible() const +{ + return !this->thermo().incompressible(); +} + + template void Foam::IsothermalPhaseModel::correctThermo() {} diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/IsothermalPhaseModel/IsothermalPhaseModel.H b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/IsothermalPhaseModel/IsothermalPhaseModel.H index 85a31f8807..f8bb151fe3 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/IsothermalPhaseModel/IsothermalPhaseModel.H +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/IsothermalPhaseModel/IsothermalPhaseModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -71,6 +71,9 @@ public: // Member Functions + //- Return true if the phase is compressible otherwise false + virtual bool compressible() const; + //- Correct the thermodynamics virtual void correctThermo();