thermophysicalModels: Correcting handling of the inheritance of virtual functions

to avoid warnings from Clang
This commit is contained in:
Henry Weller 2015-07-18 12:26:25 +01:00
parent 7b605ce50e
commit 6555f605f0
3 changed files with 38 additions and 82 deletions

View File

@ -799,60 +799,6 @@ Foam::heThermo<BasicThermo, MixtureType>::alphaEff
} }
template<class BasicThermo, class MixtureType>
Foam::scalar
Foam::heThermo<BasicThermo, MixtureType>::Cp
(
const label speciei,
const scalar p,
const scalar T
) const
{
notImplemented
(
"heThermo<BasicThermo, MixtureType>::"
"Cp(const label speciei, const scalar p, const scalar T)"
);
return 0;
}
template<class BasicThermo, class MixtureType>
Foam::scalar
Foam::heThermo<BasicThermo, MixtureType>::Cv
(
const label speciei,
const scalar p,
const scalar T
) const
{
notImplemented
(
"heThermo<BasicThermo, MixtureType>::"
"Cv(const label speciei, const scalar p, const scalar T)"
);
return 0;
}
template<class BasicThermo, class MixtureType>
Foam::scalar
Foam::heThermo<BasicThermo, MixtureType>::kappa
(
const label speciei,
const scalar p,
const scalar T
) const
{
notImplemented
(
"heThermo<BasicThermo, MixtureType>::"
"kappa(const label speciei, const scalar p, const scalar T)"
);
return 0;
}
template<class BasicThermo, class MixtureType> template<class BasicThermo, class MixtureType>
bool Foam::heThermo<BasicThermo, MixtureType>::read() bool Foam::heThermo<BasicThermo, MixtureType>::read()
{ {

View File

@ -292,34 +292,6 @@ public:
) const; ) const;
// Dummy per-specie thermo properties to avoid problems
// with virtual function inheritance
//- Heat capacity at constant pressure [J/(kg K)]
virtual scalar Cp
(
const label speciei,
const scalar p,
const scalar T
) const;
//- Heat capacity at constant volume [J/(kg K)]
virtual scalar Cv
(
const label speciei,
const scalar p,
const scalar T
) const;
//- Thermal conductivity [W/m/K]
virtual scalar kappa
(
const label speciei,
const scalar p,
const scalar T
) const;
//- Read thermophysical properties dictionary //- Read thermophysical properties dictionary
virtual bool read(); virtual bool read();
}; };

View File

@ -36,6 +36,7 @@ SourceFiles
#define SpecieMixture_H #define SpecieMixture_H
#include "scalar.H" #include "scalar.H"
#include "volFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -184,6 +185,43 @@ public:
const scalar p, const scalar p,
const scalar T const scalar T
) const; ) const;
// Field properties abstract functions
// provided here to avoid issues with inheritance of virtual functions
// in heThermo
//- Heat capacity at constant pressure for patch [J/kg/K]
virtual tmp<scalarField> Cp
(
const scalarField& p,
const scalarField& T,
const label patchi
) const = 0;
//- Heat capacity at constant pressure for patch [J/kg/K]
virtual tmp<volScalarField> Cp() const = 0;
//- Heat capacity at constant volume for patch [J/kg/K]
virtual tmp<scalarField> Cv
(
const scalarField& p,
const scalarField& T,
const label patchi
) const = 0;
//- Heat capacity at constant volume [J/kg/K]
virtual tmp<volScalarField> Cv() const = 0;
//- Thermal diffusivity for temperature
// of mixture for patch [J/m/s/K]
virtual tmp<scalarField> kappa
(
const label patchi
) const = 0;
//- Thermal diffusivity for temperature of mixture [J/m/s/K]
virtual tmp<volScalarField> kappa() const = 0;
}; };