/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
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 "coupledFvPatchField.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template
Foam::coupledFvPatchField::coupledFvPatchField
(
const fvPatch& p,
const DimensionedField& iF
)
:
LduInterfaceField(refCast(p)),
fvPatchField(p, iF)
{}
template
Foam::coupledFvPatchField::coupledFvPatchField
(
const fvPatch& p,
const DimensionedField& iF,
const Field& f
)
:
LduInterfaceField(refCast(p)),
fvPatchField(p, iF, f)
{}
template
Foam::coupledFvPatchField::coupledFvPatchField
(
const coupledFvPatchField& ptf,
const fvPatch& p,
const DimensionedField& iF,
const fvPatchFieldMapper& mapper
)
:
LduInterfaceField(refCast(p)),
fvPatchField(ptf, p, iF, mapper)
{}
template
Foam::coupledFvPatchField::coupledFvPatchField
(
const fvPatch& p,
const DimensionedField& iF,
const dictionary& dict,
IOobjectOption::readOption requireValue
)
:
LduInterfaceField(refCast(p, dict)),
fvPatchField(p, iF, dict, requireValue)
{}
template
Foam::coupledFvPatchField::coupledFvPatchField
(
const coupledFvPatchField& ptf
)
:
LduInterfaceField(refCast(ptf.patch())),
fvPatchField(ptf)
{}
template
Foam::coupledFvPatchField::coupledFvPatchField
(
const coupledFvPatchField& ptf,
const DimensionedField& iF
)
:
LduInterfaceField(refCast(ptf.patch())),
fvPatchField(ptf, iF)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template
Foam::tmp> Foam::coupledFvPatchField::snGrad
(
const scalarField& deltaCoeffs
) const
{
return
deltaCoeffs
*(this->patchNeighbourField() - this->patchInternalField());
}
template
void Foam::coupledFvPatchField::initEvaluate(const Pstream::commsTypes)
{
if (!this->updated())
{
this->updateCoeffs();
}
}
template
void Foam::coupledFvPatchField::evaluate(const Pstream::commsTypes)
{
if (!this->updated())
{
this->updateCoeffs();
}
Field::operator=
(
lerp
(
this->patchNeighbourField(),
this->patchInternalField(),
this->patch().weights()
)
);
fvPatchField::evaluate();
}
template
Foam::tmp>
Foam::coupledFvPatchField::valueInternalCoeffs
(
const tmp& w
) const
{
return Type(pTraits::one)*w;
}
template
Foam::tmp>
Foam::coupledFvPatchField::valueBoundaryCoeffs
(
const tmp& w
) const
{
return Type(pTraits::one)*(1.0 - w);
}
template
Foam::tmp>
Foam::coupledFvPatchField::gradientInternalCoeffs
(
const scalarField& deltaCoeffs
) const
{
return -Type(pTraits::one)*deltaCoeffs;
}
template
Foam::tmp>
Foam::coupledFvPatchField::gradientInternalCoeffs() const
{
NotImplemented;
return -Type(pTraits::one)*this->patch().deltaCoeffs();
}
template
Foam::tmp>
Foam::coupledFvPatchField::gradientBoundaryCoeffs
(
const scalarField& deltaCoeffs
) const
{
return -this->gradientInternalCoeffs(deltaCoeffs);
}
template
Foam::tmp>
Foam::coupledFvPatchField::gradientBoundaryCoeffs() const
{
NotImplemented;
return -this->gradientInternalCoeffs();
}
template
void Foam::coupledFvPatchField::write(Ostream& os) const
{
fvPatchField::write(os);
fvPatchField::writeValueEntry(os);
}
// ************************************************************************* //