Commit f8a8857c authored by Henry Weller's avatar Henry Weller Committed by Andrew Heather
Browse files

limitTemperature: added support for multiphase solvers

Based on patch contributed by Juho Peltola, VTT

Resolves feature request https://bugs.openfoam.org/view.php?id=2572
parent 9a1435ed
......@@ -31,6 +31,7 @@ for (int Ecorr=0; Ecorr<nEnergyCorrectors; Ecorr++)
EEqn->relax();
fvOptions.constrain(EEqn.ref());
EEqn->solve();
fvOptions.correct(phase.thermo().he());
}
}
......
......@@ -25,6 +25,7 @@ for (int Ecorr=0; Ecorr<nEnergyCorrectors; Ecorr++)
E1Eqn->relax();
fvOptions.constrain(E1Eqn.ref());
E1Eqn->solve();
fvOptions.correct(phase1.thermo().he());
}
}
......@@ -45,6 +46,7 @@ for (int Ecorr=0; Ecorr<nEnergyCorrectors; Ecorr++)
E2Eqn->relax();
fvOptions.constrain(E2Eqn.ref());
E2Eqn->solve();
fvOptions.correct(phase2.thermo().he());
}
}
......
......@@ -75,9 +75,11 @@
fvOptions.constrain(E1Eqn);
E1Eqn.solve();
fvOptions.correct(he1);
fvOptions.constrain(E2Eqn);
E2Eqn.solve();
fvOptions.correct(he2);
thermo1.correct();
Info<< "min " << thermo1.T().name()
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -57,13 +57,16 @@ Foam::fv::limitTemperature::limitTemperature
:
cellSetOption(name, modelType, dict, mesh),
Tmin_(readScalar(coeffs_.lookup("min"))),
Tmax_(readScalar(coeffs_.lookup("max")))
Tmax_(readScalar(coeffs_.lookup("max"))),
phase_(coeffs_.lookupOrDefault<word>("phase", word::null))
{
// Set the field name to that of the energy field from which the temperature
// is obtained
const basicThermo& thermo =
mesh_.lookupObject<basicThermo>(basicThermo::dictName);
mesh_.lookupObject<basicThermo>
(
IOobject::groupName(basicThermo::dictName, phase_)
);
fieldNames_.setSize(1, thermo.he().name());
......@@ -92,7 +95,10 @@ bool Foam::fv::limitTemperature::read(const dictionary& dict)
void Foam::fv::limitTemperature::correct(volScalarField& he)
{
const basicThermo& thermo =
mesh_.lookupObject<basicThermo>(basicThermo::dictName);
mesh_.lookupObject<basicThermo>
(
IOobject::groupName(basicThermo::dictName, phase_)
);
scalarField Tmin(cells_.size(), Tmin_);
scalarField Tmax(cells_.size(), Tmax_);
......
......@@ -42,6 +42,7 @@ Usage
selectionMode all;
min 200;
max 500;
phase gas; //optional
}
\endverbatim
......@@ -81,6 +82,9 @@ protected:
//- Maximum temperature limit [K]
scalar Tmax_;
//- Optional phase name [K]
word phase_;
private:
......
Supports Markdown
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