Newer
Older
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2017 Wikki Ltd
Copyright (C) 2019 OpenCFD Ltd.
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
-------------------------------------------------------------------------------
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 <http://www.gnu.org/licenses/>.
Class
Foam::cyclicFaPatchField
Description
Foam::cyclicFaPatchField
Author
Zeljko Tukovic, FMENA
Hrvoje Jasak, Wikki Ltd.
SourceFiles
cyclicFaPatchField.C
\*---------------------------------------------------------------------------*/
#ifndef cyclicFaPatchField_H
#define cyclicFaPatchField_H
#include "coupledFaPatchField.H"
#include "cyclicLduInterfaceField.H"
#include "cyclicFaPatch.H"
#include "areaFaMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class cyclicFaPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class cyclicFaPatchField
:
virtual public cyclicLduInterfaceField,
public coupledFaPatchField<Type>
{
// Private data
//- Local reference cast into the cyclic patch
const cyclicFaPatch& cyclicPatch_;
// Private member functions
//- Return neighbour side field given internal fields
template<class Type2>
tmp<Field<Type2>> neighbourSideField
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
(
const Field<Type2>&
) const;
public:
//- Runtime type information
TypeName(cyclicFaPatch::typeName_());
// Constructors
//- Construct from patch and internal field
cyclicFaPatchField
(
const faPatch&,
const DimensionedField<Type, areaMesh>&
);
//- Construct from patch, internal field and dictionary
cyclicFaPatchField
(
const faPatch&,
const DimensionedField<Type, areaMesh>&,
const dictionary&
);
//- Construct by mapping given cyclicFaPatchField onto a new patch
cyclicFaPatchField
(
const cyclicFaPatchField<Type>&,
const faPatch&,
const DimensionedField<Type, areaMesh>&,
const faPatchFieldMapper&
);
//- Construct as copy
cyclicFaPatchField
(
const cyclicFaPatchField<Type>&
);
//- Construct and return a clone
virtual tmp<faPatchField<Type>> clone() const
return tmp<faPatchField<Type>>
(
new cyclicFaPatchField<Type>(*this)
);
}
//- Construct as copy setting internal field reference
cyclicFaPatchField
(
const cyclicFaPatchField<Type>&,
const DimensionedField<Type, areaMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<faPatchField<Type>> clone
(
const DimensionedField<Type, areaMesh>& iF
) const
{
return tmp<faPatchField<Type>>
(
new cyclicFaPatchField<Type>(*this, iF)
);
}
// Member functions
// Access
//- Return local reference cast into the cyclic patch
const cyclicFaPatch& cyclicPatch() const
{
return cyclicPatch_;
}
// Evaluation functions
//- Return neighbour coupled given internal cell data
virtual tmp<Field<Type>> patchNeighbourField() const;
// Coupled interface functionality
//- Transform neighbour field
virtual void transformCoupleField
(
const direction cmpt
) const
{
cyclicLduInterfaceField::transformCoupleField(f, cmpt);
}
//- Update result field based on interface functionality
virtual void updateInterfaceMatrix
(
const lduAddressing& lduAddr,
const label patchId,
const solveScalarField& psiInternal,
const scalarField& coeffs,
const direction cmpt,
const Pstream::commsTypes commsType
) const;
//- Update result field based on interface functionality
virtual void updateInterfaceMatrix
(
Field<Type>& result,
const bool add,
const lduAddressing& lduAddr,
const label patchId,
const Field<Type>&,
const scalarField& coeffs,
const Pstream::commsTypes commsType
) const;
//- Cyclic coupled interface functions
//- Does the patch field perform the transformation
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
virtual bool doTransform() const
{
return !(cyclicPatch_.parallel() || pTraits<Type>::rank == 0);
}
//- Return face transformation tensor
virtual const tensorField& forwardT() const
{
return cyclicPatch_.forwardT();
}
//- Return neighbour-cell transformation tensor
virtual const tensorField& reverseT() const
{
return cyclicPatch_.reverseT();
}
//- Return rank of component for transform
virtual int rank() const
{
return pTraits<Type>::rank;
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "cyclicFaPatchField.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //