foamNewBC: Reinstate time method

This serves as an example of the creation of a private method. It no
longer needs to convert the Function1 argument to user time, following
the addition of generalised unit conversion.
This commit is contained in:
Will Bainbridge
2024-10-17 13:47:07 +01:00
parent a00b947c1d
commit 29e2c93dc1
2 changed files with 16 additions and 1 deletions

View File

@ -29,6 +29,15 @@ License
#include "volFields.H"
#include "surfaceFields.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class Type>
Foam::scalar Foam::CLASS::t() const
{
return this->db().time().value();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
@ -162,7 +171,7 @@ void Foam::CLASS::updateCoeffs()
(
data_
+ fieldData_
+ scalarData_*timeVsData_->value(this->db().time().value())
+ scalarData_*timeVsData_->value(t())
);
const scalarField& phip =

View File

@ -118,6 +118,12 @@ class CONSTRUCT
bool boolData_;
// Private Member Functions
//- Return current time
scalar t() const;
public:
//- Runtime type information