Skip to content
Snippets Groups Projects
Commit f5f93e81 authored by mattijs's avatar mattijs
Browse files

COMP: temperatureCoupledBase: make API consistent. Fixes #2287.

parent 29f7fcc5
Branches
Tags
No related merge requests found
...@@ -170,7 +170,7 @@ Foam::temperatureCoupledBase::temperatureCoupledBase ...@@ -170,7 +170,7 @@ Foam::temperatureCoupledBase::temperatureCoupledBase
void Foam::temperatureCoupledBase::autoMap void Foam::temperatureCoupledBase::autoMap
( (
const FieldMapper& mapper const fvPatchFieldMapper& mapper
) )
{ {
if (kappaFunction1_) if (kappaFunction1_)
...@@ -186,17 +186,22 @@ void Foam::temperatureCoupledBase::autoMap ...@@ -186,17 +186,22 @@ void Foam::temperatureCoupledBase::autoMap
void Foam::temperatureCoupledBase::rmap void Foam::temperatureCoupledBase::rmap
( (
const temperatureCoupledBase& ptf, const fvPatchField<scalar>& ptf,
const labelList& addr const labelList& addr
) )
{ {
if (kappaFunction1_) const auto* tcb = isA<temperatureCoupledBase>(ptf);
{
kappaFunction1_().rmap(ptf.kappaFunction1_(), addr); if (tcb)
}
if (alphaFunction1_)
{ {
alphaFunction1_().rmap(ptf.alphaFunction1_(), addr); if (kappaFunction1_)
{
kappaFunction1_().rmap(tcb->kappaFunction1_(), addr);
}
if (alphaFunction1_)
{
alphaFunction1_().rmap(tcb->alphaFunction1_(), addr);
}
} }
} }
......
...@@ -87,6 +87,7 @@ SourceFiles ...@@ -87,6 +87,7 @@ SourceFiles
#include "Enum.H" #include "Enum.H"
#include "fvPatch.H" #include "fvPatch.H"
#include "PatchFunction1.H" #include "PatchFunction1.H"
#include "fvPatchFieldMapper.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...@@ -204,15 +205,15 @@ public: ...@@ -204,15 +205,15 @@ public:
//- Map (and resize as needed) from self given a mapping object //- Map (and resize as needed) from self given a mapping object
virtual void autoMap virtual void autoMap
( (
const FieldMapper& const fvPatchFieldMapper&
); ) = 0;
//- Reverse map the given fvPatchField onto this fvPatchField //- Reverse map the given fvPatchField onto this fvPatchField
virtual void rmap virtual void rmap
( (
const temperatureCoupledBase&, const fvPatchField<scalar>&,
const labelList& const labelList&
); ) = 0;
//- Given patch temperature calculate corresponding K field //- Given patch temperature calculate corresponding K field
virtual tmp<scalarField> kappa(const scalarField& Tp) const; virtual tmp<scalarField> kappa(const scalarField& Tp) const;
......
...@@ -164,6 +164,28 @@ public: ...@@ -164,6 +164,28 @@ public:
// Member Functions // Member Functions
// Mapping functions
//- Map (and resize as needed) from self given a mapping object
virtual void autoMap
(
const fvPatchFieldMapper& mapper
)
{
temperatureCoupledBase::autoMap(mapper);
}
//- Reverse map the given fvPatchField onto this fvPatchField
virtual void rmap
(
const fvPatchField<scalar>& fld,
const labelList& map
)
{
temperatureCoupledBase::rmap(fld, map);
}
// Evaluation // Evaluation
//- Add explicit contribution to compressible momentum equation //- Add explicit contribution to compressible momentum equation
......
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