BUG: Adding mapping functions to radiationCoupledBase

This commit is contained in:
sergio
2014-10-15 11:53:02 +01:00
committed by Andrew Heather
parent 2dfb664e1f
commit f0def801b2
4 changed files with 85 additions and 15 deletions

View File

@ -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-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -61,7 +61,8 @@ Foam::MarshakRadiationFvPatchScalarField::MarshakRadiationFvPatchScalarField
( (
p, p,
ptf.emissivityMethod(), ptf.emissivityMethod(),
ptf.emissivity_ ptf.emissivity_,
mapper
), ),
TName_(ptf.TName_) TName_(ptf.TName_)
{} {}
@ -136,7 +137,8 @@ void Foam::MarshakRadiationFvPatchScalarField::autoMap
const fvPatchFieldMapper& m const fvPatchFieldMapper& m
) )
{ {
scalarField::autoMap(m); mixedFvPatchScalarField::autoMap(m);
radiationCoupledBase::autoMap(m);
} }
@ -147,6 +149,7 @@ void Foam::MarshakRadiationFvPatchScalarField::rmap
) )
{ {
mixedFvPatchScalarField::rmap(ptf, addr); mixedFvPatchScalarField::rmap(ptf, addr);
radiationCoupledBase::rmap(ptf, addr);
} }

View File

@ -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-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -63,7 +63,8 @@ MarshakRadiationFixedTemperatureFvPatchScalarField
( (
p, p,
ptf.emissivityMethod(), ptf.emissivityMethod(),
ptf.emissivity_ ptf.emissivity_,
mapper
), ),
Trad_(ptf.Trad_, mapper) Trad_(ptf.Trad_, mapper)
{} {}
@ -136,6 +137,7 @@ void Foam::MarshakRadiationFixedTemperatureFvPatchScalarField::autoMap
) )
{ {
mixedFvPatchScalarField::autoMap(m); mixedFvPatchScalarField::autoMap(m);
radiationCoupledBase::autoMap(m);
Trad_.autoMap(m); Trad_.autoMap(m);
} }
@ -147,7 +149,7 @@ void Foam::MarshakRadiationFixedTemperatureFvPatchScalarField::rmap
) )
{ {
mixedFvPatchScalarField::rmap(ptf, addr); mixedFvPatchScalarField::rmap(ptf, addr);
radiationCoupledBase::rmap(ptf, addr);
const MarshakRadiationFixedTemperatureFvPatchScalarField& mrptf = const MarshakRadiationFixedTemperatureFvPatchScalarField& mrptf =
refCast<const MarshakRadiationFixedTemperatureFvPatchScalarField>(ptf); refCast<const MarshakRadiationFixedTemperatureFvPatchScalarField>(ptf);

View File

@ -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-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -66,6 +66,20 @@ Foam::radiationCoupledBase::radiationCoupledBase
{} {}
Foam::radiationCoupledBase::radiationCoupledBase
(
const fvPatch& patch,
const word& calculationType,
const scalarField& emissivity,
const fvPatchFieldMapper& mapper
)
:
patch_(patch),
method_(emissivityMethodTypeNames_[calculationType]),
emissivity_(emissivity, mapper)
{}
Foam::radiationCoupledBase::radiationCoupledBase Foam::radiationCoupledBase::radiationCoupledBase
( (
const fvPatch& patch, const fvPatch& patch,
@ -189,6 +203,28 @@ Foam::scalarField Foam::radiationCoupledBase::emissivity() const
} }
void Foam::radiationCoupledBase::autoMap
(
const fvPatchFieldMapper& m
)
{
emissivity_.autoMap(m);
}
void Foam::radiationCoupledBase::rmap
(
const fvPatchScalarField& ptf,
const labelList& addr
)
{
const radiationCoupledBase& mrptf =
refCast<const radiationCoupledBase>(ptf);
emissivity_.rmap(mrptf.emissivity_, addr);
}
void Foam::radiationCoupledBase::write(Ostream& os) const void Foam::radiationCoupledBase::write(Ostream& os) const
{ {
os.writeKeyword("emissivityMode") << emissivityMethodTypeNames_[method_] os.writeKeyword("emissivityMode") << emissivityMethodTypeNames_[method_]

View File

@ -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-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -42,6 +42,7 @@ SourceFiles
#include "scalarField.H" #include "scalarField.H"
#include "NamedEnum.H" #include "NamedEnum.H"
#include "fvPatch.H" #include "fvPatch.H"
#include "fvPatchFieldMapper.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -99,6 +100,15 @@ public:
const scalarField& emissivity const scalarField& emissivity
); );
//- Construct from patch, emissivity mode and emissivity and mapper
radiationCoupledBase
(
const fvPatch& patch,
const word& calculationMethod,
const scalarField& emissivity,
const fvPatchFieldMapper& mapper
);
//- Construct from patch and dictionary //- Construct from patch and dictionary
radiationCoupledBase radiationCoupledBase
( (
@ -109,6 +119,8 @@ public:
// Member functions // Member functions
// Access
//- Method to obtain emissivity //- Method to obtain emissivity
word emissivityMethod() const word emissivityMethod() const
{ {
@ -119,6 +131,23 @@ public:
//- Calculate corresponding emissivity field //- Calculate corresponding emissivity field
scalarField emissivity() const; scalarField emissivity() const;
// Mapping functions
//- Map (and resize as needed) from self given a mapping object
void autoMap
(
const fvPatchFieldMapper&
);
//- Reverse map the given fvPatchField onto this fvPatchField
void rmap
(
const fvPatchScalarField&,
const labelList&
);
//- Write //- Write
void write(Ostream&) const; void write(Ostream&) const;
}; };