/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2023-2026 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see .
\*---------------------------------------------------------------------------*/
#include "internalFvFieldSource.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template
Foam::internalFvFieldSource::internalFvFieldSource
(
const DimensionedField& iF,
const dictionary& dict
)
:
fvFieldSource(iF, dict)
{}
template
Foam::internalFvFieldSource::internalFvFieldSource
(
const internalFvFieldSource& field,
const DimensionedField& iF
)
:
fvFieldSource(field, iF)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template
Foam::internalFvFieldSource::~internalFvFieldSource()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
template
Foam::tmp>
Foam::internalFvFieldSource::sourceValue
(
const fvSource& model,
const DimensionedField& source
) const
{
// This value doesn't matter in principle, as this condition takes 100% of
// its value from the internal field. However, this value does, at least,
// need to be physical to prevent things like thermo evaluations from
// failing. So, just take the internal values.
return this->internalField();
}
template
Foam::tmp>
Foam::internalFvFieldSource::sourceValue
(
const fvSource& model,
const scalarField& source,
const labelUList& cells
) const
{
// This value doesn't matter in principle, as this condition takes 100% of
// its value from the internal field. However, this value does, at least,
// need to be physical to prevent things like thermo evaluations from
// failing. So, just take the internal values.
return tmp>(new Field(this->internalField(), cells));
}
template
Foam::tmp>
Foam::internalFvFieldSource::internalCoeff
(
const fvSource& model,
const DimensionedField& source
) const
{
return
DimensionedField::New
(
model.name() + ":" + this->internalField().name() + "InternalCoeff",
this->internalField().mesh(),
dimensionedScalar(dimless, scalar(1))
);
}
template
Foam::tmp
Foam::internalFvFieldSource::internalCoeff
(
const fvSource& model,
const scalarField& source,
const labelUList& cells
) const
{
return tmp(new scalarField(source.size(), scalar(1)));
}
// ************************************************************************* //