Commit 94897015 authored by Henry's avatar Henry
Browse files

externalWallHeatFluxTemperature: Combined logic into a single switch

parent 9c09fd4f
...@@ -33,26 +33,27 @@ License ...@@ -33,26 +33,27 @@ License
namespace Foam namespace Foam
{ {
template<>
const char*
NamedEnum
<
externalWallHeatFluxTemperatureFvPatchScalarField::operationMode,
3
>::names[] =
{
"fixed_heat_flux",
"fixed_heat_transfer_coefficient",
"unknown"
};
template<> } // End namespace Foam
const char*
NamedEnum
<externalWallHeatFluxTemperatureFvPatchScalarField::operationMode, 3>::names[]=
{
"fixed_heat_flux",
"fixed_heat_transfer_coefficient",
"unknown"
};
const NamedEnum const Foam::NamedEnum
< <
externalWallHeatFluxTemperatureFvPatchScalarField::operationMode, 3 Foam::externalWallHeatFluxTemperatureFvPatchScalarField::operationMode,
> 3
externalWallHeatFluxTemperatureFvPatchScalarField::operationModeNames; > Foam::externalWallHeatFluxTemperatureFvPatchScalarField::operationModeNames;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
...@@ -260,6 +261,10 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs() ...@@ -260,6 +261,10 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs()
{ {
case fixedHeatFlux: case fixedHeatFlux:
{ {
refGrad() = (q_ + Qr)/kappa(Tp);
refValue() = 0.0;
valueFraction() = 0.0;
break; break;
} }
case fixedHeatTransferCoeff: case fixedHeatTransferCoeff:
...@@ -277,6 +282,13 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs() ...@@ -277,6 +282,13 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs()
} }
} }
hp = 1.0/(1.0/h_ + totalSolidRes); hp = 1.0/(1.0/h_ + totalSolidRes);
Qr /= Tp;
refGrad() = 0.0;
refValue() = hp*Ta_/(hp - Qr);
valueFraction() =
(hp - Qr)/((hp - Qr) + kappa(Tp)*patch().deltaCoeffs());
break; break;
} }
default: default:
...@@ -290,21 +302,6 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs() ...@@ -290,21 +302,6 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs()
} }
} }
if (mode_ == fixedHeatFlux)
{
refGrad() = (q_ + Qr)/kappa(Tp);
refValue() = 0.0;
valueFraction() = 0.0;
}
else if (mode_ == fixedHeatTransferCoeff)
{
Qr /= Tp;
refGrad() = 0.0;
refValue() = hp*Ta_/(hp - Qr);
valueFraction() =
(hp - Qr)/((hp - Qr) + kappa(Tp)*patch().deltaCoeffs());
}
mixedFvPatchScalarField::updateCoeffs(); mixedFvPatchScalarField::updateCoeffs();
if (debug) if (debug)
......
...@@ -120,6 +120,7 @@ public: ...@@ -120,6 +120,7 @@ public:
fixedHeatTransferCoeff, fixedHeatTransferCoeff,
unknown unknown
}; };
static const NamedEnum<operationMode, 3> operationModeNames; static const NamedEnum<operationMode, 3> operationModeNames;
......
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