mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: changing externalWallHeatFluxTemperature BC to work using mixed type.
This commit is contained in:
@ -72,9 +72,9 @@ externalWallHeatFluxTemperatureFvPatchScalarField
|
|||||||
thicknessLayers_(),
|
thicknessLayers_(),
|
||||||
kappaLayers_()
|
kappaLayers_()
|
||||||
{
|
{
|
||||||
this->refValue() = 0.0;
|
refValue() = 0.0;
|
||||||
this->refGrad() = 0.0;
|
refGrad() = 0.0;
|
||||||
this->valueFraction() = 1.0;
|
valueFraction() = 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -242,17 +242,13 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
scalarField q(size(), 0.0);
|
|
||||||
const scalarField Tc(patchInternalField());
|
|
||||||
const scalarField Tp(*this);
|
const scalarField Tp(*this);
|
||||||
const scalarField KWall(kappa(Tp));
|
scalarField hp(patch().size(), 0.0);
|
||||||
const scalarField KDelta(KWall*patch().deltaCoeffs());
|
|
||||||
|
|
||||||
switch (mode_)
|
switch (mode_)
|
||||||
{
|
{
|
||||||
case fixedHeatFlux:
|
case fixedHeatFlux:
|
||||||
{
|
{
|
||||||
q = q_;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case fixedHeatTransferCoeff:
|
case fixedHeatTransferCoeff:
|
||||||
@ -269,7 +265,7 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
q = (Ta_ - Tp)/(1.0/h_ + totalSolidRes);
|
hp = 1.0/(1.0/h_ + totalSolidRes);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
@ -283,27 +279,24 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(*this, i)
|
if (mode_ == fixedHeatFlux)
|
||||||
{
|
{
|
||||||
if (q[i] > 0) //in
|
refGrad() = q_/kappa(Tp);
|
||||||
{
|
refValue() = 0.0;
|
||||||
this->refGrad()[i] = q[i]/KWall[i];
|
valueFraction() = 0.0;
|
||||||
this->refValue()[i] = 0.0;
|
}
|
||||||
this->valueFraction()[i] = 0.0;
|
else if (mode_ == fixedHeatTransferCoeff)
|
||||||
}
|
{
|
||||||
else //out
|
refGrad() = 0.0;
|
||||||
{
|
refValue() = Ta_;
|
||||||
this->refGrad()[i] = 0.0;
|
valueFraction() = hp/(hp + kappa(Tp)*patch().deltaCoeffs());
|
||||||
this->refValue()[i] = q[i]/KDelta[i] + Tc[i];
|
|
||||||
this->valueFraction()[i] = 1.0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mixedFvPatchScalarField::updateCoeffs();
|
mixedFvPatchScalarField::updateCoeffs();
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
scalar Q = gSum(KWall*patch().magSf()*snGrad());
|
scalar Q = gSum(kappa(Tp)*patch().magSf()*snGrad());
|
||||||
|
|
||||||
Info<< patch().boundaryMesh().mesh().name() << ':'
|
Info<< patch().boundaryMesh().mesh().name() << ':'
|
||||||
<< patch().name() << ':'
|
<< patch().name() << ':'
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user