internalFvFieldSource.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2023 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "internalFvFieldSource.H"
27 
28 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
29 
30 template<class Type>
32 (
34  const dictionary& dict
35 )
36 :
37  fvFieldSource<Type>(iF, dict)
38 {}
39 
40 
41 template<class Type>
43 (
44  const internalFvFieldSource<Type>& field,
46 )
47 :
48  fvFieldSource<Type>(field, iF)
49 {}
50 
51 
52 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
53 
54 template<class Type>
56 {}
57 
58 
59 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
60 
61 template<class Type>
64 {
65  // This value doesn't matter in principle, as this condition takes 100% of
66  // its value from the internal field. However, this value does, at least,
67  // need to be physical to prevent things like thermo evaluations from
68  // failing. So, just take the internal values.
69  return
71  (
72  new Field<Type>(this->internalField(), source.cells())
73  );
74 }
75 
76 
77 template<class Type>
80 {
81  return tmp<scalarField>(new scalarField(source.nCells(), scalar(1)));
82 }
83 
84 
85 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Pre-declare SubField and related Field type.
Definition: Field.H:83
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
Base class for finite-volume field sources.
Definition: fvFieldSource.H:62
Base class for finite volume sources.
Definition: fvSource.H:52
virtual labelUList cells() const =0
Return the cells that the source applies to.
virtual label nCells() const
Return the number of cells that the source applies to.
Definition: fvSource.C:66
This source condition provides the internal value.
virtual tmp< scalarField > internalCoeff(const fvSource &) const
Return the internal coefficient.
virtual ~internalFvFieldSource()
Destructor.
internalFvFieldSource(const DimensionedField< Type, volMesh > &, const dictionary &dict)
Construct from internal field and dictionary.
virtual tmp< Field< Type > > sourceValue(const fvSource &) const
Return the source value.
A class for managing temporary objects.
Definition: tmp.H:55
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dictionary dict