Skip to content
Snippets Groups Projects
Commit b3c3c86a authored by Henry's avatar Henry Committed by Andrew Heather
Browse files

interRegionHeatTransferModel: Corrected semi-implicit treatment of energy

h and e, non-constant Cp/Cv and non-zero origin now supported
parent e6cef527
Branches
Tags
No related merge requests found
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
...@@ -170,7 +170,7 @@ void Foam::fv::interRegionHeatTransferModel::addSup ...@@ -170,7 +170,7 @@ void Foam::fv::interRegionHeatTransferModel::addSup
correct(); correct();
const volScalarField& h = eqn.psi(); const volScalarField& he = eqn.psi();
const volScalarField& T = mesh_.lookupObject<volScalarField>(TName_); const volScalarField& T = mesh_.lookupObject<volScalarField>(TName_);
...@@ -214,19 +214,21 @@ void Foam::fv::interRegionHeatTransferModel::addSup ...@@ -214,19 +214,21 @@ void Foam::fv::interRegionHeatTransferModel::addSup
if (semiImplicit_) if (semiImplicit_)
{ {
if (h.dimensions() == dimEnergy/dimMass) if (he.dimensions() == dimEnergy/dimMass)
{ {
if (mesh_.foundObject<fluidThermo>("thermophysicalProperties")) if (mesh_.foundObject<fluidThermo>("thermophysicalProperties"))
{ {
const basicThermo& thermo = const basicThermo& thermo =
mesh_.lookupObject<basicThermo>("thermophysicalProperties"); mesh_.lookupObject<basicThermo>("thermophysicalProperties");
eqn += htc_*Tmapped - fvm::SuSp(htc_/thermo.Cp(), h); volScalarField htcByCpv(htc_/thermo.Cpv());
eqn += htc_*(Tmapped - T) + htcByCpv*he - fvm::Sp(htcByCpv, he);
if (debug) if (debug)
{ {
const dimensionedScalar energy = const dimensionedScalar energy =
fvc::domainIntegrate(htc_*(h/thermo.Cp() - Tmapped)); fvc::domainIntegrate(htc_*(he/thermo.Cp() - Tmapped));
Info<< "Energy exchange from region " << nbrMesh.name() Info<< "Energy exchange from region " << nbrMesh.name()
<< " To " << mesh_.name() << " : " << energy.value() << " To " << mesh_.name() << " : " << energy.value()
...@@ -251,9 +253,9 @@ void Foam::fv::interRegionHeatTransferModel::addSup ...@@ -251,9 +253,9 @@ void Foam::fv::interRegionHeatTransferModel::addSup
<< exit(FatalError); << exit(FatalError);
} }
} }
else if (h.dimensions() == dimTemperature) else if (he.dimensions() == dimTemperature)
{ {
eqn += htc_*Tmapped - fvm::SuSp(htc_, h); eqn += htc_*Tmapped - fvm::Sp(htc_, he);
} }
} }
else else
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment