mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge remote branch 'OpenCFD/master' into olesenm
This commit is contained in:
@ -50,7 +50,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
Info<< "\nStarting time loop\n" << endl;
|
||||
|
||||
for (runTime++; !runTime.end(); runTime++)
|
||||
while (runTime.loop())
|
||||
{
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
|
||||
@ -124,6 +124,41 @@ void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::rmap
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField>
|
||||
Foam::solidWallHeatFluxTemperatureFvPatchScalarField::K() const
|
||||
{
|
||||
const fvMesh& mesh = patch().boundaryMesh().mesh();
|
||||
|
||||
if (mesh.objectRegistry::foundObject<volScalarField>(KName_))
|
||||
{
|
||||
return patch().lookupPatchField<volScalarField, scalar>(KName_);
|
||||
}
|
||||
else if (mesh.objectRegistry::foundObject<volSymmTensorField>(KName_))
|
||||
{
|
||||
const symmTensorField& KWall =
|
||||
patch().lookupPatchField<volSymmTensorField, scalar>(KName_);
|
||||
|
||||
vectorField n = patch().nf();
|
||||
|
||||
return n & KWall & n;
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"solidWallHeatFluxTemperatureFvPatchScalarField::K()"
|
||||
" const"
|
||||
) << "Did not find field " << KName_
|
||||
<< " on mesh " << mesh.name() << " patch " << patch().name()
|
||||
<< endl
|
||||
<< "Please set 'K' to a valid volScalarField"
|
||||
<< " or a valid volSymmTensorField." << exit(FatalError);
|
||||
|
||||
return scalarField(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs()
|
||||
{
|
||||
if (updated())
|
||||
@ -131,12 +166,7 @@ void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs()
|
||||
return;
|
||||
}
|
||||
|
||||
const scalarField& Kw = patch().lookupPatchField<volScalarField, scalar>
|
||||
(
|
||||
KName_
|
||||
);
|
||||
|
||||
gradient() = q_/Kw;
|
||||
gradient() = q_/K();
|
||||
|
||||
fixedGradientFvPatchScalarField::updateCoeffs();
|
||||
}
|
||||
|
||||
@ -31,9 +31,10 @@ Description
|
||||
myWallPatch
|
||||
{
|
||||
type solidWallHeatFluxTemperature;
|
||||
K K; // Name of K field
|
||||
q uniform 1000; // Heat flux / [W/m2]
|
||||
value 300.0; // Initial temperature / [K]
|
||||
K K; // Name of K field
|
||||
q uniform 1000; // Heat flux / [W/m2]
|
||||
value uniform 300.0; // Initial temperature / [K]
|
||||
gradient uniform 0.0; // Initial gradient / [K/m]
|
||||
}
|
||||
|
||||
|
||||
@ -140,6 +141,11 @@ public:
|
||||
|
||||
// Member functions
|
||||
|
||||
// Helper
|
||||
|
||||
//- Get K field on this patch
|
||||
tmp<scalarField> K() const;
|
||||
|
||||
// Evaluation functions
|
||||
|
||||
//- Update the coefficients associated with the patch field
|
||||
|
||||
@ -78,7 +78,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
Info<< "\nStarting time loop\n" << endl;
|
||||
|
||||
for (runTime++; !runTime.end(); runTime++)
|
||||
while (runTime.loop())
|
||||
{
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user