temperatureCoupledBase: Updated to use solidThermo::KappaLocal

This commit is contained in:
Henry Weller
2020-09-25 17:15:42 +01:00
parent 8221b25875
commit 77b31c7f3a
7 changed files with 70 additions and 52 deletions

View File

@ -557,6 +557,16 @@ Foam::tmp<Foam::vectorField> Foam::solidDisplacementThermo::Kappa
}
Foam::tmp<Foam::symmTensorField> Foam::solidDisplacementThermo::KappaLocal
(
const label patchi
) const
{
NotImplemented;
return tmp<symmTensorField>(nullptr);
}
void Foam::solidDisplacementThermo::correct()
{}

View File

@ -363,10 +363,11 @@ public:
virtual tmp<volVectorField> Kappa() const;
//- Anisotropic thermal conductivity [W/m/K]
virtual tmp<vectorField> Kappa
(
const label patchi
) const;
virtual tmp<vectorField> Kappa(const label patchi) const;
//- Anisotropic thermal conductivity for patch
// in the local coordinate system [W/m/K]
virtual tmp<symmTensorField> KappaLocal(const label patchi) const;
//- Return the heat flux
virtual tmp<surfaceScalarField> q() const;

View File

@ -35,8 +35,7 @@ Foam::temperatureCoupledBase::temperatureCoupledBase
const fvPatch& patch
)
:
patch_(patch),
alphaAniName_(word::null)
patch_(patch)
{}
@ -46,8 +45,7 @@ Foam::temperatureCoupledBase::temperatureCoupledBase
const dictionary& dict
)
:
patch_(patch),
alphaAniName_(dict.lookupOrDefault<word>("alphaAni", word::null))
patch_(patch)
{}
@ -57,8 +55,7 @@ Foam::temperatureCoupledBase::temperatureCoupledBase
const temperatureCoupledBase& base
)
:
patch_(patch),
alphaAniName_(base.alphaAniName_)
patch_(patch)
{}
@ -110,15 +107,9 @@ Foam::tmp<Foam::scalarField> Foam::temperatureCoupledBase::kappa
const solidThermo& thermo =
mesh.lookupObject<solidThermo>(basicThermo::dictName);
if (alphaAniName_ != word::null)
if (!thermo.isotropic())
{
const symmTensorField& alphaAni =
patch_.lookupPatchField<volSymmTensorField, scalar>
(
alphaAniName_
);
const symmTensorField kappa(alphaAni*thermo.Cp(Tp, patchi));
const symmTensorField kappa(thermo.KappaLocal(patchi));
const vectorField n(patch_.nf());
return n & kappa & n;
@ -140,12 +131,7 @@ Foam::tmp<Foam::scalarField> Foam::temperatureCoupledBase::kappa
void Foam::temperatureCoupledBase::write(Ostream& os) const
{
if (alphaAniName_ != word::null)
{
writeEntry(os, "alphaAni", alphaAniName_);
}
}
{}
// ************************************************************************* //

View File

@ -70,10 +70,6 @@ class temperatureCoupledBase
//- Underlying patch
const fvPatch& patch_;
//- Name of the optional anisotropic alpha for solid conductivity
// This field is read and used if available
const word alphaAniName_;
public:

View File

@ -276,38 +276,51 @@ Foam::heSolidThermo<BasicSolidThermo, MixtureType>::KappaLocal() const
{
const fvMesh& mesh = this->T_.mesh();
tmp<volSymmTensorField> tKappaLocal;
const coordinateSystem coordinates
(
coordinateSystem::New(mesh, this->properties())
);
if (!isotropic())
{
coordinateSystem coordinates
const tmp<volVectorField> tKappa(Kappa());
tmp<volSymmTensorField> tKappaLocal
(
volSymmTensorField::New
(
coordinateSystem::New(mesh, this->properties())
);
"KappaLocal",
mesh,
dimensionedSymmTensor(tKappa().dimensions(), Zero),
zeroGradientFvPatchSymmTensorField::typeName
)
);
volSymmTensorField& KappaLocal = tKappaLocal.ref();
const tmp<volVectorField> tKappa(Kappa());
tKappaLocal =
(
volSymmTensorField::New
(
"KappaLocal",
mesh,
dimensionedSymmTensor(tKappa().dimensions(), Zero),
zeroGradientFvPatchSymmTensorField::typeName
)
);
volSymmTensorField& KappaLocal = tKappaLocal.ref();
KappaLocal.primitiveFieldRef() =
coordinates.R().transformVector(tKappa());
KappaLocal.correctBoundaryConditions();
}
KappaLocal.primitiveFieldRef() =
coordinates.R().transformVector(tKappa());
KappaLocal.correctBoundaryConditions();
return tKappaLocal;
}
template<class BasicSolidThermo, class MixtureType>
Foam::tmp<Foam::symmTensorField>
Foam::heSolidThermo<BasicSolidThermo, MixtureType>::KappaLocal
(
const label patchi
) const
{
const fvMesh& mesh = this->T_.mesh();
const coordinateSystem coordinates
(
coordinateSystem::New(mesh, this->properties())
);
return coordinates.R().transformVector(Kappa(patchi));
}
template<class BasicSolidThermo, class MixtureType>
Foam::tmp<Foam::surfaceScalarField>
Foam::heSolidThermo<BasicSolidThermo, MixtureType>::q() const

View File

@ -111,6 +111,10 @@ public:
//- Anisotropic thermal conductivity [W/m/K]
virtual tmp<vectorField> Kappa(const label patchi) const;
//- Anisotropic thermal conductivity for patch
// in the local coordinate system [W/m/K]
virtual tmp<symmTensorField> KappaLocal(const label patchi) const;
//- Return the heat flux
virtual tmp<surfaceScalarField> q() const;

View File

@ -133,6 +133,10 @@ public:
//- Anisotropic thermal conductivity for patch [W/m/K]
virtual tmp<vectorField> Kappa(const label patchi) const = 0;
//- Anisotropic thermal conductivity for patch
// in the local coordinate system [W/m/K]
virtual tmp<symmTensorField> KappaLocal(const label patchi) const = 0;
//- Return the heat flux
virtual tmp<surfaceScalarField> q() const = 0;
@ -207,6 +211,10 @@ public:
//- Anisotropic thermal conductivity for patch [W/m/K]
virtual tmp<vectorField> Kappa(const label patchi) const = 0;
//- Anisotropic thermal conductivity for patch
// in the local coordinate system [W/m/K]
virtual tmp<symmTensorField> KappaLocal(const label patchi) const = 0;
//- Return the heat flux
virtual tmp<surfaceScalarField> q() const = 0;