/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2017 Wikki Ltd
Copyright (C) 2019-2025 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 .
Class
Foam::coupledFaPatchField
Description
Author
Zeljko Tukovic, FMENA
Hrvoje Jasak, Wikki Ltd.
SourceFiles
coupledFaPatchField.C
\*---------------------------------------------------------------------------*/
#ifndef Foam_coupledFaPatchField_H
#define Foam_coupledFaPatchField_H
#include "lduInterfaceField.H"
#include "faPatchField.H"
#include "coupledFaPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class coupledFaPatchField Declaration
\*---------------------------------------------------------------------------*/
template
class coupledFaPatchField
:
public lduInterfaceField,
public faPatchField
{
public:
//- Runtime type information
TypeName(coupledFaPatch::typeName_());
// Constructors
//- Construct from patch and internal field
coupledFaPatchField
(
const faPatch&,
const DimensionedField&
);
//- Construct from patch and internal field and patch field
coupledFaPatchField
(
const faPatch&,
const DimensionedField&,
const Field&
);
//- Construct from patch, internal field and dictionary
coupledFaPatchField
(
const faPatch&,
const DimensionedField&,
const dictionary& dict,
//! The "value" entry (default: mandatory)
IOobjectOption::readOption requireValue = IOobjectOption::MUST_READ
);
//- Construct by mapping the given coupledFaPatchField onto a new patch
coupledFaPatchField
(
const coupledFaPatchField&,
const faPatch&,
const DimensionedField&,
const faPatchFieldMapper&
);
//- Construct as copy
coupledFaPatchField
(
const coupledFaPatchField&
);
//- Construct as copy setting internal field reference
coupledFaPatchField
(
const coupledFaPatchField&,
const DimensionedField&
);
//- Return clone
virtual tmp> clone() const = 0;
//- Construct and return a clone
virtual tmp> clone
(
const DimensionedField&
) const = 0;
// Member Functions
// Access
//- Return true if this patch field is derived from
// coupledFaPatchField.
virtual bool coupled() const
{
return true;
}
//- Return neighbour field of internal field
virtual tmp> patchNeighbourField() const = 0;
//- Retrieve neighbour coupled field
virtual void patchNeighbourField(UList&) const = 0;
// Evaluation functions
//- Return patch-normal gradient
virtual tmp> snGrad() const;
//- Initialise the evaluation of the patch field
virtual void initEvaluate
(
const Pstream::commsTypes commsType
);
//- Evaluate the patch field
virtual void evaluate
(
const Pstream::commsTypes commsType
);
//- Initialise the evaluation of the patch field after a local
// operation
virtual void initEvaluateLocal
(
const Pstream::commsTypes commsType =
Pstream::commsTypes::buffered
)
{
initEvaluate(commsType);
}
//- Evaluate the patch field after a local operation (e.g. *=)
virtual void evaluateLocal
(
const Pstream::commsTypes commsType =
Pstream::commsTypes::buffered
)
{
evaluate(commsType);
}
//- Return the matrix diagonal coefficients corresponding to the
// evaluation of the value of this patchField with given weights
virtual tmp> valueInternalCoeffs
(
const tmp&
) const;
//- Return the matrix source coefficients corresponding to the
// evaluation of the value of this patchField with given weights
virtual tmp> valueBoundaryCoeffs
(
const tmp&
) const;
//- Return the matrix diagonal coefficients corresponding to the
// evaluation of the gradient of this patchField
virtual tmp> gradientInternalCoeffs() const;
//- Return the matrix source coefficients corresponding to the
// evaluation of the gradient of this patchField
virtual tmp> gradientBoundaryCoeffs() const;
// Coupled interface functionality
//- Update result field based on interface functionality
virtual void updateInterfaceMatrix
(
solveScalarField& result,
const bool add,
const lduAddressing& lduAddr,
const label patchId,
const solveScalarField& psiInternal,
const scalarField& coeffs,
const direction,
const Pstream::commsTypes commsType
) const = 0;
//- Update result field based on interface functionality
virtual void updateInterfaceMatrix
(
Field& result,
const bool add,
const lduAddressing& lduAddr,
const label patchId,
const Field&,
const scalarField& coeffs,
const Pstream::commsTypes commsType
) const = 0;
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "coupledFaPatchField.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //