constantbXiIgnition.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) 2024-2026 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 "constantbXiIgnition.H"
28 
29 // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
30 
31 namespace Foam
32 {
33  namespace fv
34  {
36 
38  (
39  fvModel,
42  );
43  }
44 }
45 
46 
47 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
48 
49 void Foam::fv::constantbXiIgnition::readCoeffs(const dictionary& dict)
50 {
52 }
53 
54 
55 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
56 
58 (
59  const word& name,
60  const word& modelType,
61  const fvMesh& mesh,
62  const dictionary& dict
63 )
64 :
65  bXiTimedIgnition(name, modelType, mesh, dict),
66  zone_(mesh, coeffs(dict)),
67  strength_("strength", dimless, coeffs(dict))
68 {}
69 
70 
71 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
72 
74 (
75  const volScalarField& rho,
76  const volScalarField& b,
77  fvMatrix<scalar>& eqn
78 ) const
79 {
80  if (!igniting()) return;
81 
82  if (debug)
83  {
84  Info<< type() << ": applying source to " << eqn.psi().name() << endl;
85  }
86 
88  (
90  );
91 
92  scalarField& Sp = eqn.diag();
93  const scalarField& V = mesh().V();
94 
95  const labelList& cells = zone_.zone();
96 
97  const scalar strength = strength_.value();
98  const scalar duration = duration_.value();
99 
100  forAll(cells, i)
101  {
102  const label celli = cells[i];
103  const scalar Vc = V[celli];
104  Sp[celli] -= Vc*rhou[celli]*strength/(duration*(b[celli] + 0.001));
105  }
106 }
107 
108 
110 (
111  const polyTopoChangeMap& map
112 )
113 {
114  zone_.topoChange(map);
115 }
116 
117 
119 {
120  zone_.mapMesh(map);
121 }
122 
123 
125 (
126  const polyDistributionMap& map
127 )
128 {
129  zone_.distribute(map);
130 }
131 
132 
134 {
135  zone_.movePoints();
136  return true;
137 }
138 
139 
141 {
142  if (bXiIgnition::read(dict))
143  {
144  zone_.read(coeffs(dict));
145  readCoeffs(coeffs(dict));
146  return true;
147  }
148  else
149  {
150  return false;
151  }
152 
153  return false;
154 }
155 
156 
157 // ************************************************************************* //
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:449
Macros for easy insertion into run-time selection tables.
Generic GeometricField class.
static word groupName(Name name, const word &group)
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
void read(const dictionary &, const unitSet &defaultUnits=NullObjectRef< unitSet >())
Update the value of dimensioned<Type>
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvMatrix.H:118
VolField< Type > & psi()
Definition: fvMatrix.H:289
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:98
const DimensionedField< scalar, fvMesh > & V() const
Return cell volumes.
Finite volume model abstract base class.
Definition: fvModel.H:60
virtual bool read(const dictionary &dict)
Read source dictionary.
Definition: fvModel.C:196
Abstract base-class for timed ignition models for the Weller b-Xi combustion models.
Simple constant rate ignition model for the Weller b-Xi combustion model.
virtual bool movePoints()
Update for mesh motion.
dimensionedScalar strength_
Ignition strength.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
constantbXiIgnition(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from explicit source name and mesh.
virtual bool read(const dictionary &dict)
Read source dictionary.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
virtual void addSup(const volScalarField &rho, const volScalarField &b, fvMatrix< scalar > &eqn) const
Add ignition contribution to b equation.
scalarField & diag()
Definition: lduMatrix.C:186
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type and name.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Definition: polyMeshMap.H:51
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
static const word unburntPhaseName
Definition: ubRhoThermo.H:78
A class for handling words, derived from string.
Definition: word.H:63
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
const cellShapeList & cells
volScalarField & b
Definition: createFields.H:27
rho
Definition: pEqn.H:1
addToRunTimeSelectionTable(fvConstraint, bound, dictionary)
defineTypeNameAndDebug(bound, 0)
tmp< VolField< Type > > Sp(const volScalarField &sp, const VolField< Type > &vf)
Definition: fvcSup.C:67
Namespace for OpenFOAM.
const dimensionSet & dimless
Definition: dimensions.C:138
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:288
messageStream Info
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
labelList fv(nPoints)
dictionary dict