From 9221cd3cbd4f40b2a45079a09460823cf47f918c Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Thu, 5 Nov 2015 16:08:30 +0000 Subject: [PATCH] compressibleInterFoam, multiphaseMixtureThermo: Corrected laminar mixture kinematic viscosity --- .../twoPhaseMixtureThermo.C | 20 ++++++++++ .../twoPhaseMixtureThermo.H | 6 +++ .../multiphaseMixtureThermo.C | 37 +++++++++++++++++++ .../multiphaseMixtureThermo.H | 9 +++++ 4 files changed, 72 insertions(+) diff --git a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.C b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.C index 31949694ad..a3217a073b 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.C +++ b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.C @@ -267,6 +267,26 @@ Foam::tmp Foam::twoPhaseMixtureThermo::CpByCpv } +Foam::tmp Foam::twoPhaseMixtureThermo::nu() const +{ + return mu()/(alpha1()*thermo1_->rho() + alpha2()*thermo2_->rho()); +} + + +Foam::tmp Foam::twoPhaseMixtureThermo::nu +( + const label patchi +) const +{ + return + mu(patchi) + /( + alpha1().boundaryField()[patchi]*thermo1_->rho(patchi) + + alpha2().boundaryField()[patchi]*thermo2_->rho(patchi) + ); +} + + Foam::tmp Foam::twoPhaseMixtureThermo::kappa() const { return alpha1()*thermo1_->kappa() + alpha2()*thermo2_->kappa(); diff --git a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.H b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.H index 1941c9e599..3cde04bb46 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.H +++ b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.H @@ -239,6 +239,12 @@ public: // Fields derived from transport state variables + //- Kinematic viscosity of mixture [m^2/s] + virtual tmp nu() const; + + //- Kinematic viscosity of mixture for patch [m^2/s] + virtual tmp nu(const label patchi) const; + //- Thermal diffusivity for temperature of mixture [J/m/s/K] virtual tmp kappa() const; diff --git a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.C b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.C index 04f76ae341..c8857ce9f2 100644 --- a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.C +++ b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.C @@ -303,6 +303,28 @@ Foam::tmp Foam::multiphaseMixtureThermo::rho() const } +Foam::tmp Foam::multiphaseMixtureThermo::rho +( + const label patchi +) const +{ + PtrDictionary::const_iterator phasei = phases_.begin(); + + tmp trho + ( + phasei().boundaryField()[patchi]*phasei().thermo().rho(patchi) + ); + + for (++phasei; phasei != phases_.end(); ++phasei) + { + trho() += + phasei().boundaryField()[patchi]*phasei().thermo().rho(patchi); + } + + return trho; +} + + Foam::tmp Foam::multiphaseMixtureThermo::Cp() const { PtrDictionary::const_iterator phasei = phases_.begin(); @@ -501,6 +523,21 @@ Foam::tmp Foam::multiphaseMixtureThermo::CpByCpv } +Foam::tmp Foam::multiphaseMixtureThermo::nu() const +{ + return mu()/rho(); +} + + +Foam::tmp Foam::multiphaseMixtureThermo::nu +( + const label patchi +) const +{ + return mu(patchi)/rho(patchi); +} + + Foam::tmp Foam::multiphaseMixtureThermo::kappa() const { PtrDictionary::const_iterator phasei = phases_.begin(); diff --git a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.H b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.H index 83096d3634..b62ea97f68 100644 --- a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.H +++ b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.H @@ -315,6 +315,9 @@ public: //- Density [kg/m^3] virtual tmp rho() const; + //- Density for patch [kg/m^3] + virtual tmp rho(const label patchi) const; + //- Heat capacity at constant pressure [J/kg/K] virtual tmp Cp() const; @@ -373,6 +376,12 @@ public: // Fields derived from transport state variables + //- Kinematic viscosity of mixture [m^2/s] + virtual tmp nu() const; + + //- Kinematic viscosity of mixture for patch [m^2/s] + virtual tmp nu(const label patchi) const; + //- Thermal diffusivity for temperature of mixture [J/m/s/K] virtual tmp kappa() const;