diff --git a/applications/solvers/multiphase/compressibleInterFoam/TEqn.H b/applications/solvers/multiphase/compressibleInterFoam/TEqn.H index 72eedb6559..7fe9a41e72 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/TEqn.H +++ b/applications/solvers/multiphase/compressibleInterFoam/TEqn.H @@ -4,9 +4,13 @@ fvm::ddt(rho, T) + fvm::div(rhoPhi, T) - fvm::Sp(contErr, T) - fvm::laplacian(turbulence.alphaEff(), T) + ( + mixture.totalInternalEnergy() + ? fvc::div(fvc::absolute(phi, U), p)()() // - contErr/rho*p + (fvc::ddt(rho, K) + fvc::div(rhoPhi, K))()() - (U()&(fvModels.source(rho, U)&U)()) - contErr*K + : + p*fvc::div(fvc::absolute(phi, U))()() ) *( alpha1()/mixture.thermo1().Cv()() diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleTwoPhaseMixture/compressibleTwoPhaseMixture.C b/applications/solvers/multiphase/compressibleInterFoam/compressibleTwoPhaseMixture/compressibleTwoPhaseMixture.C index 2494284680..c3b72b4fe8 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleTwoPhaseMixture/compressibleTwoPhaseMixture.C +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleTwoPhaseMixture/compressibleTwoPhaseMixture.C @@ -44,6 +44,11 @@ Foam::compressibleTwoPhaseMixture::compressibleTwoPhaseMixture twoPhaseMixture(U.mesh()), interfaceProperties(alpha1(), alpha2(), U, *this), + totalInternalEnergy_ + ( + lookupOrDefault("totalInternalEnergy", true) + ), + p_ ( IOobject @@ -204,8 +209,11 @@ Foam::tmp Foam::compressibleTwoPhaseMixture::nu bool Foam::compressibleTwoPhaseMixture::read() { - if (regIOobject::read()) + if (twoPhaseMixture::read()) { + totalInternalEnergy_ = + lookupOrDefault("totalInternalEnergy", true); + return interfaceProperties::read(); } else diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleTwoPhaseMixture/compressibleTwoPhaseMixture.H b/applications/solvers/multiphase/compressibleInterFoam/compressibleTwoPhaseMixture/compressibleTwoPhaseMixture.H index d700882b9d..4b9284c1a7 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleTwoPhaseMixture/compressibleTwoPhaseMixture.H +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleTwoPhaseMixture/compressibleTwoPhaseMixture.H @@ -59,6 +59,10 @@ class compressibleTwoPhaseMixture { // Private Data + //- Switch to choose between solving for internal energy + // or total internal energy which is the default + Switch totalInternalEnergy_; + //- Pressure volScalarField p_; @@ -103,6 +107,13 @@ public: // Member Functions + //- Return true to solve for total internal energy + // return false to solve for internal energy + bool totalInternalEnergy() const + { + return totalInternalEnergy_; + } + //- Return pressure [Pa] volScalarField& p() {