introvoyz042 commited on
Commit
5a600cf
·
verified ·
1 Parent(s): d081f4c

Migrated from GitHub

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +4 -0
  2. data/Allwmake +39 -0
  3. data/COPYING +687 -0
  4. data/README.org +31 -0
  5. data/applications/Allwmake +26 -0
  6. data/applications/legacy/basic/financialFoam/Make/files +3 -0
  7. data/applications/legacy/basic/financialFoam/Make/options +9 -0
  8. data/applications/legacy/basic/financialFoam/createFields.H +93 -0
  9. data/applications/legacy/basic/financialFoam/financialFoam.C +112 -0
  10. data/applications/legacy/basic/laplacianFoam/Make/files +3 -0
  11. data/applications/legacy/basic/laplacianFoam/Make/options +9 -0
  12. data/applications/legacy/basic/laplacianFoam/createFields.H +42 -0
  13. data/applications/legacy/basic/laplacianFoam/laplacianFoam.C +91 -0
  14. data/applications/legacy/basic/laplacianFoam/write.H +46 -0
  15. data/applications/legacy/combustion/PDRFoam/EaEqn.H +26 -0
  16. data/applications/legacy/combustion/PDRFoam/EauEqn.H +31 -0
  17. data/applications/legacy/combustion/PDRFoam/Make/files +52 -0
  18. data/applications/legacy/combustion/PDRFoam/Make/options +53 -0
  19. data/applications/legacy/combustion/PDRFoam/PDRFoam.C +189 -0
  20. data/applications/legacy/combustion/PDRFoam/PDRModels/XiEqModels/basicXiSubXiEq/basicXiSubXiEq.C +153 -0
  21. data/applications/legacy/combustion/PDRFoam/PDRModels/XiEqModels/basicXiSubXiEq/basicXiSubXiEq.H +145 -0
  22. data/applications/legacy/combustion/PDRFoam/PDRModels/XiGModels/basicXiSubG/basicXiSubG.C +113 -0
  23. data/applications/legacy/combustion/PDRFoam/PDRModels/XiGModels/basicXiSubG/basicXiSubG.H +135 -0
  24. data/applications/legacy/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModel.C +90 -0
  25. data/applications/legacy/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModel.H +182 -0
  26. data/applications/legacy/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C +62 -0
  27. data/applications/legacy/combustion/PDRFoam/PDRModels/dragModels/basic/basic.C +179 -0
  28. data/applications/legacy/combustion/PDRFoam/PDRModels/dragModels/basic/basic.H +166 -0
  29. data/applications/legacy/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C +210 -0
  30. data/applications/legacy/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.H +143 -0
  31. data/applications/legacy/combustion/PDRFoam/StCorr.H +93 -0
  32. data/applications/legacy/combustion/PDRFoam/StCourantNo.H +50 -0
  33. data/applications/legacy/combustion/PDRFoam/UEqn.H +21 -0
  34. data/applications/legacy/combustion/PDRFoam/XiModels/XiEqModels/Gulder/Gulder.C +109 -0
  35. data/applications/legacy/combustion/PDRFoam/XiModels/XiEqModels/Gulder/Gulder.H +121 -0
  36. data/applications/legacy/combustion/PDRFoam/XiModels/XiEqModels/SCOPEBlendXiEq/SCOPEBlendXiEq.C +92 -0
  37. data/applications/legacy/combustion/PDRFoam/XiModels/XiEqModels/SCOPEBlendXiEq/SCOPEBlendXiEq.H +120 -0
  38. data/applications/legacy/combustion/PDRFoam/XiModels/XiEqModels/SCOPEXiEq/SCOPEXiEq.C +163 -0
  39. data/applications/legacy/combustion/PDRFoam/XiModels/XiEqModels/SCOPEXiEq/SCOPEXiEq.H +135 -0
  40. data/applications/legacy/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModel.C +165 -0
  41. data/applications/legacy/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModel.H +167 -0
  42. data/applications/legacy/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModelNew.C +60 -0
  43. data/applications/legacy/combustion/PDRFoam/XiModels/XiEqModels/instabilityXiEq/instabilityXiEq.C +82 -0
  44. data/applications/legacy/combustion/PDRFoam/XiModels/XiEqModels/instabilityXiEq/instabilityXiEq.H +116 -0
  45. data/applications/legacy/combustion/PDRFoam/XiModels/XiGModels/KTS/KTS.C +87 -0
  46. data/applications/legacy/combustion/PDRFoam/XiModels/XiGModels/KTS/KTS.H +111 -0
  47. data/applications/legacy/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModel.C +76 -0
  48. data/applications/legacy/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModel.H +162 -0
  49. data/applications/legacy/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModelNew.C +60 -0
  50. data/applications/legacy/combustion/PDRFoam/XiModels/XiGModels/instabilityG/instabilityG.C +96 -0
.gitattributes CHANGED
@@ -58,3 +58,7 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
58
  # Video files - compressed
59
  *.mp4 filter=lfs diff=lfs merge=lfs -text
60
  *.webm filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
58
  # Video files - compressed
59
  *.mp4 filter=lfs diff=lfs merge=lfs -text
60
  *.webm filter=lfs diff=lfs merge=lfs -text
61
+ data/applications/utilities/mesh/conversion/kivaToFoam/kiva3v-valves.pdf filter=lfs diff=lfs merge=lfs -text
62
+ data/doc/Guides/OpenFOAMUserGuide-A4.pdf filter=lfs diff=lfs merge=lfs -text
63
+ data/doc/Guides/OpenFOAMUserGuide-USletter.pdf filter=lfs diff=lfs merge=lfs -text
64
+ data/tutorials/incompressibleVoF/planingHullW3/constant/geometry/w3_orig.stl filter=lfs diff=lfs merge=lfs -text
data/Allwmake ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/sh
2
+ cd ${0%/*} || exit 1 # Run from this directory
3
+
4
+ # Parse arguments for library compilation
5
+ . wmake/scripts/AllwmakeParseArguments
6
+
7
+ # Perform various checks
8
+ wmakeCheckPwd "$WM_PROJECT_DIR" || {
9
+ echo "Allwmake error: Current directory is not \$WM_PROJECT_DIR"
10
+ echo " The environment variables are inconsistent with the installation."
11
+ echo " Check the OpenFOAM entries in your dot-files and source them."
12
+ exit 1
13
+ }
14
+
15
+ [ -n "$FOAM_EXT_LIBBIN" ] || {
16
+ echo "Allwmake error: FOAM_EXT_LIBBIN not set"
17
+ echo " Check the OpenFOAM entries in your dot-files and source them."
18
+ exit 1
19
+ }
20
+
21
+ # Compile wmake support applications
22
+ (cd wmake/src && make)
23
+
24
+ # Compile ThirdParty libraries and applications
25
+ if [ -d "$WM_THIRD_PARTY_DIR" ]
26
+ then
27
+ $WM_THIRD_PARTY_DIR/Allwmake
28
+ else
29
+ echo "Allwmake: no ThirdParty directory found - skipping"
30
+ fi
31
+
32
+ # Compile OpenFOAM libraries and applications
33
+ src/Allwmake $targetType $*
34
+
35
+ # Compile OpenFOAM libraries and applications
36
+ applications/Allwmake $targetType $*
37
+
38
+
39
+ #------------------------------------------------------------------------------
data/COPYING ADDED
@@ -0,0 +1,687 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU GENERAL PUBLIC LICENSE
2
+
3
+ OpenFOAM is Copyright (C) 2011-2017 OpenFOAM Foundation
4
+ Contact: OpenFOAM Foundation, http://openfoam.org/contact
5
+
6
+ You may use, distribute and copy the OpenFOAM CFD Toolbox under the terms
7
+ of GNU General Public License version 3, which is displayed below, or
8
+ (at your option) any later version.
9
+
10
+ -------------------------------------------------------------------------
11
+
12
+ GNU GENERAL PUBLIC LICENSE
13
+ Version 3, 29 June 2007
14
+
15
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
16
+ Everyone is permitted to copy and distribute verbatim copies
17
+ of this license document, but changing it is not allowed.
18
+
19
+ Preamble
20
+
21
+ The GNU General Public License is a free, copyleft license for
22
+ software and other kinds of works.
23
+
24
+ The licenses for most software and other practical works are designed
25
+ to take away your freedom to share and change the works. By contrast,
26
+ the GNU General Public License is intended to guarantee your freedom to
27
+ share and change all versions of a program--to make sure it remains free
28
+ software for all its users. We, the Free Software Foundation, use the
29
+ GNU General Public License for most of our software; it applies also to
30
+ any other work released this way by its authors. You can apply it to
31
+ your programs, too.
32
+
33
+ When we speak of free software, we are referring to freedom, not
34
+ price. Our General Public Licenses are designed to make sure that you
35
+ have the freedom to distribute copies of free software (and charge for
36
+ them if you wish), that you receive source code or can get it if you
37
+ want it, that you can change the software or use pieces of it in new
38
+ free programs, and that you know you can do these things.
39
+
40
+ To protect your rights, we need to prevent others from denying you
41
+ these rights or asking you to surrender the rights. Therefore, you have
42
+ certain responsibilities if you distribute copies of the software, or if
43
+ you modify it: responsibilities to respect the freedom of others.
44
+
45
+ For example, if you distribute copies of such a program, whether
46
+ gratis or for a fee, you must pass on to the recipients the same
47
+ freedoms that you received. You must make sure that they, too, receive
48
+ or can get the source code. And you must show them these terms so they
49
+ know their rights.
50
+
51
+ Developers that use the GNU GPL protect your rights with two steps:
52
+ (1) assert copyright on the software, and (2) offer you this License
53
+ giving you legal permission to copy, distribute and/or modify it.
54
+
55
+ For the developers' and authors' protection, the GPL clearly explains
56
+ that there is no warranty for this free software. For both users' and
57
+ authors' sake, the GPL requires that modified versions be marked as
58
+ changed, so that their problems will not be attributed erroneously to
59
+ authors of previous versions.
60
+
61
+ Some devices are designed to deny users access to install or run
62
+ modified versions of the software inside them, although the manufacturer
63
+ can do so. This is fundamentally incompatible with the aim of
64
+ protecting users' freedom to change the software. The systematic
65
+ pattern of such abuse occurs in the area of products for individuals to
66
+ use, which is precisely where it is most unacceptable. Therefore, we
67
+ have designed this version of the GPL to prohibit the practice for those
68
+ products. If such problems arise substantially in other domains, we
69
+ stand ready to extend this provision to those domains in future versions
70
+ of the GPL, as needed to protect the freedom of users.
71
+
72
+ Finally, every program is threatened constantly by software patents.
73
+ States should not allow patents to restrict development and use of
74
+ software on general-purpose computers, but in those that do, we wish to
75
+ avoid the special danger that patents applied to a free program could
76
+ make it effectively proprietary. To prevent this, the GPL assures that
77
+ patents cannot be used to render the program non-free.
78
+
79
+ The precise terms and conditions for copying, distribution and
80
+ modification follow.
81
+
82
+ TERMS AND CONDITIONS
83
+
84
+ 0. Definitions.
85
+
86
+ "This License" refers to version 3 of the GNU General Public License.
87
+
88
+ "Copyright" also means copyright-like laws that apply to other kinds of
89
+ works, such as semiconductor masks.
90
+
91
+ "The Program" refers to any copyrightable work licensed under this
92
+ License. Each licensee is addressed as "you". "Licensees" and
93
+ "recipients" may be individuals or organizations.
94
+
95
+ To "modify" a work means to copy from or adapt all or part of the work
96
+ in a fashion requiring copyright permission, other than the making of an
97
+ exact copy. The resulting work is called a "modified version" of the
98
+ earlier work or a work "based on" the earlier work.
99
+
100
+ A "covered work" means either the unmodified Program or a work based
101
+ on the Program.
102
+
103
+ To "propagate" a work means to do anything with it that, without
104
+ permission, would make you directly or secondarily liable for
105
+ infringement under applicable copyright law, except executing it on a
106
+ computer or modifying a private copy. Propagation includes copying,
107
+ distribution (with or without modification), making available to the
108
+ public, and in some countries other activities as well.
109
+
110
+ To "convey" a work means any kind of propagation that enables other
111
+ parties to make or receive copies. Mere interaction with a user through
112
+ a computer network, with no transfer of a copy, is not conveying.
113
+
114
+ An interactive user interface displays "Appropriate Legal Notices"
115
+ to the extent that it includes a convenient and prominently visible
116
+ feature that (1) displays an appropriate copyright notice, and (2)
117
+ tells the user that there is no warranty for the work (except to the
118
+ extent that warranties are provided), that licensees may convey the
119
+ work under this License, and how to view a copy of this License. If
120
+ the interface presents a list of user commands or options, such as a
121
+ menu, a prominent item in the list meets this criterion.
122
+
123
+ 1. Source Code.
124
+
125
+ The "source code" for a work means the preferred form of the work
126
+ for making modifications to it. "Object code" means any non-source
127
+ form of a work.
128
+
129
+ A "Standard Interface" means an interface that either is an official
130
+ standard defined by a recognized standards body, or, in the case of
131
+ interfaces specified for a particular programming language, one that
132
+ is widely used among developers working in that language.
133
+
134
+ The "System Libraries" of an executable work include anything, other
135
+ than the work as a whole, that (a) is included in the normal form of
136
+ packaging a Major Component, but which is not part of that Major
137
+ Component, and (b) serves only to enable use of the work with that
138
+ Major Component, or to implement a Standard Interface for which an
139
+ implementation is available to the public in source code form. A
140
+ "Major Component", in this context, means a major essential component
141
+ (kernel, window system, and so on) of the specific operating system
142
+ (if any) on which the executable work runs, or a compiler used to
143
+ produce the work, or an object code interpreter used to run it.
144
+
145
+ The "Corresponding Source" for a work in object code form means all
146
+ the source code needed to generate, install, and (for an executable
147
+ work) run the object code and to modify the work, including scripts to
148
+ control those activities. However, it does not include the work's
149
+ System Libraries, or general-purpose tools or generally available free
150
+ programs which are used unmodified in performing those activities but
151
+ which are not part of the work. For example, Corresponding Source
152
+ includes interface definition files associated with source files for
153
+ the work, and the source code for shared libraries and dynamically
154
+ linked subprograms that the work is specifically designed to require,
155
+ such as by intimate data communication or control flow between those
156
+ subprograms and other parts of the work.
157
+
158
+ The Corresponding Source need not include anything that users
159
+ can regenerate automatically from other parts of the Corresponding
160
+ Source.
161
+
162
+ The Corresponding Source for a work in source code form is that
163
+ same work.
164
+
165
+ 2. Basic Permissions.
166
+
167
+ All rights granted under this License are granted for the term of
168
+ copyright on the Program, and are irrevocable provided the stated
169
+ conditions are met. This License explicitly affirms your unlimited
170
+ permission to run the unmodified Program. The output from running a
171
+ covered work is covered by this License only if the output, given its
172
+ content, constitutes a covered work. This License acknowledges your
173
+ rights of fair use or other equivalent, as provided by copyright law.
174
+
175
+ You may make, run and propagate covered works that you do not
176
+ convey, without conditions so long as your license otherwise remains
177
+ in force. You may convey covered works to others for the sole purpose
178
+ of having them make modifications exclusively for you, or provide you
179
+ with facilities for running those works, provided that you comply with
180
+ the terms of this License in conveying all material for which you do
181
+ not control copyright. Those thus making or running the covered works
182
+ for you must do so exclusively on your behalf, under your direction
183
+ and control, on terms that prohibit them from making any copies of
184
+ your copyrighted material outside their relationship with you.
185
+
186
+ Conveying under any other circumstances is permitted solely under
187
+ the conditions stated below. Sublicensing is not allowed; section 10
188
+ makes it unnecessary.
189
+
190
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
191
+
192
+ No covered work shall be deemed part of an effective technological
193
+ measure under any applicable law fulfilling obligations under article
194
+ 11 of the WIPO copyright treaty adopted on 20 December 1996, or
195
+ similar laws prohibiting or restricting circumvention of such
196
+ measures.
197
+
198
+ When you convey a covered work, you waive any legal power to forbid
199
+ circumvention of technological measures to the extent such circumvention
200
+ is effected by exercising rights under this License with respect to
201
+ the covered work, and you disclaim any intention to limit operation or
202
+ modification of the work as a means of enforcing, against the work's
203
+ users, your or third parties' legal rights to forbid circumvention of
204
+ technological measures.
205
+
206
+ 4. Conveying Verbatim Copies.
207
+
208
+ You may convey verbatim copies of the Program's source code as you
209
+ receive it, in any medium, provided that you conspicuously and
210
+ appropriately publish on each copy an appropriate copyright notice;
211
+ keep intact all notices stating that this License and any
212
+ non-permissive terms added in accord with section 7 apply to the code;
213
+ keep intact all notices of the absence of any warranty; and give all
214
+ recipients a copy of this License along with the Program.
215
+
216
+ You may charge any price or no price for each copy that you convey,
217
+ and you may offer support or warranty protection for a fee.
218
+
219
+ 5. Conveying Modified Source Versions.
220
+
221
+ You may convey a work based on the Program, or the modifications to
222
+ produce it from the Program, in the form of source code under the
223
+ terms of section 4, provided that you also meet all of these conditions:
224
+
225
+ a) The work must carry prominent notices stating that you modified
226
+ it, and giving a relevant date.
227
+
228
+ b) The work must carry prominent notices stating that it is
229
+ released under this License and any conditions added under section
230
+ 7. This requirement modifies the requirement in section 4 to
231
+ "keep intact all notices".
232
+
233
+ c) You must license the entire work, as a whole, under this
234
+ License to anyone who comes into possession of a copy. This
235
+ License will therefore apply, along with any applicable section 7
236
+ additional terms, to the whole of the work, and all its parts,
237
+ regardless of how they are packaged. This License gives no
238
+ permission to license the work in any other way, but it does not
239
+ invalidate such permission if you have separately received it.
240
+
241
+ d) If the work has interactive user interfaces, each must display
242
+ Appropriate Legal Notices; however, if the Program has interactive
243
+ interfaces that do not display Appropriate Legal Notices, your
244
+ work need not make them do so.
245
+
246
+ A compilation of a covered work with other separate and independent
247
+ works, which are not by their nature extensions of the covered work,
248
+ and which are not combined with it such as to form a larger program,
249
+ in or on a volume of a storage or distribution medium, is called an
250
+ "aggregate" if the compilation and its resulting copyright are not
251
+ used to limit the access or legal rights of the compilation's users
252
+ beyond what the individual works permit. Inclusion of a covered work
253
+ in an aggregate does not cause this License to apply to the other
254
+ parts of the aggregate.
255
+
256
+ 6. Conveying Non-Source Forms.
257
+
258
+ You may convey a covered work in object code form under the terms
259
+ of sections 4 and 5, provided that you also convey the
260
+ machine-readable Corresponding Source under the terms of this License,
261
+ in one of these ways:
262
+
263
+ a) Convey the object code in, or embodied in, a physical product
264
+ (including a physical distribution medium), accompanied by the
265
+ Corresponding Source fixed on a durable physical medium
266
+ customarily used for software interchange.
267
+
268
+ b) Convey the object code in, or embodied in, a physical product
269
+ (including a physical distribution medium), accompanied by a
270
+ written offer, valid for at least three years and valid for as
271
+ long as you offer spare parts or customer support for that product
272
+ model, to give anyone who possesses the object code either (1) a
273
+ copy of the Corresponding Source for all the software in the
274
+ product that is covered by this License, on a durable physical
275
+ medium customarily used for software interchange, for a price no
276
+ more than your reasonable cost of physically performing this
277
+ conveying of source, or (2) access to copy the
278
+ Corresponding Source from a network server at no charge.
279
+
280
+ c) Convey individual copies of the object code with a copy of the
281
+ written offer to provide the Corresponding Source. This
282
+ alternative is allowed only occasionally and noncommercially, and
283
+ only if you received the object code with such an offer, in accord
284
+ with subsection 6b.
285
+
286
+ d) Convey the object code by offering access from a designated
287
+ place (gratis or for a charge), and offer equivalent access to the
288
+ Corresponding Source in the same way through the same place at no
289
+ further charge. You need not require recipients to copy the
290
+ Corresponding Source along with the object code. If the place to
291
+ copy the object code is a network server, the Corresponding Source
292
+ may be on a different server (operated by you or a third party)
293
+ that supports equivalent copying facilities, provided you maintain
294
+ clear directions next to the object code saying where to find the
295
+ Corresponding Source. Regardless of what server hosts the
296
+ Corresponding Source, you remain obligated to ensure that it is
297
+ available for as long as needed to satisfy these requirements.
298
+
299
+ e) Convey the object code using peer-to-peer transmission, provided
300
+ you inform other peers where the object code and Corresponding
301
+ Source of the work are being offered to the general public at no
302
+ charge under subsection 6d.
303
+
304
+ A separable portion of the object code, whose source code is excluded
305
+ from the Corresponding Source as a System Library, need not be
306
+ included in conveying the object code work.
307
+
308
+ A "User Product" is either (1) a "consumer product", which means any
309
+ tangible personal property which is normally used for personal, family,
310
+ or household purposes, or (2) anything designed or sold for incorporation
311
+ into a dwelling. In determining whether a product is a consumer product,
312
+ doubtful cases shall be resolved in favor of coverage. For a particular
313
+ product received by a particular user, "normally used" refers to a
314
+ typical or common use of that class of product, regardless of the status
315
+ of the particular user or of the way in which the particular user
316
+ actually uses, or expects or is expected to use, the product. A product
317
+ is a consumer product regardless of whether the product has substantial
318
+ commercial, industrial or non-consumer uses, unless such uses represent
319
+ the only significant mode of use of the product.
320
+
321
+ "Installation Information" for a User Product means any methods,
322
+ procedures, authorization keys, or other information required to install
323
+ and execute modified versions of a covered work in that User Product from
324
+ a modified version of its Corresponding Source. The information must
325
+ suffice to ensure that the continued functioning of the modified object
326
+ code is in no case prevented or interfered with solely because
327
+ modification has been made.
328
+
329
+ If you convey an object code work under this section in, or with, or
330
+ specifically for use in, a User Product, and the conveying occurs as
331
+ part of a transaction in which the right of possession and use of the
332
+ User Product is transferred to the recipient in perpetuity or for a
333
+ fixed term (regardless of how the transaction is characterized), the
334
+ Corresponding Source conveyed under this section must be accompanied
335
+ by the Installation Information. But this requirement does not apply
336
+ if neither you nor any third party retains the ability to install
337
+ modified object code on the User Product (for example, the work has
338
+ been installed in ROM).
339
+
340
+ The requirement to provide Installation Information does not include a
341
+ requirement to continue to provide support service, warranty, or updates
342
+ for a work that has been modified or installed by the recipient, or for
343
+ the User Product in which it has been modified or installed. Access to a
344
+ network may be denied when the modification itself materially and
345
+ adversely affects the operation of the network or violates the rules and
346
+ protocols for communication across the network.
347
+
348
+ Corresponding Source conveyed, and Installation Information provided,
349
+ in accord with this section must be in a format that is publicly
350
+ documented (and with an implementation available to the public in
351
+ source code form), and must require no special password or key for
352
+ unpacking, reading or copying.
353
+
354
+ 7. Additional Terms.
355
+
356
+ "Additional permissions" are terms that supplement the terms of this
357
+ License by making exceptions from one or more of its conditions.
358
+ Additional permissions that are applicable to the entire Program shall
359
+ be treated as though they were included in this License, to the extent
360
+ that they are valid under applicable law. If additional permissions
361
+ apply only to part of the Program, that part may be used separately
362
+ under those permissions, but the entire Program remains governed by
363
+ this License without regard to the additional permissions.
364
+
365
+ When you convey a copy of a covered work, you may at your option
366
+ remove any additional permissions from that copy, or from any part of
367
+ it. (Additional permissions may be written to require their own
368
+ removal in certain cases when you modify the work.) You may place
369
+ additional permissions on material, added by you to a covered work,
370
+ for which you have or can give appropriate copyright permission.
371
+
372
+ Notwithstanding any other provision of this License, for material you
373
+ add to a covered work, you may (if authorized by the copyright holders of
374
+ that material) supplement the terms of this License with terms:
375
+
376
+ a) Disclaiming warranty or limiting liability differently from the
377
+ terms of sections 15 and 16 of this License; or
378
+
379
+ b) Requiring preservation of specified reasonable legal notices or
380
+ author attributions in that material or in the Appropriate Legal
381
+ Notices displayed by works containing it; or
382
+
383
+ c) Prohibiting misrepresentation of the origin of that material, or
384
+ requiring that modified versions of such material be marked in
385
+ reasonable ways as different from the original version; or
386
+
387
+ d) Limiting the use for publicity purposes of names of licensors or
388
+ authors of the material; or
389
+
390
+ e) Declining to grant rights under trademark law for use of some
391
+ trade names, trademarks, or service marks; or
392
+
393
+ f) Requiring indemnification of licensors and authors of that
394
+ material by anyone who conveys the material (or modified versions of
395
+ it) with contractual assumptions of liability to the recipient, for
396
+ any liability that these contractual assumptions directly impose on
397
+ those licensors and authors.
398
+
399
+ All other non-permissive additional terms are considered "further
400
+ restrictions" within the meaning of section 10. If the Program as you
401
+ received it, or any part of it, contains a notice stating that it is
402
+ governed by this License along with a term that is a further
403
+ restriction, you may remove that term. If a license document contains
404
+ a further restriction but permits relicensing or conveying under this
405
+ License, you may add to a covered work material governed by the terms
406
+ of that license document, provided that the further restriction does
407
+ not survive such relicensing or conveying.
408
+
409
+ If you add terms to a covered work in accord with this section, you
410
+ must place, in the relevant source files, a statement of the
411
+ additional terms that apply to those files, or a notice indicating
412
+ where to find the applicable terms.
413
+
414
+ Additional terms, permissive or non-permissive, may be stated in the
415
+ form of a separately written license, or stated as exceptions;
416
+ the above requirements apply either way.
417
+
418
+ 8. Termination.
419
+
420
+ You may not propagate or modify a covered work except as expressly
421
+ provided under this License. Any attempt otherwise to propagate or
422
+ modify it is void, and will automatically terminate your rights under
423
+ this License (including any patent licenses granted under the third
424
+ paragraph of section 11).
425
+
426
+ However, if you cease all violation of this License, then your
427
+ license from a particular copyright holder is reinstated (a)
428
+ provisionally, unless and until the copyright holder explicitly and
429
+ finally terminates your license, and (b) permanently, if the copyright
430
+ holder fails to notify you of the violation by some reasonable means
431
+ prior to 60 days after the cessation.
432
+
433
+ Moreover, your license from a particular copyright holder is
434
+ reinstated permanently if the copyright holder notifies you of the
435
+ violation by some reasonable means, this is the first time you have
436
+ received notice of violation of this License (for any work) from that
437
+ copyright holder, and you cure the violation prior to 30 days after
438
+ your receipt of the notice.
439
+
440
+ Termination of your rights under this section does not terminate the
441
+ licenses of parties who have received copies or rights from you under
442
+ this License. If your rights have been terminated and not permanently
443
+ reinstated, you do not qualify to receive new licenses for the same
444
+ material under section 10.
445
+
446
+ 9. Acceptance Not Required for Having Copies.
447
+
448
+ You are not required to accept this License in order to receive or
449
+ run a copy of the Program. Ancillary propagation of a covered work
450
+ occurring solely as a consequence of using peer-to-peer transmission
451
+ to receive a copy likewise does not require acceptance. However,
452
+ nothing other than this License grants you permission to propagate or
453
+ modify any covered work. These actions infringe copyright if you do
454
+ not accept this License. Therefore, by modifying or propagating a
455
+ covered work, you indicate your acceptance of this License to do so.
456
+
457
+ 10. Automatic Licensing of Downstream Recipients.
458
+
459
+ Each time you convey a covered work, the recipient automatically
460
+ receives a license from the original licensors, to run, modify and
461
+ propagate that work, subject to this License. You are not responsible
462
+ for enforcing compliance by third parties with this License.
463
+
464
+ An "entity transaction" is a transaction transferring control of an
465
+ organization, or substantially all assets of one, or subdividing an
466
+ organization, or merging organizations. If propagation of a covered
467
+ work results from an entity transaction, each party to that
468
+ transaction who receives a copy of the work also receives whatever
469
+ licenses to the work the party's predecessor in interest had or could
470
+ give under the previous paragraph, plus a right to possession of the
471
+ Corresponding Source of the work from the predecessor in interest, if
472
+ the predecessor has it or can get it with reasonable efforts.
473
+
474
+ You may not impose any further restrictions on the exercise of the
475
+ rights granted or affirmed under this License. For example, you may
476
+ not impose a license fee, royalty, or other charge for exercise of
477
+ rights granted under this License, and you may not initiate litigation
478
+ (including a cross-claim or counterclaim in a lawsuit) alleging that
479
+ any patent claim is infringed by making, using, selling, offering for
480
+ sale, or importing the Program or any portion of it.
481
+
482
+ 11. Patents.
483
+
484
+ A "contributor" is a copyright holder who authorizes use under this
485
+ License of the Program or a work on which the Program is based. The
486
+ work thus licensed is called the contributor's "contributor version".
487
+
488
+ A contributor's "essential patent claims" are all patent claims
489
+ owned or controlled by the contributor, whether already acquired or
490
+ hereafter acquired, that would be infringed by some manner, permitted
491
+ by this License, of making, using, or selling its contributor version,
492
+ but do not include claims that would be infringed only as a
493
+ consequence of further modification of the contributor version. For
494
+ purposes of this definition, "control" includes the right to grant
495
+ patent sublicenses in a manner consistent with the requirements of
496
+ this License.
497
+
498
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
499
+ patent license under the contributor's essential patent claims, to
500
+ make, use, sell, offer for sale, import and otherwise run, modify and
501
+ propagate the contents of its contributor version.
502
+
503
+ In the following three paragraphs, a "patent license" is any express
504
+ agreement or commitment, however denominated, not to enforce a patent
505
+ (such as an express permission to practice a patent or covenant not to
506
+ sue for patent infringement). To "grant" such a patent license to a
507
+ party means to make such an agreement or commitment not to enforce a
508
+ patent against the party.
509
+
510
+ If you convey a covered work, knowingly relying on a patent license,
511
+ and the Corresponding Source of the work is not available for anyone
512
+ to copy, free of charge and under the terms of this License, through a
513
+ publicly available network server or other readily accessible means,
514
+ then you must either (1) cause the Corresponding Source to be so
515
+ available, or (2) arrange to deprive yourself of the benefit of the
516
+ patent license for this particular work, or (3) arrange, in a manner
517
+ consistent with the requirements of this License, to extend the patent
518
+ license to downstream recipients. "Knowingly relying" means you have
519
+ actual knowledge that, but for the patent license, your conveying the
520
+ covered work in a country, or your recipient's use of the covered work
521
+ in a country, would infringe one or more identifiable patents in that
522
+ country that you have reason to believe are valid.
523
+
524
+ If, pursuant to or in connection with a single transaction or
525
+ arrangement, you convey, or propagate by procuring conveyance of, a
526
+ covered work, and grant a patent license to some of the parties
527
+ receiving the covered work authorizing them to use, propagate, modify
528
+ or convey a specific copy of the covered work, then the patent license
529
+ you grant is automatically extended to all recipients of the covered
530
+ work and works based on it.
531
+
532
+ A patent license is "discriminatory" if it does not include within
533
+ the scope of its coverage, prohibits the exercise of, or is
534
+ conditioned on the non-exercise of one or more of the rights that are
535
+ specifically granted under this License. You may not convey a covered
536
+ work if you are a party to an arrangement with a third party that is
537
+ in the business of distributing software, under which you make payment
538
+ to the third party based on the extent of your activity of conveying
539
+ the work, and under which the third party grants, to any of the
540
+ parties who would receive the covered work from you, a discriminatory
541
+ patent license (a) in connection with copies of the covered work
542
+ conveyed by you (or copies made from those copies), or (b) primarily
543
+ for and in connection with specific products or compilations that
544
+ contain the covered work, unless you entered into that arrangement,
545
+ or that patent license was granted, prior to 28 March 2007.
546
+
547
+ Nothing in this License shall be construed as excluding or limiting
548
+ any implied license or other defenses to infringement that may
549
+ otherwise be available to you under applicable patent law.
550
+
551
+ 12. No Surrender of Others' Freedom.
552
+
553
+ If conditions are imposed on you (whether by court order, agreement or
554
+ otherwise) that contradict the conditions of this License, they do not
555
+ excuse you from the conditions of this License. If you cannot convey a
556
+ covered work so as to satisfy simultaneously your obligations under this
557
+ License and any other pertinent obligations, then as a consequence you may
558
+ not convey it at all. For example, if you agree to terms that obligate you
559
+ to collect a royalty for further conveying from those to whom you convey
560
+ the Program, the only way you could satisfy both those terms and this
561
+ License would be to refrain entirely from conveying the Program.
562
+
563
+ 13. Use with the GNU Affero General Public License.
564
+
565
+ Notwithstanding any other provision of this License, you have
566
+ permission to link or combine any covered work with a work licensed
567
+ under version 3 of the GNU Affero General Public License into a single
568
+ combined work, and to convey the resulting work. The terms of this
569
+ License will continue to apply to the part which is the covered work,
570
+ but the special requirements of the GNU Affero General Public License,
571
+ section 13, concerning interaction through a network will apply to the
572
+ combination as such.
573
+
574
+ 14. Revised Versions of this License.
575
+
576
+ The Free Software Foundation may publish revised and/or new versions of
577
+ the GNU General Public License from time to time. Such new versions will
578
+ be similar in spirit to the present version, but may differ in detail to
579
+ address new problems or concerns.
580
+
581
+ Each version is given a distinguishing version number. If the
582
+ Program specifies that a certain numbered version of the GNU General
583
+ Public License "or any later version" applies to it, you have the
584
+ option of following the terms and conditions either of that numbered
585
+ version or of any later version published by the Free Software
586
+ Foundation. If the Program does not specify a version number of the
587
+ GNU General Public License, you may choose any version ever published
588
+ by the Free Software Foundation.
589
+
590
+ If the Program specifies that a proxy can decide which future
591
+ versions of the GNU General Public License can be used, that proxy's
592
+ public statement of acceptance of a version permanently authorizes you
593
+ to choose that version for the Program.
594
+
595
+ Later license versions may give you additional or different
596
+ permissions. However, no additional obligations are imposed on any
597
+ author or copyright holder as a result of your choosing to follow a
598
+ later version.
599
+
600
+ 15. Disclaimer of Warranty.
601
+
602
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
603
+ APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
604
+ HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
605
+ OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
606
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
607
+ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
608
+ IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
609
+ ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
610
+
611
+ 16. Limitation of Liability.
612
+
613
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
614
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
615
+ THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
616
+ GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
617
+ USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
618
+ DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
619
+ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
620
+ EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
621
+ SUCH DAMAGES.
622
+
623
+ 17. Interpretation of Sections 15 and 16.
624
+
625
+ If the disclaimer of warranty and limitation of liability provided
626
+ above cannot be given local legal effect according to their terms,
627
+ reviewing courts shall apply local law that most closely approximates
628
+ an absolute waiver of all civil liability in connection with the
629
+ Program, unless a warranty or assumption of liability accompanies a
630
+ copy of the Program in return for a fee.
631
+
632
+ END OF TERMS AND CONDITIONS
633
+
634
+ How to Apply These Terms to Your New Programs
635
+
636
+ If you develop a new program, and you want it to be of the greatest
637
+ possible use to the public, the best way to achieve this is to make it
638
+ free software which everyone can redistribute and change under these terms.
639
+
640
+ To do so, attach the following notices to the program. It is safest
641
+ to attach them to the start of each source file to most effectively
642
+ state the exclusion of warranty; and each file should have at least
643
+ the "copyright" line and a pointer to where the full notice is found.
644
+
645
+ <one line to give the program's name and a brief idea of what it does.>
646
+ Copyright (C) <year> <name of author>
647
+
648
+ This program is free software: you can redistribute it and/or modify
649
+ it under the terms of the GNU General Public License as published by
650
+ the Free Software Foundation, either version 3 of the License, or
651
+ (at your option) any later version.
652
+
653
+ This program is distributed in the hope that it will be useful,
654
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
655
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
656
+ GNU General Public License for more details.
657
+
658
+ You should have received a copy of the GNU General Public License
659
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
660
+
661
+ Also add information on how to contact you by electronic and paper mail.
662
+
663
+ If the program does terminal interaction, make it output a short
664
+ notice like this when it starts in an interactive mode:
665
+
666
+ <program> Copyright (C) <year> <name of author>
667
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
668
+ This is free software, and you are welcome to redistribute it
669
+ under certain conditions; type `show c' for details.
670
+
671
+ The hypothetical commands `show w' and `show c' should show the appropriate
672
+ parts of the General Public License. Of course, your program's commands
673
+ might be different; for a GUI interface, you would use an "about box".
674
+
675
+ You should also get your employer (if you work as a programmer) or school,
676
+ if any, to sign a "copyright disclaimer" for the program, if necessary.
677
+ For more information on this, and how to apply and follow the GNU GPL, see
678
+ <http://www.gnu.org/licenses/>.
679
+
680
+ The GNU General Public License does not permit incorporating your program
681
+ into proprietary programs. If your program is a subroutine library, you
682
+ may consider it more useful to permit linking proprietary applications with
683
+ the library. If this is what you want to do, use the GNU Lesser General
684
+ Public License instead of this License. But first, please read
685
+ <http://www.gnu.org/philosophy/why-not-lgpl.html>.
686
+
687
+ -------------------------------------------------------------------------
data/README.org ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- mode: org; -*-
2
+ #
3
+ #+TITLE: README for [[http://openfoam.org/download/source][OpenFOAM-dev]]
4
+ #+AUTHOR: The OpenFOAM Foundation
5
+ #+DATE: 14th July 2026
6
+ #+LINK: http://openfoam.org
7
+ #+OPTIONS: author:nil ^:{}
8
+ # Copyright (c) 2015-2026 OpenFOAM Foundation.
9
+
10
+ * About OpenFOAM
11
+ OpenFOAM is a free, open source computational fluid dynamics (CFD) software
12
+ package released by the OpenFOAM Foundation. It has a large user base across
13
+ most areas of engineering and science, from both commercial and academic
14
+ organisations. OpenFOAM has an extensive range of features to solve anything
15
+ from complex fluid flows involving chemical reactions, turbulence and heat
16
+ transfer, to solid dynamics and electromagnetics.
17
+
18
+ * Copyright
19
+ OpenFOAM is free software: you can redistribute it and/or modify it under the
20
+ terms of the GNU General Public License as published by the Free Software
21
+ Foundation, either version 3 of the License, or (at your option) any later
22
+ version. See the file =COPYING= in this directory or
23
+ [[http://www.gnu.org/licenses/]], for a description of the GNU General Public
24
+ License terms under which you can copy the files.
25
+
26
+ * [[https://openfoam.org/download/source][Download and installation instructions]]
27
+ * [[https://openfoam.org/resources][Documentation]]
28
+ * [[https://cpp.openfoam.org/dev][Source code documentation]]
29
+ * [[https://openfoam.org/dev/coding-style-guide][OpenFOAM C++ Style Guide]]
30
+ * [[https://bugs.openfoam.org][Reporting bugs in OpenFOAM]]
31
+ * [[https://openfoam.org/contact][Contacting the OpenFOAM Foundation]]
data/applications/Allwmake ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/sh
2
+ cd ${0%/*} || exit 1 # Run from this directory
3
+
4
+ # Parse arguments for library compilation
5
+ . ../wmake/scripts/AllwmakeParseArguments
6
+
7
+ # Perform various checks
8
+ wmakeCheckPwd "$WM_PROJECT_DIR/applications" || {
9
+ echo "Allwmake error: Current directory is not \$WM_PROJECT_DIR/applications"
10
+ echo " The environment variables are inconsistent with the installation."
11
+ echo " Check the OpenFOAM entries in your dot-files and source them."
12
+ exit 1
13
+ }
14
+
15
+ [ -n "$FOAM_EXT_LIBBIN" ] || {
16
+ echo "Allwmake error: FOAM_EXT_LIBBIN not set"
17
+ echo " Check the OpenFOAM entries in your dot-files and source them."
18
+ exit 1
19
+ }
20
+
21
+ wmake -all $targetType solvers
22
+ modules/Allwmake $targetType $*
23
+ wmake -all $targetType legacy
24
+ wmake -all $targetType utilities
25
+
26
+ #------------------------------------------------------------------------------
data/applications/legacy/basic/financialFoam/Make/files ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ financialFoam.C
2
+
3
+ EXE = $(FOAM_APPBIN)/financialFoam
data/applications/legacy/basic/financialFoam/Make/options ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ EXE_INC = \
2
+ -I$(LIB_SRC)/finiteVolume/lnInclude \
3
+ -I$(LIB_SRC)/meshTools/lnInclude \
4
+ -I$(LIB_SRC)/sampling/lnInclude
5
+
6
+ EXE_LIBS = \
7
+ -lfiniteVolume \
8
+ -lmeshTools \
9
+ -lsampling
data/applications/legacy/basic/financialFoam/createFields.H ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Info<< "Reading financial properties\n" << endl;
2
+
3
+ IOdictionary financialProperties
4
+ (
5
+ IOobject
6
+ (
7
+ "financialProperties",
8
+ runTime.constant(),
9
+ mesh,
10
+ IOobject::MUST_READ_IF_MODIFIED,
11
+ IOobject::NO_WRITE
12
+ )
13
+ );
14
+
15
+ const dimensionedScalar strike
16
+ (
17
+ "strike",
18
+ dimensions::length,
19
+ financialProperties
20
+ );
21
+ const dimensionedScalar r("r", dimless/dimensions::time, financialProperties);
22
+
23
+ const dimensionedScalar sigma
24
+ (
25
+ "sigma",
26
+ dimensionSet(0, 0, -0.5, 0, 0),
27
+ financialProperties
28
+ );
29
+
30
+ const dimensionedScalar sigmaSqr = sqr(sigma);
31
+
32
+
33
+ Info<< nl << "Reading field V" << endl;
34
+
35
+ volScalarField V
36
+ (
37
+ IOobject
38
+ (
39
+ "V",
40
+ runTime.name(),
41
+ mesh,
42
+ IOobject::MUST_READ,
43
+ IOobject::AUTO_WRITE
44
+ ),
45
+ mesh
46
+ );
47
+
48
+
49
+ surfaceVectorField Pf
50
+ (
51
+ IOobject
52
+ (
53
+ "Pf",
54
+ runTime.name(),
55
+ mesh,
56
+ IOobject::NO_READ,
57
+ IOobject::NO_WRITE
58
+ ),
59
+ mesh.Cf()
60
+ );
61
+
62
+
63
+ volVectorField P
64
+ (
65
+ IOobject
66
+ (
67
+ "P",
68
+ runTime.name(),
69
+ mesh,
70
+ IOobject::NO_READ,
71
+ IOobject::NO_WRITE
72
+ ),
73
+ mesh.C()
74
+ );
75
+
76
+ V == max
77
+ (
78
+ P.component(Foam::vector::X) - strike,
79
+ dimensionedScalar(V.dimensions(), 0)
80
+ );
81
+
82
+ volInternalScalarField delta
83
+ (
84
+ IOobject
85
+ (
86
+ "delta",
87
+ runTime.name(),
88
+ mesh,
89
+ IOobject::NO_READ,
90
+ IOobject::AUTO_WRITE
91
+ ),
92
+ fvi::grad(V)().component(Foam::vector::X)
93
+ );
data/applications/legacy/basic/financialFoam/financialFoam.C ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*---------------------------------------------------------------------------*\
2
+ ========= |
3
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
+ \\ / O peration | Website: https://openfoam.org
5
+ \\ / A nd | Copyright (C) 2011-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
+ Application
25
+ financialFoam
26
+
27
+ Description
28
+ Solves the Black-Scholes equation to price commodities.
29
+
30
+ \*---------------------------------------------------------------------------*/
31
+
32
+ #include "argList.H"
33
+ #include "timeSelector.H"
34
+ #include "setWriter.H"
35
+ #include "writeFile.H"
36
+
37
+ #include "fviGrad.H"
38
+
39
+ #include "fvmDdt.H"
40
+ #include "fvmDiv.H"
41
+ #include "fvmLaplacian.H"
42
+
43
+ using namespace Foam;
44
+
45
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
+
47
+ int main(int argc, char *argv[])
48
+ {
49
+ #define NO_CONTROL
50
+ #include "postProcess.H"
51
+
52
+ #include "setRootCaseFunctionObjects.H"
53
+ #include "createTime.H"
54
+ #include "createMesh.H"
55
+ #include "createFields.H"
56
+
57
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
58
+
59
+ Info<< nl << "Calculating value(price of commodities)" << endl;
60
+
61
+ surfaceScalarField phi("phi", (sigmaSqr - r)*(Pf & mesh.Sf()));
62
+
63
+ volScalarField DV("DV", 0.5*sigmaSqr*sqr(P.component(Foam::vector::X)));
64
+
65
+ Info<< "Starting time loop\n" << endl;
66
+
67
+ while (runTime.loop())
68
+ {
69
+ delta = fvi::grad(V)().component(Foam::vector::X);
70
+
71
+ solve
72
+ (
73
+ fvm::ddt(V)
74
+ + fvm::div(phi, V)
75
+ - fvm::Sp(fvi::div(phi), V)
76
+ - fvm::laplacian(DV, V)
77
+ ==
78
+ - fvm::Sp(r, V)
79
+ );
80
+
81
+ runTime.write();
82
+
83
+ if (runTime.writeTime())
84
+ {
85
+ setWriter::New(runTime.controlDict().lookup("graphFormat"))->write
86
+ (
87
+ runTime.globalPath()
88
+ /functionObjects::writeFile::outputPrefix
89
+ /args.executable()
90
+ /runTime.name(),
91
+
92
+ args.executable(),
93
+
94
+ coordSet(true, word::null, mesh.C().primitiveField(), "x"),
95
+
96
+ "V", V.primitiveField(),
97
+ "delta", delta.primitiveField()
98
+ );
99
+ }
100
+
101
+ Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
102
+ << " ClockTime = " << runTime.elapsedClockTime() << " s"
103
+ << nl << endl;
104
+ }
105
+
106
+ Info<< "End\n" << endl;
107
+
108
+ return 0;
109
+ }
110
+
111
+
112
+ // ************************************************************************* //
data/applications/legacy/basic/laplacianFoam/Make/files ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ laplacianFoam.C
2
+
3
+ EXE = $(FOAM_APPBIN)/laplacianFoam
data/applications/legacy/basic/laplacianFoam/Make/options ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ EXE_INC = \
2
+ -I$(LIB_SRC)/finiteVolume/lnInclude \
3
+ -I$(LIB_SRC)/meshTools/lnInclude
4
+
5
+ EXE_LIBS = \
6
+ -lfiniteVolume \
7
+ -lfvModels \
8
+ -lfvConstraints \
9
+ -lmeshTools
data/applications/legacy/basic/laplacianFoam/createFields.H ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Info<< "Reading field T\n" << endl;
2
+
3
+ volScalarField T
4
+ (
5
+ IOobject
6
+ (
7
+ "T",
8
+ runTime.name(),
9
+ mesh,
10
+ IOobject::MUST_READ,
11
+ IOobject::AUTO_WRITE
12
+ ),
13
+ mesh
14
+ );
15
+
16
+
17
+ Info<< "Reading physicalProperties\n" << endl;
18
+
19
+ IOdictionary physicalProperties
20
+ (
21
+ IOobject
22
+ (
23
+ "physicalProperties",
24
+ runTime.constant(),
25
+ mesh,
26
+ IOobject::MUST_READ_IF_MODIFIED,
27
+ IOobject::NO_WRITE
28
+ )
29
+ );
30
+
31
+
32
+ Info<< "Reading diffusivity DT\n" << endl;
33
+
34
+ const dimensionedScalar DT
35
+ (
36
+ "DT",
37
+ dimensions::kinematicViscosity,
38
+ physicalProperties
39
+ );
40
+
41
+ #include "createFvModels.H"
42
+ #include "createFvConstraints.H"
data/applications/legacy/basic/laplacianFoam/laplacianFoam.C ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*---------------------------------------------------------------------------*\
2
+ ========= |
3
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
+ \\ / O peration | Website: https://openfoam.org
5
+ \\ / A nd | Copyright (C) 2011-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
+ Application
25
+ laplacianFoam
26
+
27
+ Description
28
+ Solves a simple Laplace equation, e.g. for thermal diffusion in a solid.
29
+
30
+ \*---------------------------------------------------------------------------*/
31
+
32
+ #include "argList.H"
33
+ #include "fvModels.H"
34
+ #include "fvConstraints.H"
35
+ #include "simpleControl.H"
36
+
37
+ #include "fvmLaplacian.H"
38
+
39
+ using namespace Foam;
40
+
41
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42
+
43
+ int main(int argc, char *argv[])
44
+ {
45
+ #include "setRootCaseFunctionObjects.H"
46
+
47
+ #include "createTime.H"
48
+ #include "createMesh.H"
49
+
50
+ simpleControl simple(mesh);
51
+
52
+ #include "createFields.H"
53
+
54
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55
+
56
+ Info<< "\nCalculating temperature distribution\n" << endl;
57
+
58
+ while (simple.loop(runTime))
59
+ {
60
+ Info<< "Time = " << runTime.userTimeName() << nl << endl;
61
+
62
+ fvModels.correct();
63
+
64
+ while (simple.correctNonOrthogonal())
65
+ {
66
+ fvScalarMatrix TEqn
67
+ (
68
+ fvm::ddt(T) - fvm::laplacian(DT, T)
69
+ ==
70
+ fvModels.source(T)
71
+ );
72
+
73
+ fvConstraints.constrain(TEqn);
74
+ TEqn.solve();
75
+ fvConstraints.constrain(T);
76
+ }
77
+
78
+ #include "write.H"
79
+
80
+ Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
81
+ << " ClockTime = " << runTime.elapsedClockTime() << " s"
82
+ << nl << endl;
83
+ }
84
+
85
+ Info<< "End\n" << endl;
86
+
87
+ return 0;
88
+ }
89
+
90
+
91
+ // ************************************************************************* //
data/applications/legacy/basic/laplacianFoam/write.H ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ if (runTime.writeTime())
2
+ {
3
+ volVectorField gradT(fvc::grad(T));
4
+
5
+ volScalarField gradTx
6
+ (
7
+ IOobject
8
+ (
9
+ "gradTx",
10
+ runTime.name(),
11
+ mesh,
12
+ IOobject::NO_READ,
13
+ IOobject::AUTO_WRITE
14
+ ),
15
+ gradT.component(vector::X)
16
+ );
17
+
18
+ volScalarField gradTy
19
+ (
20
+ IOobject
21
+ (
22
+ "gradTy",
23
+ runTime.name(),
24
+ mesh,
25
+ IOobject::NO_READ,
26
+ IOobject::AUTO_WRITE
27
+ ),
28
+ gradT.component(vector::Y)
29
+ );
30
+
31
+ volScalarField gradTz
32
+ (
33
+ IOobject
34
+ (
35
+ "gradTz",
36
+ runTime.name(),
37
+ mesh,
38
+ IOobject::NO_READ,
39
+ IOobject::AUTO_WRITE
40
+ ),
41
+ gradT.component(vector::Z)
42
+ );
43
+
44
+
45
+ runTime.write();
46
+ }
data/applications/legacy/combustion/PDRFoam/EaEqn.H ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ volScalarField& hea = thermo.he();
3
+
4
+ fvScalarMatrix EaEqn
5
+ (
6
+ betav*fvm::ddt(rho, hea) + mvConvection->fvmDiv(phi, hea)
7
+ + betav()*fvi::ddt(rho, K) + fvi::div(phi, K)
8
+ + (
9
+ hea.name() == "ea"
10
+ ? fvi::div(fvc::absolute(phi, rho, U)(), p/rho)
11
+ : -betav()*dpdt
12
+ )
13
+ - fvm::laplacian(Db, hea)
14
+ + betav*fvModels.source(rho, hea)
15
+ );
16
+
17
+ EaEqn.relax();
18
+
19
+ fvConstraints.constrain(EaEqn);
20
+
21
+ EaEqn.solve();
22
+
23
+ fvConstraints.constrain(hea);
24
+
25
+ thermo.correct();
26
+ }
data/applications/legacy/combustion/PDRFoam/EauEqn.H ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ if (ign.ignited())
2
+ {
3
+ volScalarField& heau = thermo.heu();
4
+
5
+ fvScalarMatrix heauEqn
6
+ (
7
+ betav*fvm::ddt(rho, heau) + mvConvection->fvmDiv(phi, heau)
8
+ + (betav()*fvi::ddt(rho, K) + fvi::div(phi, K))*rho()/thermo.rhou()()()
9
+ + (
10
+ heau.name() == "eau"
11
+ ? eval(fvi::div(fvc::absolute(phi, rho, U)(), p/rho)
12
+ *rho()/thermo.rhou()()())
13
+ : eval(-betav()*dpdt*rho()/thermo.rhou()()())
14
+ )
15
+ - fvm::laplacian(Db, heau)
16
+
17
+ // These terms cannot be used in partially-premixed combustion due to
18
+ // the resultant inconsistency between ft and heau transport.
19
+ // A possible solution would be to solve for ftu as well as ft.
20
+ //- fvm::div(muEff*fvi::grad(b)/(b + 0.001), heau)
21
+ //+ fvm::Sp(fvi::div(muEff*fvi::grad(b)/(b + 0.001)), heau)
22
+ ==
23
+ betav*fvModels.source(rho, heau)
24
+ );
25
+
26
+ fvConstraints.constrain(heauEqn);
27
+
28
+ heauEqn.solve();
29
+
30
+ fvConstraints.constrain(heau);
31
+ }
data/applications/legacy/combustion/PDRFoam/Make/files ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ psiuMulticomponentThermo/psiuMulticomponentThermo.C
2
+ psiuMulticomponentThermo/psiuMulticomponentThermos.C
3
+
4
+ psiuMulticomponentThermo/derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.C
5
+ psiuMulticomponentThermo/derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.C
6
+ psiuMulticomponentThermo/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.C
7
+
8
+ XiModels/XiModel/XiModel.C
9
+ XiModels/XiModel/XiModelNew.C
10
+ XiModels/fixed/fixed.C
11
+ XiModels/algebraic/algebraic.C
12
+ XiModels/transport/transport.C
13
+
14
+ XiModels/XiEqModels/XiEqModel/XiEqModel.C
15
+ XiModels/XiEqModels/XiEqModel/XiEqModelNew.C
16
+ XiModels/XiEqModels/Gulder/Gulder.C
17
+ XiModels/XiEqModels/instabilityXiEq/instabilityXiEq.C
18
+ XiModels/XiEqModels/SCOPEBlendXiEq/SCOPEBlendXiEq.C
19
+ XiModels/XiEqModels/SCOPEXiEq/SCOPEXiEq.C
20
+
21
+ XiModels/XiGModels/XiGModel/XiGModel.C
22
+ XiModels/XiGModels/XiGModel/XiGModelNew.C
23
+ XiModels/XiGModels/KTS/KTS.C
24
+ XiModels/XiGModels/instabilityG/instabilityG.C
25
+
26
+ PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C
27
+
28
+ PDRModels/dragModels/PDRDragModel/PDRDragModel.C
29
+ PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C
30
+ PDRModels/dragModels/basic/basic.C
31
+
32
+ PDRModels/XiEqModels/basicXiSubXiEq/basicXiSubXiEq.C
33
+ PDRModels/XiGModels/basicXiSubG/basicXiSubG.C
34
+
35
+ laminarFlameSpeed/laminarFlameSpeed/laminarFlameSpeed.C
36
+ laminarFlameSpeed/laminarFlameSpeed/laminarFlameSpeedNew.C
37
+ laminarFlameSpeed/constant/constant.C
38
+ laminarFlameSpeed/Gulder/Gulder.C
39
+ laminarFlameSpeed/RaviPetersen/RaviPetersen.C
40
+ laminarFlameSpeed/SCOPE/SCOPELaminarFlameSpeed.C
41
+
42
+ derivedFvPatchFields/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C
43
+ derivedFvPatchFields/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.C
44
+
45
+ ignition/ignition.C
46
+ ignition/ignitionIO.C
47
+ ignition/ignitionSite.C
48
+ ignition/ignitionSiteIO.C
49
+
50
+ PDRFoam.C
51
+
52
+ EXE = $(FOAM_APPBIN)/PDRFoam
data/applications/legacy/combustion/PDRFoam/Make/options ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ EXE_INC = \
2
+ -IpsiuMulticomponentThermo \
3
+ -IpsiuMulticomponentThermo/derivedFvPatchFields/fixedUnburntEnthalpy \
4
+ -IpsiuMulticomponentThermo/derivedFvPatchFields/gradientUnburntEnthalpy \
5
+ -IpsiuMulticomponentThermo/derivedFvPatchFields/mixedUnburntEnthalpy \
6
+ -IpsiuMulticomponentThermo/mixtures/homogeneousMixture \
7
+ -IpsiuMulticomponentThermo/mixtures/inhomogeneousMixture \
8
+ -IpsiuMulticomponentThermo/mixtures/leanInhomogeneousMixture \
9
+ -IpsiuMulticomponentThermo/mixtures/inhomogeneousEGRMixture \
10
+ -IXiModels/transport \
11
+ -IXiModels/fixed \
12
+ -IXiModels/algebraic \
13
+ -IXiModels/XiModel \
14
+ -IXiModels/XiEqModels/XiEqModel \
15
+ -IXiModels/XiEqModels/Gulder \
16
+ -IXiModels/XiEqModels/instabilityXiEq \
17
+ -IXiModels/XiEqModels/SCOPEBlendXiEq \
18
+ -IXiModels/XiEqModels/SCOPEXiEq \
19
+ -IXiModels/XiGModels/XiGModel \
20
+ -IXiModels/XiGModels/instabilityG \
21
+ -IXiModels/XiGModels/KTS \
22
+ -IPDRModels/dragModels/basic \
23
+ -IPDRModels/dragModels/PDRDragModel \
24
+ -IPDRModels/XiEqModels/basicXiSubXiEq \
25
+ -IPDRModels/XiGModels/basicXiSubG \
26
+ -IPDRModels/turbulence/PDRkEpsilon \
27
+ -Iignition \
28
+ -IlaminarFlameSpeed/laminarFlameSpeed \
29
+ -IlaminarFlameSpeed/SCOPE \
30
+ -I$(LIB_SRC)/physicalProperties/lnInclude \
31
+ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
32
+ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
33
+ -I$(LIB_SRC)/thermophysicalModels/multicomponentThermo/lnInclude \
34
+ -I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \
35
+ -I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude \
36
+ -I$(LIB_SRC)/ThermophysicalTransportModels/thermophysicalTransportModel/lnInclude \
37
+ -I$(LIB_SRC)/ThermophysicalTransportModels/fluid/lnInclude \
38
+ -I$(LIB_SRC)/ThermophysicalTransportModels/fluidThermo/lnInclude \
39
+ -I$(LIB_SRC)/finiteVolume/lnInclude \
40
+ -I$(LIB_SRC)/meshTools/lnInclude \
41
+ -I$(LIB_SRC)/triSurface/lnInclude \
42
+
43
+ EXE_LIBS = \
44
+ -lmeshTools \
45
+ -lfluidThermophysicalModels \
46
+ -lmulticomponentThermophysicalModels \
47
+ -lspecie \
48
+ -lmomentumTransportModels \
49
+ -lcompressibleMomentumTransportModels \
50
+ -lcoupledThermophysicalTransportModels \
51
+ -lfiniteVolume \
52
+ -lfvModels \
53
+ -lfvConstraints
data/applications/legacy/combustion/PDRFoam/PDRFoam.C ADDED
@@ -0,0 +1,189 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*---------------------------------------------------------------------------*\
2
+ ========= |
3
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
+ \\ / O peration | Website: https://openfoam.org
5
+ \\ / A nd | Copyright (C) 2011-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
+ Application
25
+ PDRFoam
26
+
27
+ Description
28
+ Solver for compressible premixed/partially-premixed combustion with
29
+ turbulence modelling.
30
+
31
+ Combusting RANS code using the b-Xi two-equation model.
32
+ Xi may be obtained by either the solution of the Xi transport
33
+ equation or from an algebraic expression. Both approaches are
34
+ based on Gulder's flame speed correlation which has been shown
35
+ to be appropriate by comparison with the results from the
36
+ spectral model.
37
+
38
+ Strain effects are incorporated directly into the Xi equation
39
+ but not in the algebraic approximation. Further work need to be
40
+ done on this issue, particularly regarding the enhanced removal rate
41
+ caused by flame compression. Analysis using results of the spectral
42
+ model will be required.
43
+
44
+ For cases involving very lean Propane flames or other flames which are
45
+ very strain-sensitive, a transport equation for the laminar flame
46
+ speed is present. This equation is derived using heuristic arguments
47
+ involving the strain time scale and the strain-rate at extinction.
48
+ the transport velocity is the same as that for the Xi equation.
49
+
50
+ For large flames e.g. explosions additional modelling for the flame
51
+ wrinkling due to surface instabilities may be applied.
52
+
53
+ PDR (porosity/distributed resistance) modelling is included to handle
54
+ regions containing blockages which cannot be resolved by the mesh.
55
+
56
+ The fields used by this solver are:
57
+
58
+ betav: Volume porosity
59
+ Lobs: Average diameter of obstacle in cell (m)
60
+ Aw: Obstacle surface area per unit volume (1/m)
61
+ CR: Drag tensor (1/m)
62
+ CT: Turbulence generation parameter (1/m)
63
+ Nv: Number of obstacles in cell per unit volume (m^-2)
64
+ nsv: Tensor whose diagonal indicates the number to subtract from
65
+ Nv to get the number of obstacles crossing the flow in each
66
+ direction.
67
+
68
+ \*---------------------------------------------------------------------------*/
69
+
70
+ #include "argList.H"
71
+ #include "timeSelector.H"
72
+ #include "psiuMulticomponentThermo.H"
73
+ #include "compressibleMomentumTransportModels.H"
74
+ #include "RASThermophysicalTransportModel.H"
75
+ #include "unityLewisEddyDiffusivity.H"
76
+ #include "laminarFlameSpeed.H"
77
+ #include "XiModel.H"
78
+ #include "PDRDragModel.H"
79
+ #include "ignition.H"
80
+ #include "pimpleControl.H"
81
+ #include "pressureReference.H"
82
+ #include "findRefCell.H"
83
+ #include "constrainPressure.H"
84
+ #include "constrainHbyA.H"
85
+ #include "adjustPhi.H"
86
+ #include "uniformDimensionedFields.H"
87
+ #include "fvModels.H"
88
+ #include "fvConstraints.H"
89
+
90
+ #include "fviDdt.H"
91
+ #include "fviDiv.H"
92
+ #include "fvcDdt.H"
93
+ #include "fviGrad.H"
94
+ #include "fvcFlux.H"
95
+ #include "fvcReconstruct.H"
96
+ #include "fvcMeshPhi.H"
97
+
98
+ #include "fvmDdt.H"
99
+ #include "fvmDiv.H"
100
+ #include "fvmLaplacian.H"
101
+
102
+ using namespace Foam;
103
+
104
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
105
+
106
+ int main(int argc, char *argv[])
107
+ {
108
+ #include "postProcess.H"
109
+
110
+ #include "setRootCaseFunctionObjects.H"
111
+ #include "createTime.H"
112
+ #include "createMesh.H"
113
+ #include "createControl.H"
114
+ #include "readGravitationalAcceleration.H"
115
+ #include "createFields.H"
116
+ #include "createFieldRefs.H"
117
+ #include "initContinuityErrs.H"
118
+ #include "createTimeControls.H"
119
+ #include "compressibleCourantNo.H"
120
+ #include "setInitialDeltaT.H"
121
+
122
+ turbulence->validate();
123
+ scalar StCoNum = 0.0;
124
+
125
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126
+
127
+ Info<< "\nStarting time loop\n" << endl;
128
+
129
+ while (pimple.run(runTime))
130
+ {
131
+ #include "readTimeControls.H"
132
+ #include "compressibleCourantNo.H"
133
+ #include "setDeltaT.H"
134
+
135
+ runTime++;
136
+ Info<< "\n\nTime = " << runTime.name() << endl;
137
+
138
+ #include "rhoEqn.H"
139
+
140
+ // --- Pressure-velocity PIMPLE corrector loop
141
+ while (pimple.loop())
142
+ {
143
+ fvModels.correct();
144
+
145
+ if (pimple.predictTransport())
146
+ {
147
+ turbulence->predict();
148
+ thermophysicalTransport.predict();
149
+ }
150
+
151
+ #include "UEqn.H"
152
+
153
+ // --- Pressure corrector loop
154
+ while (pimple.correct())
155
+ {
156
+ #include "bEqn.H"
157
+ #include "ftEqn.H"
158
+ #include "EauEqn.H"
159
+ #include "EaEqn.H"
160
+
161
+ if (!ign.ignited())
162
+ {
163
+ thermo.heu() = thermo.he();
164
+ }
165
+
166
+ #include "pEqn.H"
167
+ }
168
+
169
+ if (pimple.correctTransport())
170
+ {
171
+ turbulence->correct();
172
+ thermophysicalTransport.correct();
173
+ }
174
+ }
175
+
176
+ runTime.write();
177
+
178
+ Info<< "\nExecutionTime = "
179
+ << runTime.elapsedCpuTime()
180
+ << " s\n" << endl;
181
+ }
182
+
183
+ Info<< "\n end\n";
184
+
185
+ return 0;
186
+ }
187
+
188
+
189
+ // ************************************************************************* //
data/applications/legacy/combustion/PDRFoam/PDRModels/XiEqModels/basicXiSubXiEq/basicXiSubXiEq.C ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*---------------------------------------------------------------------------*\
2
+ ========= |
3
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
+ \\ / O peration | Website: https://openfoam.org
5
+ \\ / A nd | Copyright (C) 2011-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 "basicXiSubXiEq.H"
27
+ #include "addToRunTimeSelectionTable.H"
28
+
29
+ // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
30
+
31
+ namespace Foam
32
+ {
33
+ namespace XiEqModels
34
+ {
35
+ defineTypeNameAndDebug(basicSubGrid, 0);
36
+ addToRunTimeSelectionTable(XiEqModel, basicSubGrid, dictionary);
37
+ }
38
+ }
39
+
40
+
41
+ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
42
+
43
+ Foam::XiEqModels::basicSubGrid::basicSubGrid
44
+ (
45
+ const dictionary& XiEqProperties,
46
+ const psiuMulticomponentThermo& thermo,
47
+ const compressible::RASModel& turbulence,
48
+ const volScalarField& Su
49
+ )
50
+ :
51
+ XiEqModel(XiEqProperties, thermo, turbulence, Su),
52
+
53
+ B_
54
+ (
55
+ IOobject
56
+ (
57
+ "B",
58
+ Su.mesh().facesInstance(),
59
+ Su.mesh(),
60
+ IOobject::MUST_READ,
61
+ IOobject::NO_WRITE
62
+ ),
63
+ Su.mesh()
64
+ ),
65
+
66
+ XiEqModel_(XiEqModel::New(XiEqModelCoeffs_, thermo, turbulence, Su))
67
+ {}
68
+
69
+
70
+ // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
71
+
72
+ Foam::XiEqModels::basicSubGrid::~basicSubGrid()
73
+ {}
74
+
75
+
76
+ // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
77
+
78
+ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::basicSubGrid::XiEq() const
79
+ {
80
+ const fvMesh& mesh = Su_.mesh();
81
+ const volVectorField& U = mesh.lookupObject<volVectorField>("U");
82
+
83
+ const volScalarField& Nv = mesh.lookupObject<volScalarField>("Nv");
84
+ const volSymmTensorField& nsv =
85
+ mesh.lookupObject<volSymmTensorField>("nsv");
86
+
87
+ volScalarField magU(mag(U));
88
+ volVectorField Uhat
89
+ (
90
+ U/(mag(U) + dimensionedScalar(U.dimensions(), 1e-4))
91
+ );
92
+
93
+ const scalarField Cw(pow(mesh.V().primitiveField(), 2.0/3.0));
94
+
95
+ volScalarField N
96
+ (
97
+ IOobject
98
+ (
99
+ "N",
100
+ mesh.time().constant(),
101
+ mesh,
102
+ IOobject::NO_READ,
103
+ IOobject::NO_WRITE
104
+ ),
105
+ mesh,
106
+ dimensionedScalar(Nv.dimensions(), 0)
107
+ );
108
+ N.primitiveFieldRef() = Nv.primitiveField()*Cw;
109
+
110
+ volSymmTensorField ns
111
+ (
112
+ IOobject
113
+ (
114
+ "ns",
115
+ U.mesh().time().name(),
116
+ U.mesh(),
117
+ IOobject::NO_READ,
118
+ IOobject::NO_WRITE
119
+ ),
120
+ U.mesh(),
121
+ dimensionedSymmTensor
122
+ (
123
+ "zero",
124
+ nsv.dimensions(),
125
+ Zero
126
+ )
127
+ );
128
+ ns.primitiveFieldRef() = nsv.primitiveField()*Cw;
129
+
130
+ volScalarField n(max(N - (Uhat & ns & Uhat), scalar(1e-4)));
131
+ volScalarField b((Uhat & B_ & Uhat)/sqrt(n));
132
+ volScalarField up(sqrt((2.0/3.0)*turbulence_.k()));
133
+
134
+ volScalarField XiSubEq
135
+ (
136
+ scalar(1)
137
+ + max(2.2*sqrt(b), min(0.34*magU/up*sqrt(b), scalar(1.6)))
138
+ * min(n, scalar(1))
139
+ );
140
+
141
+ return (XiSubEq*XiEqModel_->XiEq());
142
+ }
143
+
144
+
145
+ bool Foam::XiEqModels::basicSubGrid::read(const dictionary& XiEqProperties)
146
+ {
147
+ XiEqModel::read(XiEqProperties);
148
+
149
+ return XiEqModel_->read(XiEqModelCoeffs_);
150
+ }
151
+
152
+
153
+ // ************************************************************************* //
data/applications/legacy/combustion/PDRFoam/PDRModels/XiEqModels/basicXiSubXiEq/basicXiSubXiEq.H ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*---------------------------------------------------------------------------*\
2
+ ========= |
3
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
+ \\ / O peration | Website: https://openfoam.org
5
+ \\ / A nd | Copyright (C) 2011-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
+ Class
25
+ Foam::XiEqModels::basicSubGrid
26
+
27
+ Description
28
+ Basic sub-grid obstacle flame-wrinkling enhancement factor model.
29
+ Details supplied by J Puttock 2/7/06.
30
+
31
+ <b> Sub-grid flame area generation </b>
32
+
33
+ \f$ n = N - \hat{\dwea{\vec{U}}}.n_{s}.\hat{\dwea{\vec{U}}} \f$
34
+ \f$ n_{r} = \sqrt{n} \f$
35
+
36
+ where:
37
+
38
+ \f$ \hat{\dwea{\vec{U}}} = \dwea{\vec{U}} / \vert \dwea{\vec{U}}
39
+ \vert \f$
40
+
41
+ \f$ b = \hat{\dwea{\vec{U}}}.B.\hat{\dwea{\vec{U}}} / n_{r} \f$
42
+
43
+ where:
44
+
45
+ \f$ B \f$ is the file "B".
46
+
47
+ \f$ N \f$ is the file "N".
48
+
49
+ \f$ n_{s} \f$ is the file "ns".
50
+
51
+ The flame area enhancement factor \f$ \Xi_{sub} \f$ is expected to
52
+ approach:
53
+
54
+ \f[
55
+ \Xi_{{sub}_{eq}} =
56
+ 1 + max(2.2 \sqrt{b}, min(0.34 \frac{\vert \dwea{\vec{U}}
57
+ \vert}{{\vec{U}}^{'}}, 1.6)) \times min(\frac{n}{4}, 1)
58
+ \f]
59
+
60
+
61
+ SourceFiles
62
+ basicSubGrid.C
63
+
64
+ \*---------------------------------------------------------------------------*/
65
+
66
+ #ifndef basicXiSubXiEq_H
67
+ #define basicXiSubXiEq_H
68
+
69
+ #include "XiEqModel.H"
70
+
71
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
72
+
73
+ namespace Foam
74
+ {
75
+ namespace XiEqModels
76
+ {
77
+
78
+ /*---------------------------------------------------------------------------*\
79
+ Class basicSubGrid Declaration
80
+ \*---------------------------------------------------------------------------*/
81
+
82
+ class basicSubGrid
83
+ :
84
+ public XiEqModel
85
+ {
86
+ // Private Data
87
+
88
+ //- tblock
89
+ volSymmTensorField B_;
90
+
91
+ //- Equilibrium Xi model due to turbulence
92
+ autoPtr<XiEqModel> XiEqModel_;
93
+
94
+
95
+ public:
96
+
97
+ //- Runtime type information
98
+ TypeName("basicSubGrid");
99
+
100
+
101
+ // Constructors
102
+
103
+ //- Construct from components
104
+ basicSubGrid
105
+ (
106
+ const dictionary& XiEqProperties,
107
+ const psiuMulticomponentThermo& thermo,
108
+ const compressible::RASModel& turbulence,
109
+ const volScalarField& Su
110
+ );
111
+
112
+ //- Disallow default bitwise copy construction
113
+ basicSubGrid(const basicSubGrid&) = delete;
114
+
115
+
116
+ //- Destructor
117
+ virtual ~basicSubGrid();
118
+
119
+
120
+ // Member Functions
121
+
122
+ //- Return the flame-wrinkling XiEq
123
+ virtual tmp<volScalarField> XiEq() const;
124
+
125
+ //- Update properties from given dictionary
126
+ virtual bool read(const dictionary& XiEqProperties);
127
+
128
+
129
+ // Member Operators
130
+
131
+ //- Disallow default bitwise assignment
132
+ void operator=(const basicSubGrid&) = delete;
133
+ };
134
+
135
+
136
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137
+
138
+ } // End namespace XiEqModels
139
+ } // End namespace Foam
140
+
141
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142
+
143
+ #endif
144
+
145
+ // ************************************************************************* //
data/applications/legacy/combustion/PDRFoam/PDRModels/XiGModels/basicXiSubG/basicXiSubG.C ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*---------------------------------------------------------------------------*\
2
+ ========= |
3
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
+ \\ / O peration | Website: https://openfoam.org
5
+ \\ / A nd | Copyright (C) 2011-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 "basicXiSubG.H"
27
+ #include "addToRunTimeSelectionTable.H"
28
+
29
+ // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
30
+
31
+ namespace Foam
32
+ {
33
+ namespace XiGModels
34
+ {
35
+ defineTypeNameAndDebug(basicSubGrid, 0);
36
+ addToRunTimeSelectionTable(XiGModel, basicSubGrid, dictionary);
37
+ };
38
+ };
39
+
40
+
41
+ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
42
+
43
+ Foam::XiGModels::basicSubGrid::basicSubGrid
44
+ (
45
+ const dictionary& XiGProperties,
46
+ const psiuMulticomponentThermo& thermo,
47
+ const compressible::RASModel& turbulence,
48
+ const volScalarField& Su
49
+ )
50
+ :
51
+ XiGModel(XiGProperties, thermo, turbulence, Su),
52
+ k1(XiGModelCoeffs_.lookup<scalar>("k1")),
53
+ XiGModel_(XiGModel::New(XiGModelCoeffs_, thermo, turbulence, Su))
54
+ {}
55
+
56
+
57
+ // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
58
+
59
+ Foam::XiGModels::basicSubGrid::~basicSubGrid()
60
+ {}
61
+
62
+
63
+ // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
64
+
65
+ Foam::tmp<Foam::volScalarField> Foam::XiGModels::basicSubGrid::G() const
66
+ {
67
+ const objectRegistry& db = Su_.db();
68
+ const volVectorField& U = db.lookupObject<volVectorField>("U");
69
+ const volScalarField& Nv = db.lookupObject<volScalarField>("Nv");
70
+ const volScalarField& Lobs = db.lookupObject<volScalarField>("Lobs");
71
+
72
+ tmp<volScalarField> tGtot = XiGModel_->G();
73
+ volScalarField& Gtot = tGtot.ref();
74
+
75
+ const scalarField Cw(pow(Su_.mesh().V().primitiveField(), 2.0/3.0));
76
+ scalarField N(Nv.primitiveField()*Cw);
77
+
78
+ forAll(N, celli)
79
+ {
80
+ if (N[celli] > 1e-3)
81
+ {
82
+ Gtot[celli] += k1*mag(U[celli])/Lobs[celli];
83
+ }
84
+ }
85
+
86
+ return tGtot;
87
+ }
88
+
89
+
90
+ Foam::tmp<Foam::volScalarField> Foam::XiGModels::basicSubGrid::Db() const
91
+ {
92
+ const objectRegistry& db = Su_.db();
93
+ const volScalarField& Xi = db.lookupObject<volScalarField>("Xi");
94
+ const volScalarField& rho = db.lookupObject<volScalarField>("rho");
95
+ const volScalarField& mgb = db.lookupObject<volScalarField>("mgb");
96
+ const volScalarField& Lobs = db.lookupObject<volScalarField>("Lobs");
97
+
98
+ return XiGModel_->Db()
99
+ + rho*Su_*(Xi - 1.0)*mgb*(0.5*Lobs)*Lobs/(mgb*Lobs + 1.0);
100
+ }
101
+
102
+
103
+ bool Foam::XiGModels::basicSubGrid::read(const dictionary& XiGProperties)
104
+ {
105
+ XiGModel::read(XiGProperties);
106
+
107
+ XiGModelCoeffs_.lookup("k1") >> k1;
108
+
109
+ return true;
110
+ }
111
+
112
+
113
+ // ************************************************************************* //
data/applications/legacy/combustion/PDRFoam/PDRModels/XiGModels/basicXiSubG/basicXiSubG.H ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*---------------------------------------------------------------------------*\
2
+ ========= |
3
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
+ \\ / O peration | Website: https://openfoam.org
5
+ \\ / A nd | Copyright (C) 2011-2024 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
+ Class
25
+ Foam::XiGModels::basicSubGrid
26
+
27
+ Description
28
+ Basic sub-grid obstacle flame-wrinkling generation rate coefficient model.
29
+ Details supplied by J Puttock 2/7/06.
30
+
31
+ \f$ G_{sub} \f$ denotes the generation coefficient and it is given by
32
+
33
+ \f[
34
+ G_{sub} = k_{1} /frac{\vert \dwea{\vec{U}} \vert}{L_{obs}}
35
+ \frac{/Xi_{{sub}_{eq}}-1}{/Xi_{sub}}
36
+ \f]
37
+
38
+ and the removal:
39
+
40
+ \f[
41
+ - k_{1} /frac{\vert \dwea{\vec{U}} \vert}{L_{sub}}
42
+ \frac{\Xi_{sub}-1}{\Xi_{sub}}
43
+ \f]
44
+
45
+ Finally, \f$ G_{sub} \f$ is added to generation rate \f$ G_{in} \f$
46
+ due to the turbulence.
47
+
48
+ SourceFiles
49
+ basicSubGrid.C
50
+
51
+ \*---------------------------------------------------------------------------*/
52
+
53
+ #ifndef basicXiSubG_H
54
+ #define basicXiSubG_H
55
+
56
+ #include "XiGModel.H"
57
+
58
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
59
+
60
+ namespace Foam
61
+ {
62
+ namespace XiGModels
63
+ {
64
+
65
+ /*---------------------------------------------------------------------------*\
66
+ Class basicSubGrid Declaration
67
+ \*---------------------------------------------------------------------------*/
68
+
69
+ class basicSubGrid
70
+ :
71
+ public XiGModel
72
+ {
73
+ // Private Data
74
+
75
+ //- Sub-grid generation rate coefficient
76
+ scalar k1;
77
+
78
+ //- Xi generation rate model due to turbulence
79
+ autoPtr<XiGModel> XiGModel_;
80
+
81
+
82
+ public:
83
+
84
+ //- Runtime type information
85
+ TypeName("basicSubGridG");
86
+
87
+
88
+ // Constructors
89
+
90
+ //- Construct from components
91
+ basicSubGrid
92
+ (
93
+ const dictionary& XiGProperties,
94
+ const psiuMulticomponentThermo& thermo,
95
+ const compressible::RASModel& turbulence,
96
+ const volScalarField& Su
97
+ );
98
+
99
+ //- Disallow default bitwise copy construction
100
+ basicSubGrid(const basicSubGrid&) = delete;
101
+
102
+
103
+ //- Destructor
104
+ virtual ~basicSubGrid();
105
+
106
+
107
+ // Member Functions
108
+
109
+ //- Return the flame-wrinkling generation rate
110
+ virtual tmp<volScalarField> G() const;
111
+
112
+ //- Return the flame diffusivity
113
+ virtual tmp<volScalarField> Db() const;
114
+
115
+ //- Update properties from given dictionary
116
+ virtual bool read(const dictionary& XiGProperties);
117
+
118
+
119
+ // Member Operators
120
+
121
+ //- Disallow default bitwise assignment
122
+ void operator=(const basicSubGrid&) = delete;
123
+ };
124
+
125
+
126
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127
+
128
+ } // End namespace XiGModels
129
+ } // End namespace Foam
130
+
131
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132
+
133
+ #endif
134
+
135
+ // ************************************************************************* //
data/applications/legacy/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModel.C ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*---------------------------------------------------------------------------*\
2
+ ========= |
3
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
+ \\ / O peration | Website: https://openfoam.org
5
+ \\ / A nd | Copyright (C) 2011-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 "PDRDragModel.H"
27
+
28
+ // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
29
+
30
+ namespace Foam
31
+ {
32
+ defineTypeNameAndDebug(PDRDragModel, 0);
33
+ defineRunTimeSelectionTable(PDRDragModel, dictionary);
34
+ };
35
+
36
+
37
+ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
38
+
39
+ Foam::PDRDragModel::PDRDragModel
40
+ (
41
+ const dictionary& PDRProperties,
42
+ const compressible::RASModel& turbulence,
43
+ const volScalarField& rho,
44
+ const volVectorField& U,
45
+ const surfaceScalarField& phi
46
+ )
47
+ :
48
+ regIOobject
49
+ (
50
+ IOobject
51
+ (
52
+ "PDRDragModel",
53
+ U.time().constant(),
54
+ U.db()
55
+ )
56
+ ),
57
+ PDRDragModelCoeffs_
58
+ (
59
+ PDRProperties.typeDict
60
+ (
61
+ PDRProperties.lookup<word>("PDRDragModel")
62
+ )
63
+ ),
64
+ turbulence_(turbulence),
65
+ rho_(rho),
66
+ U_(U),
67
+ phi_(phi),
68
+ on_(PDRDragModelCoeffs_.lookup("drag"))
69
+ {}
70
+
71
+
72
+ // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
73
+
74
+ Foam::PDRDragModel::~PDRDragModel()
75
+ {}
76
+
77
+
78
+ // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
79
+
80
+ bool Foam::PDRDragModel::read(const dictionary& PDRProperties)
81
+ {
82
+ PDRDragModelCoeffs_ = PDRProperties.optionalTypeDict(type());
83
+
84
+ PDRDragModelCoeffs_.lookup("drag") >> on_;
85
+
86
+ return true;
87
+ }
88
+
89
+
90
+ // ************************************************************************* //
data/applications/legacy/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModel.H ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*---------------------------------------------------------------------------*\
2
+ ========= |
3
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
+ \\ / O peration | Website: https://openfoam.org
5
+ \\ / A nd | Copyright (C) 2011-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
+ Class
25
+ Foam::PDRDragModel
26
+
27
+ Description
28
+ Base-class for sub-grid obstacle drag models. The available drag model is at
29
+ \link basic.H \endlink.
30
+
31
+ SourceFiles
32
+ PDRDragModel.C
33
+
34
+ \*---------------------------------------------------------------------------*/
35
+
36
+ #ifndef PDRDragModel_H
37
+ #define PDRDragModel_H
38
+
39
+ #include "IOdictionary.H"
40
+ #include "psiuMulticomponentThermo.H"
41
+ #include "compressibleMomentumTransportModels.H"
42
+ #include "multivariateSurfaceInterpolationScheme.H"
43
+ #include "runTimeSelectionTables.H"
44
+
45
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
+
47
+ namespace Foam
48
+ {
49
+
50
+ /*---------------------------------------------------------------------------*\
51
+ Class PDRDragModel Declaration
52
+ \*---------------------------------------------------------------------------*/
53
+
54
+ class PDRDragModel
55
+ :
56
+ public regIOobject
57
+ {
58
+
59
+ protected:
60
+
61
+ // Protected data
62
+
63
+ dictionary PDRDragModelCoeffs_;
64
+
65
+ const compressible::RASModel& turbulence_;
66
+ const volScalarField& rho_;
67
+ const volVectorField& U_;
68
+ const surfaceScalarField& phi_;
69
+
70
+ Switch on_;
71
+
72
+
73
+ public:
74
+
75
+ //- Runtime type information
76
+ TypeName("PDRDragModel");
77
+
78
+
79
+ // Declare run-time constructor selection table
80
+
81
+ declareRunTimeSelectionTable
82
+ (
83
+ autoPtr,
84
+ PDRDragModel,
85
+ dictionary,
86
+ (
87
+ const dictionary& PDRProperties,
88
+ const compressible::RASModel& turbulence,
89
+ const volScalarField& rho,
90
+ const volVectorField& U,
91
+ const surfaceScalarField& phi
92
+ ),
93
+ (
94
+ PDRProperties,
95
+ turbulence,
96
+ rho,
97
+ U,
98
+ phi
99
+ )
100
+ );
101
+
102
+
103
+ // Constructors
104
+
105
+ //- Construct from components
106
+ PDRDragModel
107
+ (
108
+ const dictionary& PDRProperties,
109
+ const compressible::RASModel& turbulence,
110
+ const volScalarField& rho,
111
+ const volVectorField& U,
112
+ const surfaceScalarField& phi
113
+ );
114
+
115
+ //- Disallow default bitwise copy construction
116
+ PDRDragModel(const PDRDragModel&) = delete;
117
+
118
+
119
+ // Selectors
120
+
121
+ //- Return a reference to the selected Xi model
122
+ static autoPtr<PDRDragModel> New
123
+ (
124
+ const dictionary& PDRProperties,
125
+ const compressible::RASModel& turbulence,
126
+ const volScalarField& rho,
127
+ const volVectorField& U,
128
+ const surfaceScalarField& phi
129
+ );
130
+
131
+
132
+ //- Destructor
133
+ virtual ~PDRDragModel();
134
+
135
+
136
+ // Member Functions
137
+
138
+ //- Return true if the drag model is switched on
139
+ bool on() const
140
+ {
141
+ return on_;
142
+ }
143
+
144
+ //- Return the momentum drag coefficient
145
+ virtual tmp<volSymmTensorField> Dcu() const = 0;
146
+
147
+ //- Return the momentum drag turbulence generation rate
148
+ virtual tmp<volScalarField> Gk() const = 0;
149
+
150
+ //- Inherit read from regIOobject
151
+ using regIOobject::read;
152
+
153
+ //- Update properties from given dictionary
154
+ virtual bool read(const dictionary& PDRProperties) = 0;
155
+
156
+ virtual bool writeData(Ostream&) const
157
+ {
158
+ return true;
159
+ }
160
+
161
+ virtual void writeFields() const
162
+ {
163
+ NotImplemented;
164
+ }
165
+
166
+
167
+ // Member Operators
168
+
169
+ //- Disallow default bitwise assignment
170
+ void operator=(const PDRDragModel&) = delete;
171
+ };
172
+
173
+
174
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175
+
176
+ } // End namespace Foam
177
+
178
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179
+
180
+ #endif
181
+
182
+ // ************************************************************************* //
data/applications/legacy/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*---------------------------------------------------------------------------*\
2
+ ========= |
3
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
+ \\ / O peration | Website: https://openfoam.org
5
+ \\ / A nd | Copyright (C) 2011-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 "PDRDragModel.H"
27
+
28
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
29
+
30
+ Foam::autoPtr<Foam::PDRDragModel> Foam::PDRDragModel::New
31
+ (
32
+ const dictionary& PDRProperties,
33
+ const compressible::RASModel& turbulence,
34
+ const volScalarField& rho,
35
+ const volVectorField& U,
36
+ const surfaceScalarField& phi
37
+ )
38
+ {
39
+ const word modelType(PDRProperties.lookup("PDRDragModel"));
40
+
41
+ Info<< indentOrNl
42
+ << "Selecting flame-wrinkling model " << modelType << endl;
43
+
44
+ dictionaryConstructorTable::iterator cstrIter =
45
+ dictionaryConstructorTablePtr_->find(modelType);
46
+
47
+ if (cstrIter == dictionaryConstructorTablePtr_->end())
48
+ {
49
+ FatalIOErrorInFunction(PDRProperties)
50
+ << "Unknown PDRDragModel type "
51
+ << modelType << nl << nl
52
+ << "Valid PDRDragModels are : " << endl
53
+ << dictionaryConstructorTablePtr_->sortedToc()
54
+ << exit(FatalIOError);
55
+ }
56
+
57
+ return autoPtr<PDRDragModel>
58
+ (cstrIter()(PDRProperties, turbulence, rho, U, phi));
59
+ }
60
+
61
+
62
+ // ************************************************************************* //
data/applications/legacy/combustion/PDRFoam/PDRModels/dragModels/basic/basic.C ADDED
@@ -0,0 +1,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*---------------------------------------------------------------------------*\
2
+ ========= |
3
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
+ \\ / O peration | Website: https://openfoam.org
5
+ \\ / A nd | Copyright (C) 2011-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 "basic.H"
27
+ #include "addToRunTimeSelectionTable.H"
28
+
29
+ // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
30
+
31
+ namespace Foam
32
+ {
33
+ namespace PDRDragModels
34
+ {
35
+ defineTypeNameAndDebug(basic, 0);
36
+ addToRunTimeSelectionTable(PDRDragModel, basic, dictionary);
37
+ }
38
+ }
39
+
40
+
41
+ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
42
+
43
+ Foam::PDRDragModels::basic::basic
44
+ (
45
+ const dictionary& PDRProperties,
46
+ const compressible::RASModel& turbulence,
47
+ const volScalarField& rho,
48
+ const volVectorField& U,
49
+ const surfaceScalarField& phi
50
+ )
51
+ :
52
+ PDRDragModel(PDRProperties, turbulence, rho, U, phi),
53
+ Csu("Csu", dimless, PDRDragModelCoeffs_),
54
+ Csk("Csk", dimless, PDRDragModelCoeffs_),
55
+
56
+ Aw_
57
+ (
58
+ IOobject
59
+ (
60
+ "Aw",
61
+ U_.mesh().facesInstance(),
62
+ U_.mesh(),
63
+ IOobject::MUST_READ,
64
+ IOobject::NO_WRITE
65
+ ),
66
+ U_.mesh()
67
+ ),
68
+
69
+ CR_
70
+ (
71
+ IOobject
72
+ (
73
+ "CR",
74
+ U_.mesh().facesInstance(),
75
+ U_.mesh(),
76
+ IOobject::MUST_READ,
77
+ IOobject::NO_WRITE
78
+ ),
79
+ U_.mesh()
80
+ )
81
+ {}
82
+
83
+
84
+ // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
85
+
86
+ Foam::PDRDragModels::basic::~basic()
87
+ {}
88
+
89
+
90
+ // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
91
+
92
+ Foam::tmp<Foam::volSymmTensorField> Foam::PDRDragModels::basic::Dcu() const
93
+ {
94
+ tmp<volSymmTensorField> tDragDcu
95
+ (
96
+ volSymmTensorField::New
97
+ (
98
+ "tDragDcu",
99
+ U_.mesh(),
100
+ dimensionedSymmTensor
101
+ (
102
+ dimensions::density/dimensions::time,
103
+ Zero
104
+ )
105
+ )
106
+ );
107
+
108
+ volSymmTensorField& DragDcu = tDragDcu.ref();
109
+
110
+ if (on_)
111
+ {
112
+ const volScalarField& betav =
113
+ U_.db().lookupObject<volScalarField>("betav");
114
+
115
+ DragDcu =
116
+ rho_*(0.5*CR_*mag(U_) + (Csu*I)*betav*turbulence_.nuEff()*sqr(Aw_));
117
+ }
118
+
119
+ return tDragDcu;
120
+ }
121
+
122
+
123
+ Foam::tmp<Foam::volScalarField> Foam::PDRDragModels::basic::Gk() const
124
+ {
125
+ tmp<volScalarField> tGk
126
+ (
127
+ volScalarField::New
128
+ (
129
+ "tGk",
130
+ U_.mesh(),
131
+ dimensionedScalar
132
+ (
133
+ dimensions::density
134
+ *dimensions::turbulentKineticEnergy/dimensions::time,
135
+ 0
136
+ )
137
+ )
138
+ );
139
+
140
+ volScalarField& Gk = tGk.ref();
141
+
142
+ if (on_)
143
+ {
144
+ const volScalarField& betav =
145
+ U_.db().lookupObject<volScalarField>("betav");
146
+
147
+ const volSymmTensorField& CT =
148
+ U_.db().lookupObject<volSymmTensorField>("CT");
149
+
150
+ Gk =
151
+ rho_
152
+ *(
153
+ 0.5*mag(U_)*(U_ & CT & U_)
154
+ + Csk*betav*turbulence_.nuEff()*sqr(Aw_)*magSqr(U_)
155
+ );
156
+ }
157
+
158
+ return tGk;
159
+ }
160
+
161
+
162
+ bool Foam::PDRDragModels::basic::read(const dictionary& PDRProperties)
163
+ {
164
+ PDRDragModel::read(PDRProperties);
165
+
166
+ PDRDragModelCoeffs_.lookup("Csu") >> Csu.value();
167
+ PDRDragModelCoeffs_.lookup("Csk") >> Csk.value();
168
+
169
+ return true;
170
+ }
171
+
172
+
173
+ void Foam::PDRDragModels::basic::writeFields() const
174
+ {
175
+ Aw_.write();
176
+ CR_.write();
177
+ }
178
+
179
+ // ************************************************************************* //
data/applications/legacy/combustion/PDRFoam/PDRModels/dragModels/basic/basic.H ADDED
@@ -0,0 +1,166 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*---------------------------------------------------------------------------*\
2
+ ========= |
3
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
+ \\ / O peration | Website: https://openfoam.org
5
+ \\ / A nd | Copyright (C) 2011-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
+ Class
25
+ Foam::PDRDragModels::basic
26
+
27
+ Description
28
+ Basic sub-grid obstacle drag model.
29
+ Details supplied by J Puttock 2/7/06.
30
+
31
+ <b> Sub-grid drag term </b>
32
+
33
+ The resistance term (force per unit of volume) is given by:
34
+
35
+ \f[
36
+ R = -\frac{1}{2} \rho \vert \dwea{\vec{U}} \vert \dwea{\vec{U}}.D
37
+ \f]
38
+
39
+ where:
40
+
41
+ \f$ D \f$ is the tensor field "CR" in \f$ m^{-1} \f$
42
+
43
+ This is term is treated implicitly in UEqn.H
44
+
45
+ <b> Sub-grid turbulence generation </b>
46
+
47
+ The turbulence source term \f$ G_{R} \f$ occurring in the
48
+ \f$ \kappa-\epsilon \f$ equations for the generation of turbulence due
49
+ to interaction with unresolved obstacles :
50
+
51
+ \f$ G_{R} = C_{s}\beta_{\nu}
52
+ \mu_{eff} A_{w}^{2}(\dwea{\vec{U}}-\dwea{\vec{U}_{s}})^2 + \frac{1}{2}
53
+ \rho \vert \dwea{\vec{U}} \vert \dwea{\vec{U}}.T.\dwea{\vec{U}} \f$
54
+
55
+ where:
56
+
57
+ \f$ C_{s} \f$ = 1
58
+
59
+ \f$ \beta_{\nu} \f$ is the volume porosity (file "betav").
60
+
61
+ \f$ \mu_{eff} \f$ is the effective viscosity.
62
+
63
+ \f$ A_{w}^{2}\f$ is the obstacle surface area per unit of volume
64
+ (file "Aw").
65
+
66
+ \f$ \dwea{\vec{U}_{s}} \f$ is the slip velocity and is considered
67
+ \f$ \frac{1}{2}. \dwea{\vec{U}} \f$.
68
+
69
+ \f$ T \f$ is a tensor in the file CT.
70
+
71
+ The term \f$ G_{R} \f$ is treated explicitly in the \f$ \kappa-\epsilon
72
+ \f$ Eqs in the \link PDRkEpsilon.C \endlink file.
73
+
74
+
75
+ SourceFiles
76
+ basic.C
77
+
78
+ \*---------------------------------------------------------------------------*/
79
+
80
+ #ifndef basic_H
81
+ #define basic_H
82
+
83
+ #include "PDRDragModel.H"
84
+ #include "XiEqModel.H"
85
+
86
+
87
+ namespace Foam
88
+ {
89
+ namespace PDRDragModels
90
+ {
91
+
92
+ /*---------------------------------------------------------------------------*\
93
+ Class basic Declaration
94
+ \*---------------------------------------------------------------------------*/
95
+
96
+ class basic
97
+ :
98
+ public PDRDragModel
99
+ {
100
+ // Private Data
101
+
102
+ dimensionedScalar Csu;
103
+ dimensionedScalar Csk;
104
+
105
+ volScalarField Aw_;
106
+ volSymmTensorField CR_;
107
+
108
+
109
+ public:
110
+
111
+ //- Runtime type information
112
+ TypeName("basic");
113
+
114
+
115
+ // Constructors
116
+
117
+ //- Construct from components
118
+ basic
119
+ (
120
+ const dictionary& PDRProperties,
121
+ const compressible::RASModel& turbulence,
122
+ const volScalarField& rho,
123
+ const volVectorField& U,
124
+ const surfaceScalarField& phi
125
+ );
126
+
127
+ //- Disallow default bitwise copy construction
128
+ basic(const basic&) = delete;
129
+
130
+
131
+ //- Destructor
132
+ virtual ~basic();
133
+
134
+
135
+ // Member Functions
136
+
137
+ //- Return the momentum drag coefficient
138
+ virtual tmp<volSymmTensorField> Dcu() const;
139
+
140
+ //- Return the momentum drag turbulence generation rate
141
+ virtual tmp<volScalarField> Gk() const;
142
+
143
+ //- Update properties from given dictionary
144
+ virtual bool read(const dictionary& PDRProperties);
145
+
146
+ //- Write fields
147
+ void writeFields() const;
148
+
149
+
150
+ // Member Operators
151
+
152
+ //- Disallow default bitwise assignment
153
+ void operator=(const basic&) = delete;
154
+ };
155
+
156
+
157
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158
+
159
+ } // End namespace PDRDragModels
160
+ } // End namespace Foam
161
+
162
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163
+
164
+ #endif
165
+
166
+ // ************************************************************************* //
data/applications/legacy/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C ADDED
@@ -0,0 +1,210 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*---------------------------------------------------------------------------*\
2
+ ========= |
3
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
+ \\ / O peration | Website: https://openfoam.org
5
+ \\ / A nd | Copyright (C) 2011-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 "PDRkEpsilon.H"
27
+ #include "PDRDragModel.H"
28
+ #include "fviGrad.H"
29
+ #include "addToRunTimeSelectionTable.H"
30
+
31
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32
+
33
+ namespace Foam
34
+ {
35
+ namespace compressible
36
+ {
37
+ namespace RASModels
38
+ {
39
+
40
+ // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
41
+
42
+ defineTypeNameAndDebug(PDRkEpsilon, 0);
43
+ addToRunTimeSelectionTable(RASModel, PDRkEpsilon, dictionary);
44
+
45
+ // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
46
+
47
+ tmp<volScalarField> PDRkEpsilon::boundEpsilon()
48
+ {
49
+ tmp<volScalarField> tCmuk2(Cmu_*sqr(k_));
50
+ epsilon_ = max(epsilon_, tCmuk2()/(nutMaxCoeff_*nu()));
51
+ return tCmuk2;
52
+ }
53
+
54
+
55
+ void PDRkEpsilon::correctNut()
56
+ {
57
+ nut_ = Cmu_*sqr(k_)/epsilon_;
58
+ nut_.correctBoundaryConditions();
59
+ fvConstraints::New(mesh_).constrain(nut_);
60
+ }
61
+
62
+
63
+ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
64
+
65
+ PDRkEpsilon::PDRkEpsilon
66
+ (
67
+ const geometricOneField& alpha,
68
+ const volScalarField& rho,
69
+ const volVectorField& U,
70
+ const surfaceScalarField& alphaRhoPhi,
71
+ const surfaceScalarField& phi,
72
+ const viscosity& transport,
73
+ const word& modelName
74
+ )
75
+ :
76
+ Foam::RASModels::kEpsilon<compressible::momentumTransportModel>
77
+ (
78
+ geometricOneField(),
79
+ rho,
80
+ U,
81
+ phi,
82
+ phi,
83
+ transport,
84
+ modelName
85
+ ),
86
+
87
+ C4_("C4", typeDict(), 0.1)
88
+ {}
89
+
90
+
91
+ // * * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
92
+
93
+ PDRkEpsilon::~PDRkEpsilon()
94
+ {}
95
+
96
+
97
+ // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
98
+
99
+ bool PDRkEpsilon::read()
100
+ {
101
+ if (RASModel::read())
102
+ {
103
+ C4_.readIfPresent(typeDict());
104
+ return true;
105
+ }
106
+ else
107
+ {
108
+ return false;
109
+ }
110
+ }
111
+
112
+
113
+ void PDRkEpsilon::correct()
114
+ {
115
+ if (!turbulence_)
116
+ {
117
+ // Re-calculate viscosity
118
+ nut_ = Cmu_*sqr(k_)/epsilon_;
119
+ nut_.correctBoundaryConditions();
120
+
121
+ return;
122
+ }
123
+
124
+ RASModel::correct();
125
+
126
+ volInternalScalarField divU(fvi::div(phi_/fvc::interpolate(rho_)));
127
+
128
+ if (mesh_.moving())
129
+ {
130
+ divU += fvi::div(mesh_.phi());
131
+ }
132
+
133
+ tmp<volInternalTensorField> tgradU = fvi::grad(U_);
134
+ volInternalScalarField G
135
+ (
136
+ GName(),
137
+ rho_()*nut_()*(tgradU() && dev(twoSymm(tgradU())))
138
+ );
139
+ tgradU.clear();
140
+
141
+ // Update epsilon and G at the wall
142
+ epsilon_.boundaryRef().updateCoeffs();
143
+
144
+ // Add the blockage generation term so that it is included consistently
145
+ // in both the k and epsilon equations
146
+ const volInternalScalarField& betav =
147
+ U_.db().lookupObject<volScalarField>("betav");
148
+
149
+ const volScalarField& Lobs =
150
+ U_.db().lookupObject<volScalarField>("Lobs");
151
+
152
+ const PDRDragModel& drag =
153
+ U_.db().lookupObject<PDRDragModel>("PDRDragModel");
154
+
155
+ volInternalScalarField GR(drag.Gk());
156
+
157
+ volInternalScalarField LI
158
+ (
159
+ C4_*(Lobs() + dimensionedScalar(dimensions::length, rootVSmall))
160
+ );
161
+
162
+ // Dissipation equation
163
+ tmp<fvScalarMatrix> epsEqn
164
+ (
165
+ betav*fvm::ddt(rho_, epsilon_)
166
+ + fvm::div(phi_, epsilon_)
167
+ - fvm::laplacian(rho_*DepsilonEff(), epsilon_)
168
+ ==
169
+ C1_*betav*G*epsilon_()/k_()
170
+ + 1.5*pow(Cmu_, 3.0/4.0)*GR*sqrt(k_())/LI
171
+ - fvm::SuSp(((2.0/3.0)*C1_)*betav*rho_()*divU, epsilon_)
172
+ - fvm::Sp(C2_*betav*rho_()*epsilon_()/k_(), epsilon_)
173
+ );
174
+
175
+ epsEqn.ref().relax();
176
+
177
+ epsEqn.ref().boundaryManipulate(epsilon_.boundaryRef());
178
+
179
+ solve(epsEqn);
180
+ boundEpsilon();
181
+
182
+
183
+ // Turbulent kinetic energy equation
184
+
185
+ tmp<fvScalarMatrix> kEqn
186
+ (
187
+ betav*fvm::ddt(rho_, k_)
188
+ + fvm::div(phi_, k_)
189
+ - fvm::laplacian(rho_*DkEff(), k_)
190
+ ==
191
+ betav*G + GR
192
+ - fvm::SuSp((2.0/3.0)*betav*rho_()*divU, k_)
193
+ - fvm::Sp(betav*rho_()*epsilon_()/k_(), k_)
194
+ );
195
+
196
+ kEqn.ref().relax();
197
+ solve(kEqn);
198
+ bound(k_, kMin_);
199
+
200
+ correctNut();
201
+ }
202
+
203
+
204
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
205
+
206
+ } // End namespace RASModels
207
+ } // End namespace compressible
208
+ } // End namespace Foam
209
+
210
+ // ************************************************************************* //
data/applications/legacy/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.H ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*---------------------------------------------------------------------------*\
2
+ ========= |
3
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
+ \\ / O peration | Website: https://openfoam.org
5
+ \\ / A nd | Copyright (C) 2011-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
+ Class
25
+ Foam::compressible::RASModels::PDRkEpsilon
26
+
27
+ Description
28
+ Standard k-epsilon turbulence model with additional source terms
29
+ corresponding to PDR basic drag model (\link basic.H \endlink)
30
+
31
+ The default model coefficients correspond to the following:
32
+ @verbatim
33
+ PDRkEpsilon
34
+ {
35
+ Cmu 0.09;
36
+ C1 1.44;
37
+ C2 1.92;
38
+ C3 -0.33; // only for compressible
39
+ C4 0.1;
40
+ sigmak 1.0; // only for compressible
41
+ sigmaEps 1.3;
42
+ Prt 1.0; // only for compressible
43
+ }
44
+ @endverbatim
45
+
46
+ The turbulence source term \f$ G_{R} \f$ appears in the
47
+ \f$ \kappa-\epsilon \f$ equation for the generation of turbulence due to
48
+ interaction with unresolved obstacles.
49
+
50
+ In the \f$ \epsilon \f$ equation \f$ C_{1} G_{R} \f$ is added as a source
51
+ term.
52
+
53
+ In the \f$ \kappa \f$ equation \f$ G_{R} \f$ is added as a source term.
54
+
55
+ SourceFiles
56
+ PDRkEpsilon.C
57
+
58
+ \*---------------------------------------------------------------------------*/
59
+
60
+ #ifndef compressible_PDRkEpsilon_H
61
+ #define compressible_PDRkEpsilon_H
62
+
63
+ #include "kEpsilon.H"
64
+ #include "compressibleMomentumTransportModels.H"
65
+
66
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
67
+
68
+ namespace Foam
69
+ {
70
+ namespace compressible
71
+ {
72
+ namespace RASModels
73
+ {
74
+
75
+ /*---------------------------------------------------------------------------*\
76
+ Class PDRkEpsilon Declaration
77
+ \*---------------------------------------------------------------------------*/
78
+
79
+ class PDRkEpsilon
80
+ :
81
+ public Foam::RASModels::kEpsilon<compressible::momentumTransportModel>
82
+ {
83
+ // Private Data
84
+
85
+ // Model coefficients
86
+ dimensionedScalar C4_;
87
+
88
+
89
+ // Protected Member Functions
90
+
91
+ //- Bound epsilon and return Cmu*sqr(k) for nut
92
+ tmp<volScalarField> boundEpsilon();
93
+
94
+ //- Correct the eddy-viscosity nut
95
+ virtual void correctNut();
96
+
97
+
98
+ public:
99
+
100
+ //- Runtime type information
101
+ TypeName("PDRkEpsilon");
102
+
103
+
104
+ // Constructors
105
+
106
+ //- Construct from components
107
+ PDRkEpsilon
108
+ (
109
+ const geometricOneField& alpha,
110
+ const volScalarField& rho,
111
+ const volVectorField& U,
112
+ const surfaceScalarField& alphaRhoPhi,
113
+ const surfaceScalarField& phi,
114
+ const viscosity& transport,
115
+ const word& modelName = typeName
116
+ );
117
+
118
+
119
+ //- Destructor
120
+ virtual ~PDRkEpsilon();
121
+
122
+
123
+ // Member Functions
124
+
125
+ //- Solve the turbulence equations and correct the turbulence viscosity
126
+ void correct();
127
+
128
+ //- Read momentumTransport dictionary
129
+ bool read();
130
+ };
131
+
132
+
133
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134
+
135
+ } // End namespace RASModels
136
+ } // End namespace compressible
137
+ } // End namespace Foam
138
+
139
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140
+
141
+ #endif
142
+
143
+ // ************************************************************************* //
data/applications/legacy/combustion/PDRFoam/StCorr.H ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ dimensionedScalar StCorr("StCorr", dimless, 1.0);
2
+
3
+ if (ign.igniting())
4
+ {
5
+ // Calculate volume of ignition kernel
6
+ dimensionedScalar Vk
7
+ (
8
+ "Vk",
9
+ dimensions::volume,
10
+ gSum(c.primitiveField()*mesh.V().primitiveField())
11
+ );
12
+ dimensionedScalar Ak("Ak", dimensions::area, 0.0);
13
+
14
+ if (Vk.value() > small)
15
+ {
16
+ // Calculate kernel area from its volume
17
+ // and the dimensionality of the case
18
+
19
+ switch(mesh.nGeometricD())
20
+ {
21
+ case 3:
22
+ {
23
+ // Assume it is part-spherical
24
+ scalar sphereFraction
25
+ (
26
+ combustionProperties.lookup<scalar>
27
+ (
28
+ "ignitionSphereFraction"
29
+ )
30
+ );
31
+
32
+ Ak = sphereFraction*4.0*constant::mathematical::pi
33
+ *pow
34
+ (
35
+ 3.0*Vk
36
+ /(sphereFraction*4.0*constant::mathematical::pi),
37
+ 2.0/3.0
38
+ );
39
+ }
40
+ break;
41
+
42
+ case 2:
43
+ {
44
+ // Assume it is part-circular
45
+ dimensionedScalar thickness
46
+ (
47
+ combustionProperties.lookup("ignitionThickness")
48
+ );
49
+
50
+ scalar circleFraction
51
+ (
52
+ combustionProperties.lookup<scalar>
53
+ (
54
+ "ignitionCircleFraction"
55
+ )
56
+ );
57
+
58
+ Ak = circleFraction*constant::mathematical::pi*thickness
59
+ *sqrt
60
+ (
61
+ 4.0*Vk
62
+ /(
63
+ circleFraction
64
+ *thickness
65
+ *constant::mathematical::pi
66
+ )
67
+ );
68
+ }
69
+ break;
70
+
71
+ case 1:
72
+ // Assume it is plane or two planes
73
+ Ak = dimensionedScalar
74
+ (
75
+ combustionProperties.lookup("ignitionKernelArea")
76
+ );
77
+ break;
78
+ }
79
+
80
+ // Calculate kernel area from b field consistent with the
81
+ // discretisation of the b equation.
82
+ const volInternalScalarField mgb
83
+ (
84
+ fvi::div(nf, b, "div(phiSt,b)") - b()*fvi::div(nf) + dMgb
85
+ );
86
+ const scalar AkEst =
87
+ gSum(mgb.primitiveField()*mesh.V().primitiveField());
88
+
89
+ StCorr.value() = max(min((Ak.value()/AkEst), 10.0), 1.0);
90
+
91
+ Info<< "StCorr = " << StCorr.value() << endl;
92
+ }
93
+ }
data/applications/legacy/combustion/PDRFoam/StCourantNo.H ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*---------------------------------------------------------------------------*\
2
+ ========= |
3
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
+ \\ / O peration | Website: https://openfoam.org
5
+ \\ / A nd | Copyright (C) 2011-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
+ Global
25
+ CourantNo
26
+
27
+ Description
28
+ Calculates and outputs the mean and maximum Courant Numbers.
29
+
30
+ \*---------------------------------------------------------------------------*/
31
+
32
+ {
33
+ const scalarField sumPhi
34
+ (
35
+ fvi::surfaceSum(mag(phiSt))().primitiveField()
36
+ /rho.primitiveField()
37
+ );
38
+
39
+ StCoNum = 0.5*gMax(sumPhi/mesh.V().primitiveField())*runTime.deltaTValue();
40
+
41
+ const scalar meanStCoNum =
42
+ 0.5
43
+ *(gSum(sumPhi)/gSum(mesh.V().primitiveField()))
44
+ *runTime.deltaTValue();
45
+
46
+ Info<< "St courant Number mean: " << meanStCoNum
47
+ << " max: " << StCoNum << endl;
48
+ }
49
+
50
+ // ************************************************************************* //
data/applications/legacy/combustion/PDRFoam/UEqn.H ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ fvVectorMatrix UEqn
2
+ (
3
+ betav()*fvm::ddt(rho, U) + fvm::div(phi, U)
4
+ + MRF.DDt(rho, U)
5
+ + turbulence->divDevTau(U)
6
+ ==
7
+ betav()*rho()*g
8
+ + betav()*fvModels.source(rho, U)
9
+ );
10
+
11
+ fvConstraints.constrain(UEqn);
12
+
13
+ volSymmTensorField invA(inv(I*UEqn.A() + drag->Dcu()));
14
+
15
+ if (pimple.momentumPredictor())
16
+ {
17
+ U.internalFieldRef() = invA() & (UEqn.H()()() - betav()*fvi::grad(p));
18
+ U.correctBoundaryConditions();
19
+ fvConstraints.constrain(U);
20
+ K = 0.5*magSqr(U);
21
+ }
data/applications/legacy/combustion/PDRFoam/XiModels/XiEqModels/Gulder/Gulder.C ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*---------------------------------------------------------------------------*\
2
+ ========= |
3
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
+ \\ / O peration | Website: https://openfoam.org
5
+ \\ / A nd | Copyright (C) 2011-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 "Gulder.H"
27
+ #include "addToRunTimeSelectionTable.H"
28
+
29
+ // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
30
+
31
+ namespace Foam
32
+ {
33
+ namespace XiEqModels
34
+ {
35
+ defineTypeNameAndDebug(Gulder, 0);
36
+ addToRunTimeSelectionTable(XiEqModel, Gulder, dictionary);
37
+ }
38
+ }
39
+
40
+
41
+ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
42
+
43
+ Foam::XiEqModels::Gulder::Gulder
44
+ (
45
+ const dictionary& XiEqProperties,
46
+ const psiuMulticomponentThermo& thermo,
47
+ const compressible::RASModel& turbulence,
48
+ const volScalarField& Su
49
+ )
50
+ :
51
+ XiEqModel(XiEqProperties, thermo, turbulence, Su),
52
+ XiEqCoef_(XiEqModelCoeffs_.lookup<scalar>("XiEqCoef")),
53
+ SuMin_(0.01*average(Su())),
54
+ uPrimeCoef_(XiEqModelCoeffs_.lookup<scalar>("uPrimeCoef")),
55
+ subGridSchelkin_
56
+ (
57
+ readBool(XiEqModelCoeffs_.lookup("subGridSchelkin"))
58
+ )
59
+ {}
60
+
61
+
62
+ // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
63
+
64
+ Foam::XiEqModels::Gulder::~Gulder()
65
+ {}
66
+
67
+
68
+ // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
69
+
70
+ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::Gulder::XiEq() const
71
+ {
72
+ volScalarField up(sqrt((2.0/3.0)*turbulence_.k()));
73
+
74
+ tmp<volScalarField> tepsilon = turbulence_.epsilon();
75
+ const volScalarField& epsilon = tepsilon();
76
+
77
+ if (subGridSchelkin_)
78
+ {
79
+ up.primitiveFieldRef() += calculateSchelkinEffect(uPrimeCoef_);
80
+ }
81
+
82
+ volScalarField tauEta(sqrt(mag(thermo_.muu()/(thermo_.rhou()*epsilon))));
83
+
84
+ volScalarField Reta
85
+ (
86
+ up
87
+ / (
88
+ sqrt(epsilon*tauEta)
89
+ + dimensionedScalar(up.dimensions(), 1e-8)
90
+ )
91
+ );
92
+
93
+ return (1.0 + XiEqCoef_*sqrt(up/(Su_ + SuMin_))*Reta);
94
+ }
95
+
96
+
97
+ bool Foam::XiEqModels::Gulder::read(const dictionary& XiEqProperties)
98
+ {
99
+ XiEqModel::read(XiEqProperties);
100
+
101
+ XiEqModelCoeffs_.lookup("XiEqCoef") >> XiEqCoef_;
102
+ XiEqModelCoeffs_.lookup("uPrimeCoef") >> uPrimeCoef_;
103
+ XiEqModelCoeffs_.lookup("subGridSchelkin") >> subGridSchelkin_;
104
+
105
+ return true;
106
+ }
107
+
108
+
109
+ // ************************************************************************* //
data/applications/legacy/combustion/PDRFoam/XiModels/XiEqModels/Gulder/Gulder.H ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*---------------------------------------------------------------------------*\
2
+ ========= |
3
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
+ \\ / O peration | Website: https://openfoam.org
5
+ \\ / A nd | Copyright (C) 2011-2024 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
+ Class
25
+ Foam::XiEqModels::Gulder
26
+
27
+ Description
28
+ Simple Gulder model for XiEq based on Gulder's correlation
29
+ with a linear correction function to give a plausible profile for XiEq.
30
+
31
+ SourceFiles
32
+ Gulder.C
33
+
34
+ \*---------------------------------------------------------------------------*/
35
+
36
+ #ifndef Gulder_H
37
+ #define Gulder_H
38
+
39
+ #include "XiEqModel.H"
40
+
41
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42
+
43
+ namespace Foam
44
+ {
45
+ namespace XiEqModels
46
+ {
47
+
48
+ /*---------------------------------------------------------------------------*\
49
+ Class Gulder Declaration
50
+ \*---------------------------------------------------------------------------*/
51
+
52
+ class Gulder
53
+ :
54
+ public XiEqModel
55
+ {
56
+ // Private Data
57
+
58
+ //- Model constant
59
+ scalar XiEqCoef_;
60
+
61
+ //- Minimum laminar burning velocity
62
+ const dimensionedScalar SuMin_;
63
+
64
+ //- Schelkin effect Model constant
65
+ scalar uPrimeCoef_;
66
+
67
+ //- Use sub-grid Schelkin effect
68
+ bool subGridSchelkin_;
69
+
70
+
71
+ public:
72
+
73
+ //- Runtime type information
74
+ TypeName("Gulder");
75
+
76
+
77
+ // Constructors
78
+
79
+ //- Construct from components
80
+ Gulder
81
+ (
82
+ const dictionary& XiEqProperties,
83
+ const psiuMulticomponentThermo& thermo,
84
+ const compressible::RASModel& turbulence,
85
+ const volScalarField& Su
86
+ );
87
+
88
+ //- Disallow default bitwise copy construction
89
+ Gulder(const Gulder&) = delete;
90
+
91
+
92
+ //- Destructor
93
+ virtual ~Gulder();
94
+
95
+
96
+ // Member Functions
97
+
98
+ //- Return the flame-wrinkling XiEq
99
+ virtual tmp<volScalarField> XiEq() const;
100
+
101
+ //- Update properties from given dictionary
102
+ virtual bool read(const dictionary& XiEqProperties);
103
+
104
+
105
+ // Member Operators
106
+
107
+ //- Disallow default bitwise assignment
108
+ void operator=(const Gulder&) = delete;
109
+ };
110
+
111
+
112
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
113
+
114
+ } // End namespace XiEqModels
115
+ } // End namespace Foam
116
+
117
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118
+
119
+ #endif
120
+
121
+ // ************************************************************************* //
data/applications/legacy/combustion/PDRFoam/XiModels/XiEqModels/SCOPEBlendXiEq/SCOPEBlendXiEq.C ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*---------------------------------------------------------------------------*\
2
+ ========= |
3
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
+ \\ / O peration | Website: https://openfoam.org
5
+ \\ / A nd | Copyright (C) 2011-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 "SCOPEBlendXiEq.H"
27
+ #include "addToRunTimeSelectionTable.H"
28
+
29
+ // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
30
+
31
+ namespace Foam
32
+ {
33
+ namespace XiEqModels
34
+ {
35
+ defineTypeNameAndDebug(SCOPEBlend, 0);
36
+ addToRunTimeSelectionTable(XiEqModel, SCOPEBlend, dictionary);
37
+ }
38
+ }
39
+
40
+
41
+ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
42
+
43
+ Foam::XiEqModels::SCOPEBlend::SCOPEBlend
44
+ (
45
+ const dictionary& XiEqProperties,
46
+ const psiuMulticomponentThermo& thermo,
47
+ const compressible::RASModel& turbulence,
48
+ const volScalarField& Su
49
+ )
50
+ :
51
+ XiEqModel(XiEqProperties, thermo, turbulence, Su),
52
+ XiEqModelL_
53
+ (
54
+ XiEqModel::New
55
+ (
56
+ XiEqModelCoeffs_.subDict("XiEqModelL"),
57
+ thermo,
58
+ turbulence,
59
+ Su
60
+ )
61
+ ),
62
+ XiEqModelH_
63
+ (
64
+ XiEqModel::New
65
+ (
66
+ XiEqModelCoeffs_.subDict("XiEqModelH"),
67
+ thermo,
68
+ turbulence,
69
+ Su
70
+ )
71
+ )
72
+ {}
73
+
74
+
75
+ // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
76
+
77
+ Foam::XiEqModels::SCOPEBlend::~SCOPEBlend()
78
+ {}
79
+
80
+
81
+ // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
82
+
83
+ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::SCOPEBlend::XiEq() const
84
+ {
85
+ return 1/pow025
86
+ (
87
+ pow4(1.0/XiEqModelL_->XiEq()) + pow4(1.0/XiEqModelH_->XiEq())
88
+ );
89
+ }
90
+
91
+
92
+ // ************************************************************************* //
data/applications/legacy/combustion/PDRFoam/XiModels/XiEqModels/SCOPEBlendXiEq/SCOPEBlendXiEq.H ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*---------------------------------------------------------------------------*\
2
+ ========= |
3
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
+ \\ / O peration | Website: https://openfoam.org
5
+ \\ / A nd | Copyright (C) 2011-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
+ Class
25
+ Foam::XiEqModels::SCOPEBlend
26
+
27
+ Description
28
+ Simple SCOPEBlendXiEq model for XiEq based on SCOPEXiEqs correlation
29
+ with a linear correction function to give a plausible profile for XiEq.
30
+ See @link SCOPELaminarFlameSpeed.H @endlink for details on the SCOPE
31
+ laminar flame speed model.
32
+
33
+ SourceFiles
34
+ SCOPEBlend.C
35
+
36
+ \*---------------------------------------------------------------------------*/
37
+
38
+ #ifndef SCOPEBlendXiEq_H
39
+ #define SCOPEBlendXiEq_H
40
+
41
+ #include "XiEqModel.H"
42
+
43
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44
+
45
+ namespace Foam
46
+ {
47
+ namespace XiEqModels
48
+ {
49
+
50
+ /*---------------------------------------------------------------------------*\
51
+ Class SCOPEBlend Declaration
52
+ \*---------------------------------------------------------------------------*/
53
+
54
+ class SCOPEBlend
55
+ :
56
+ public XiEqModel
57
+ {
58
+ // Private Data
59
+
60
+ //- Low turbulence intensity equilibrium Xi model
61
+ autoPtr<XiEqModel> XiEqModelL_;
62
+
63
+ //- High turbulence intensity equilibrium Xi model
64
+ autoPtr<XiEqModel> XiEqModelH_;
65
+
66
+
67
+ public:
68
+
69
+ //- Runtime type information
70
+ TypeName("SCOPEBlend");
71
+
72
+
73
+ // Constructors
74
+
75
+ //- Construct from components
76
+ SCOPEBlend
77
+ (
78
+ const dictionary& XiEqProperties,
79
+ const psiuMulticomponentThermo& thermo,
80
+ const compressible::RASModel& turbulence,
81
+ const volScalarField& Su
82
+ );
83
+
84
+ //- Disallow default bitwise copy construction
85
+ SCOPEBlend(const SCOPEBlend&) = delete;
86
+
87
+
88
+ //- Destructor
89
+ virtual ~SCOPEBlend();
90
+
91
+
92
+ // Member Functions
93
+
94
+ //- Return the flame-wrinkling XiEq
95
+ virtual tmp<volScalarField> XiEq() const;
96
+
97
+ //- Update properties from given dictionary
98
+ virtual bool read(const dictionary& XiEqProperties)
99
+ {
100
+ return true;
101
+ }
102
+
103
+
104
+ // Member Operators
105
+
106
+ //- Disallow default bitwise assignment
107
+ void operator=(const SCOPEBlend&) = delete;
108
+ };
109
+
110
+
111
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
112
+
113
+ } // End namespace XiEqModels
114
+ } // End namespace Foam
115
+
116
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117
+
118
+ #endif
119
+
120
+ // ************************************************************************* //
data/applications/legacy/combustion/PDRFoam/XiModels/XiEqModels/SCOPEXiEq/SCOPEXiEq.C ADDED
@@ -0,0 +1,163 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*---------------------------------------------------------------------------*\
2
+ ========= |
3
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
+ \\ / O peration | Website: https://openfoam.org
5
+ \\ / A nd | Copyright (C) 2011-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 "SCOPEXiEq.H"
27
+ #include "addToRunTimeSelectionTable.H"
28
+
29
+ // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
30
+
31
+ namespace Foam
32
+ {
33
+ namespace XiEqModels
34
+ {
35
+ defineTypeNameAndDebug(SCOPEXiEq, 0);
36
+ addToRunTimeSelectionTable(XiEqModel, SCOPEXiEq, dictionary);
37
+ }
38
+ }
39
+
40
+
41
+ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
42
+
43
+ Foam::XiEqModels::SCOPEXiEq::SCOPEXiEq
44
+ (
45
+ const dictionary& XiEqProperties,
46
+ const psiuMulticomponentThermo& thermo,
47
+ const compressible::RASModel& turbulence,
48
+ const volScalarField& Su
49
+ )
50
+ :
51
+ XiEqModel(XiEqProperties, thermo, turbulence, Su),
52
+ XiEqCoef_(XiEqModelCoeffs_.lookup<scalar>("XiEqCoef")),
53
+ XiEqExp_(XiEqModelCoeffs_.lookup<scalar>("XiEqExp")),
54
+ lCoef_(XiEqModelCoeffs_.lookup<scalar>("lCoef")),
55
+ SuMin_(0.01*average(Su())),
56
+ uPrimeCoef_(XiEqModelCoeffs_.lookup<scalar>("uPrimeCoef")),
57
+ subGridSchelkin_
58
+ (
59
+ readBool(XiEqModelCoeffs_.lookup("subGridSchelkin"))
60
+ ),
61
+ MaModel
62
+ (
63
+ Su.mesh().lookupObject<IOdictionary>("combustionProperties")
64
+ .subDict("laminarFlameSpeed"),
65
+ Su.mesh().lookupObject<IOdictionary>("combustionProperties")
66
+ .subDict("laminarFlameSpeed").subDict
67
+ (
68
+ Su.mesh().lookupObject<IOdictionary>("combustionProperties")
69
+ .subDict("laminarFlameSpeed").lookup("fuel")
70
+ ),
71
+ thermo
72
+ )
73
+ {}
74
+
75
+
76
+ // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
77
+
78
+ Foam::XiEqModels::SCOPEXiEq::~SCOPEXiEq()
79
+ {}
80
+
81
+
82
+ // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
83
+
84
+ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::SCOPEXiEq::XiEq() const
85
+ {
86
+ tmp<volScalarField> tk = turbulence_.k();
87
+ const volScalarField& k = tk();
88
+
89
+ tmp<volScalarField> tepsilon = turbulence_.epsilon();
90
+ const volScalarField& epsilon = tepsilon();
91
+
92
+ volScalarField up(sqrt((2.0/3.0)*k));
93
+ if (subGridSchelkin_)
94
+ {
95
+ up.primitiveFieldRef() += calculateSchelkinEffect(uPrimeCoef_);
96
+ }
97
+
98
+ volScalarField l(lCoef_*sqrt(3.0/2.0)*up*k/epsilon);
99
+ volScalarField Rl(up*l*thermo_.rhou()/thermo_.muu());
100
+
101
+ volScalarField upBySu(up/(Su_ + SuMin_));
102
+ volScalarField K(0.157*upBySu/sqrt(Rl));
103
+ volScalarField Ma(MaModel.Ma());
104
+
105
+ tmp<volScalarField> tXiEq
106
+ (
107
+ volScalarField::New
108
+ (
109
+ "XiEq",
110
+ epsilon.mesh(),
111
+ dimensionedScalar(dimless, 0)
112
+ )
113
+ );
114
+ volScalarField& xieq = tXiEq.ref();
115
+
116
+ forAll(xieq, celli)
117
+ {
118
+ if (Ma[celli] > 0.01)
119
+ {
120
+ xieq[celli] =
121
+ XiEqCoef_*pow(K[celli]*Ma[celli], -XiEqExp_)*upBySu[celli];
122
+ }
123
+ }
124
+
125
+ volScalarField::BoundaryField& xieqBf = xieq.boundaryFieldRef();
126
+
127
+ forAll(xieq.boundaryField(), patchi)
128
+ {
129
+ scalarField& xieqp = xieqBf[patchi];
130
+ const scalarField& Kp = K.boundaryField()[patchi];
131
+ const scalarField& Map = Ma.boundaryField()[patchi];
132
+ const scalarField& upBySup = upBySu.boundaryField()[patchi];
133
+
134
+ forAll(xieqp, facei)
135
+ {
136
+ if (Ma[facei] > 0.01)
137
+ {
138
+ xieqp[facei] =
139
+ XiEqCoef_*pow(Kp[facei]*Map[facei], -XiEqExp_)
140
+ *upBySup[facei];
141
+ }
142
+ }
143
+ }
144
+
145
+ return tXiEq;
146
+ }
147
+
148
+
149
+ bool Foam::XiEqModels::SCOPEXiEq::read(const dictionary& XiEqProperties)
150
+ {
151
+ XiEqModel::read(XiEqProperties);
152
+
153
+ XiEqModelCoeffs_.lookup("XiEqCoef") >> XiEqCoef_;
154
+ XiEqModelCoeffs_.lookup("XiEqExp") >> XiEqExp_;
155
+ XiEqModelCoeffs_.lookup("lCoef") >> lCoef_;
156
+ XiEqModelCoeffs_.lookup("uPrimeCoef") >> uPrimeCoef_;
157
+ XiEqModelCoeffs_.lookup("subGridSchelkin") >> subGridSchelkin_;
158
+
159
+ return true;
160
+ }
161
+
162
+
163
+ // ************************************************************************* //
data/applications/legacy/combustion/PDRFoam/XiModels/XiEqModels/SCOPEXiEq/SCOPEXiEq.H ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*---------------------------------------------------------------------------*\
2
+ ========= |
3
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
+ \\ / O peration | Website: https://openfoam.org
5
+ \\ / A nd | Copyright (C) 2011-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
+ Class
25
+ Foam::XiEqModels::SCOPEXiEq
26
+
27
+ Description
28
+ Simple SCOPEXiEq model for XiEq based on SCOPEXiEqs correlation
29
+ with a linear correction function to give a plausible profile for XiEq.
30
+ See \link SCOPELaminarFlameSpeed.H \endlink for details on the SCOPE laminar
31
+ flame speed model.
32
+
33
+ SourceFiles
34
+ SCOPEXiEq.C
35
+
36
+ \*---------------------------------------------------------------------------*/
37
+
38
+ #ifndef SCOPEXiEq_H
39
+ #define SCOPEXiEq_H
40
+
41
+ #include "XiEqModel.H"
42
+ #include "SCOPELaminarFlameSpeed.H"
43
+
44
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45
+
46
+ namespace Foam
47
+ {
48
+ namespace XiEqModels
49
+ {
50
+
51
+ /*---------------------------------------------------------------------------*\
52
+ Class SCOPEXiEq Declaration
53
+ \*---------------------------------------------------------------------------*/
54
+
55
+ class SCOPEXiEq
56
+ :
57
+ public XiEqModel
58
+ {
59
+ // Private Data
60
+
61
+ // Model constant
62
+ scalar XiEqCoef_;
63
+
64
+ // Model constant
65
+ scalar XiEqExp_;
66
+
67
+ // Model constant
68
+ scalar lCoef_;
69
+
70
+ //- Minimum Su
71
+ dimensionedScalar SuMin_;
72
+
73
+ //- Schelkin effect Model constant
74
+ scalar uPrimeCoef_;
75
+
76
+ //- Use sub-grid Schelkin effect
77
+ bool subGridSchelkin_;
78
+
79
+ //- The SCOPE laminar flame speed model used to obtain the
80
+ // Marstein number. Note: the laminar flame speed need not be
81
+ // obtained form the same model.
82
+ laminarFlameSpeedModels::SCOPE MaModel;
83
+
84
+
85
+ public:
86
+
87
+ //- Runtime type information
88
+ TypeName("SCOPEXiEq");
89
+
90
+
91
+ // Constructors
92
+
93
+ //- Construct from components
94
+ SCOPEXiEq
95
+ (
96
+ const dictionary& XiEqProperties,
97
+ const psiuMulticomponentThermo& thermo,
98
+ const compressible::RASModel& turbulence,
99
+ const volScalarField& Su
100
+ );
101
+
102
+ //- Disallow default bitwise copy construction
103
+ SCOPEXiEq(const SCOPEXiEq&) = delete;
104
+
105
+
106
+ //- Destructor
107
+ virtual ~SCOPEXiEq();
108
+
109
+
110
+ // Member Functions
111
+
112
+ //- Return the flame-wrinkling XiEq
113
+ virtual tmp<volScalarField> XiEq() const;
114
+
115
+ //- Update properties from given dictionary
116
+ virtual bool read(const dictionary& XiEqProperties);
117
+
118
+
119
+ // Member Operators
120
+
121
+ //- Disallow default bitwise assignment
122
+ void operator=(const SCOPEXiEq&) = delete;
123
+ };
124
+
125
+
126
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127
+
128
+ } // End namespace XiEqModels
129
+ } // End namespace Foam
130
+
131
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132
+
133
+ #endif
134
+
135
+ // ************************************************************************* //
data/applications/legacy/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModel.C ADDED
@@ -0,0 +1,165 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*---------------------------------------------------------------------------*\
2
+ ========= |
3
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
+ \\ / O peration | Website: https://openfoam.org
5
+ \\ / A nd | Copyright (C) 2011-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 "XiEqModel.H"
27
+
28
+ // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
29
+
30
+ namespace Foam
31
+ {
32
+ defineTypeNameAndDebug(XiEqModel, 0);
33
+ defineRunTimeSelectionTable(XiEqModel, dictionary);
34
+ }
35
+
36
+
37
+ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
38
+
39
+ Foam::XiEqModel::XiEqModel
40
+ (
41
+ const dictionary& XiEqProperties,
42
+ const psiuMulticomponentThermo& thermo,
43
+ const compressible::RASModel& turbulence,
44
+ const volScalarField& Su
45
+ )
46
+ :
47
+ XiEqModelCoeffs_
48
+ (
49
+ XiEqProperties.typeDict
50
+ (
51
+ XiEqProperties.lookup<word>("XiEqModel")
52
+ )
53
+ ),
54
+ thermo_(thermo),
55
+ turbulence_(turbulence),
56
+ Su_(Su)
57
+ {}
58
+
59
+
60
+ // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
61
+
62
+ Foam::XiEqModel::~XiEqModel()
63
+ {}
64
+
65
+
66
+ // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
67
+
68
+ bool Foam::XiEqModel::read(const dictionary& XiEqProperties)
69
+ {
70
+ XiEqModelCoeffs_ = XiEqProperties.optionalTypeDict(type());
71
+
72
+ return true;
73
+ }
74
+
75
+
76
+ void Foam::XiEqModel::writeFields() const
77
+ {
78
+ //***HGW It is not clear why B is written here
79
+ if (Su_.mesh().foundObject<volSymmTensorField>("B"))
80
+ {
81
+ const volSymmTensorField& B =
82
+ Su_.mesh().lookupObject<volSymmTensorField>("B");
83
+ B.write();
84
+ }
85
+ }
86
+
87
+
88
+ Foam::tmp<Foam::volScalarField>
89
+ Foam::XiEqModel::calculateSchelkinEffect(const scalar uPrimeCoef) const
90
+ {
91
+ const fvMesh& mesh = Su_.mesh();
92
+
93
+ const volVectorField& U = mesh.lookupObject<volVectorField>("U");
94
+ const volSymmTensorField& CT = mesh.lookupObject<volSymmTensorField>("CT");
95
+ const volScalarField& Nv = mesh.lookupObject<volScalarField>("Nv");
96
+ const volSymmTensorField& nsv =
97
+ mesh.lookupObject<volSymmTensorField>("nsv");
98
+
99
+ tmp<volScalarField> tN
100
+ (
101
+ volScalarField::New
102
+ (
103
+ "tN",
104
+ mesh,
105
+ dimensionedScalar(Nv.dimensions(), 0)
106
+ )
107
+ );
108
+ volScalarField& N = tN.ref();
109
+ N.primitiveFieldRef() =
110
+ Nv.primitiveField()*pow(mesh.V().primitiveField(), 2.0/3.0);
111
+
112
+ volSymmTensorField ns
113
+ (
114
+ IOobject
115
+ (
116
+ "tns",
117
+ mesh.time().name(),
118
+ mesh,
119
+ IOobject::NO_READ,
120
+ IOobject::NO_WRITE
121
+ ),
122
+ mesh,
123
+ dimensionedSymmTensor
124
+ (
125
+ "zero",
126
+ nsv.dimensions(),
127
+ Zero
128
+ )
129
+ );
130
+ ns.primitiveFieldRef() =
131
+ nsv.primitiveField()*pow(mesh.V().primitiveField(), 2.0/3.0);
132
+
133
+ const volVectorField Uhat
134
+ (
135
+ U/(mag(U) + dimensionedScalar(U.dimensions(), 1e-4))
136
+ );
137
+
138
+ const volScalarField nr(sqrt(max(N - (Uhat & ns & Uhat), scalar(1e-4))));
139
+
140
+ const scalarField cellWidth(pow(mesh.V().primitiveField(), 1.0/3.0));
141
+
142
+ const scalarField upLocal
143
+ (
144
+ uPrimeCoef
145
+ *sqrt
146
+ (
147
+ (U.primitiveField() & CT.primitiveField() & U.primitiveField())
148
+ *cellWidth
149
+ )
150
+ );
151
+
152
+ const scalarField deltaUp
153
+ (
154
+ upLocal*(max(scalar(1), pow(nr.primitiveField(), 0.5)) - 1.0)
155
+ );
156
+
157
+ // Re use tN
158
+ N.primitiveFieldRef() =
159
+ upLocal*(max(scalar(1), pow(nr.primitiveField(), 0.5)) - 1.0);
160
+
161
+ return tN;
162
+ }
163
+
164
+
165
+ // ************************************************************************* //
data/applications/legacy/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModel.H ADDED
@@ -0,0 +1,167 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*---------------------------------------------------------------------------*\
2
+ ========= |
3
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
+ \\ / O peration | Website: https://openfoam.org
5
+ \\ / A nd | Copyright (C) 2011-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
+ Class
25
+ Foam::XiEqModel
26
+
27
+ Description
28
+ Base-class for all XiEq models used by the b-XiEq combustion model.
29
+ The available models are :
30
+ \link basicXiSubXiEq.H \endlink
31
+ \link Gulder.H \endlink
32
+ \link instabilityXiEq.H \endlink
33
+ \link SCOPEBlendXiEq.H \endlink
34
+ \link SCOPEXiEq.H \endlink
35
+
36
+ SourceFiles
37
+ XiEqModel.C
38
+
39
+ \*---------------------------------------------------------------------------*/
40
+
41
+ #ifndef XiEqModel_H
42
+ #define XiEqModel_H
43
+
44
+ #include "IOdictionary.H"
45
+ #include "psiuMulticomponentThermo.H"
46
+ #include "compressibleMomentumTransportModels.H"
47
+ #include "runTimeSelectionTables.H"
48
+
49
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50
+
51
+ namespace Foam
52
+ {
53
+
54
+ /*---------------------------------------------------------------------------*\
55
+ Class XiEqModel Declaration
56
+ \*---------------------------------------------------------------------------*/
57
+
58
+ class XiEqModel
59
+ {
60
+
61
+ protected:
62
+
63
+ // Protected data
64
+
65
+ //- Dictionary
66
+ dictionary XiEqModelCoeffs_;
67
+
68
+ //- Thermo
69
+ const psiuMulticomponentThermo& thermo_;
70
+
71
+ //- Turbulence
72
+ const compressible::RASModel& turbulence_;
73
+
74
+ //- Laminar burning velocity
75
+ const volScalarField& Su_;
76
+
77
+
78
+ public:
79
+
80
+ //- Runtime type information
81
+ TypeName("XiEqModel");
82
+
83
+
84
+ // Declare run-time constructor selection table
85
+
86
+ declareRunTimeSelectionTable
87
+ (
88
+ autoPtr,
89
+ XiEqModel,
90
+ dictionary,
91
+ (
92
+ const dictionary& XiEqProperties,
93
+ const psiuMulticomponentThermo& thermo,
94
+ const compressible::RASModel& turbulence,
95
+ const volScalarField& Su
96
+ ),
97
+ (
98
+ XiEqProperties,
99
+ thermo,
100
+ turbulence,
101
+ Su
102
+ )
103
+ );
104
+
105
+
106
+ // Constructors
107
+
108
+ //- Construct from components
109
+ XiEqModel
110
+ (
111
+ const dictionary& XiEqProperties,
112
+ const psiuMulticomponentThermo& thermo,
113
+ const compressible::RASModel& turbulence,
114
+ const volScalarField& Su
115
+ );
116
+
117
+ //- Disallow default bitwise copy construction
118
+ XiEqModel(const XiEqModel&) = delete;
119
+
120
+
121
+ // Selectors
122
+
123
+ //- Return a reference to the selected XiEq model
124
+ static autoPtr<XiEqModel> New
125
+ (
126
+ const dictionary& XiEqProperties,
127
+ const psiuMulticomponentThermo& thermo,
128
+ const compressible::RASModel& turbulence,
129
+ const volScalarField& Su
130
+ );
131
+
132
+
133
+ //- Destructor
134
+ virtual ~XiEqModel();
135
+
136
+
137
+ // Member Functions
138
+
139
+ //- Return the flame-wrinkling XiEq
140
+ virtual tmp<volScalarField> XiEq() const = 0;
141
+
142
+ //- Return the sub-grid Schelkin effect
143
+ tmp<volScalarField> calculateSchelkinEffect(const scalar) const;
144
+
145
+ //- Update properties from given dictionary
146
+ virtual bool read(const dictionary& XiEqProperties) = 0;
147
+
148
+ //- Write fields
149
+ void writeFields() const;
150
+
151
+
152
+ // Member Operators
153
+
154
+ //- Disallow default bitwise assignment
155
+ void operator=(const XiEqModel&) = delete;
156
+ };
157
+
158
+
159
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160
+
161
+ } // End namespace Foam
162
+
163
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164
+
165
+ #endif
166
+
167
+ // ************************************************************************* //
data/applications/legacy/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModelNew.C ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*---------------------------------------------------------------------------*\
2
+ ========= |
3
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
+ \\ / O peration | Website: https://openfoam.org
5
+ \\ / A nd | Copyright (C) 2011-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 "XiEqModel.H"
27
+
28
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
29
+
30
+ Foam::autoPtr<Foam::XiEqModel> Foam::XiEqModel::New
31
+ (
32
+ const dictionary& propDict,
33
+ const psiuMulticomponentThermo& thermo,
34
+ const compressible::RASModel& turbulence,
35
+ const volScalarField& Su
36
+ )
37
+ {
38
+ const word modelType(propDict.lookup("XiEqModel"));
39
+
40
+ Info<< indentOrNl
41
+ << "Selecting flame-wrinkling model " << modelType << endl;
42
+
43
+ dictionaryConstructorTable::iterator cstrIter =
44
+ dictionaryConstructorTablePtr_->find(modelType);
45
+
46
+ if (cstrIter == dictionaryConstructorTablePtr_->end())
47
+ {
48
+ FatalIOErrorInFunction(propDict)
49
+ << "Unknown XiEqModel type "
50
+ << modelType << nl << nl
51
+ << "Valid XiEqModels are : " << endl
52
+ << dictionaryConstructorTablePtr_->sortedToc()
53
+ << exit(FatalIOError);
54
+ }
55
+
56
+ return autoPtr<XiEqModel>(cstrIter()(propDict, thermo, turbulence, Su));
57
+ }
58
+
59
+
60
+ // ************************************************************************* //
data/applications/legacy/combustion/PDRFoam/XiModels/XiEqModels/instabilityXiEq/instabilityXiEq.C ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*---------------------------------------------------------------------------*\
2
+ ========= |
3
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
+ \\ / O peration | Website: https://openfoam.org
5
+ \\ / A nd | Copyright (C) 2011-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 "instabilityXiEq.H"
27
+ #include "addToRunTimeSelectionTable.H"
28
+
29
+ // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
30
+
31
+ namespace Foam
32
+ {
33
+ namespace XiEqModels
34
+ {
35
+ defineTypeNameAndDebug(instability, 0);
36
+ addToRunTimeSelectionTable(XiEqModel, instability, dictionary);
37
+ }
38
+ }
39
+
40
+
41
+ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
42
+
43
+ Foam::XiEqModels::instability::instability
44
+ (
45
+ const dictionary& XiEqProperties,
46
+ const psiuMulticomponentThermo& thermo,
47
+ const compressible::RASModel& turbulence,
48
+ const volScalarField& Su
49
+ )
50
+ :
51
+ XiEqModel(XiEqProperties, thermo, turbulence, Su),
52
+ XiEqIn(XiEqModelCoeffs_.lookup<scalar>("XiEqIn")),
53
+ XiEqModel_(XiEqModel::New(XiEqModelCoeffs_, thermo, turbulence, Su))
54
+ {}
55
+
56
+
57
+ // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
58
+
59
+ Foam::XiEqModels::instability::~instability()
60
+ {}
61
+
62
+
63
+ // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
64
+
65
+ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::instability::XiEq() const
66
+ {
67
+ volScalarField turbXiEq(XiEqModel_->XiEq());
68
+ return XiEqIn/turbXiEq + turbXiEq;
69
+ }
70
+
71
+
72
+ bool Foam::XiEqModels::instability::read(const dictionary& XiEqProperties)
73
+ {
74
+ XiEqModel::read(XiEqProperties);
75
+
76
+ XiEqModelCoeffs_.lookup("XiEqIn") >> XiEqIn;
77
+
78
+ return XiEqModel_->read(XiEqModelCoeffs_);
79
+ }
80
+
81
+
82
+ // ************************************************************************* //
data/applications/legacy/combustion/PDRFoam/XiModels/XiEqModels/instabilityXiEq/instabilityXiEq.H ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*---------------------------------------------------------------------------*\
2
+ ========= |
3
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
+ \\ / O peration | Website: https://openfoam.org
5
+ \\ / A nd | Copyright (C) 2011-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
+ Class
25
+ Foam::XiEqModels::instability
26
+
27
+ Description
28
+ This is the equilibrium level of the flame wrinkling generated by
29
+ instability. It is a constant (default 2.5). It is used in
30
+ @link XiModel.H @endlink.
31
+
32
+ SourceFiles
33
+ instability.C
34
+
35
+ \*---------------------------------------------------------------------------*/
36
+
37
+ #ifndef instabilityXiEq_H
38
+ #define instabilityXiEq_H
39
+
40
+ #include "XiEqModel.H"
41
+
42
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43
+
44
+ namespace Foam
45
+ {
46
+ namespace XiEqModels
47
+ {
48
+
49
+ /*---------------------------------------------------------------------------*\
50
+ Class instability Declaration
51
+ \*---------------------------------------------------------------------------*/
52
+
53
+ class instability
54
+ :
55
+ public XiEqModel
56
+ {
57
+ // Private Data
58
+
59
+ //- Equilibrium Xi due to instability only
60
+ scalar XiEqIn;
61
+
62
+ //- Equilibrium Xi model due to all other effects
63
+ autoPtr<XiEqModel> XiEqModel_;
64
+
65
+
66
+ public:
67
+
68
+ //- Runtime type information
69
+ TypeName("instability");
70
+
71
+
72
+ // Constructors
73
+
74
+ //- Construct from components
75
+ instability
76
+ (
77
+ const dictionary& XiEqProperties,
78
+ const psiuMulticomponentThermo& thermo,
79
+ const compressible::RASModel& turbulence,
80
+ const volScalarField& Su
81
+ );
82
+
83
+ //- Disallow default bitwise copy construction
84
+ instability(const instability&) = delete;
85
+
86
+
87
+ //- Destructor
88
+ virtual ~instability();
89
+
90
+
91
+ // Member Functions
92
+
93
+ //- Return the flame-wrinkling XiEq
94
+ virtual tmp<volScalarField> XiEq() const;
95
+
96
+ //- Update properties from given dictionary
97
+ virtual bool read(const dictionary& XiEqProperties);
98
+
99
+
100
+ // Member Operators
101
+
102
+ //- Disallow default bitwise assignment
103
+ void operator=(const instability&) = delete;
104
+ };
105
+
106
+
107
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
108
+
109
+ } // End namespace XiEqModels
110
+ } // End namespace Foam
111
+
112
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
113
+
114
+ #endif
115
+
116
+ // ************************************************************************* //
data/applications/legacy/combustion/PDRFoam/XiModels/XiGModels/KTS/KTS.C ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*---------------------------------------------------------------------------*\
2
+ ========= |
3
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
+ \\ / O peration | Website: https://openfoam.org
5
+ \\ / A nd | Copyright (C) 2011-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 "KTS.H"
27
+ #include "addToRunTimeSelectionTable.H"
28
+
29
+ // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
30
+
31
+ namespace Foam
32
+ {
33
+ namespace XiGModels
34
+ {
35
+ defineTypeNameAndDebug(KTS, 0);
36
+ addToRunTimeSelectionTable(XiGModel, KTS, dictionary);
37
+ }
38
+ }
39
+
40
+
41
+ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
42
+
43
+ Foam::XiGModels::KTS::KTS
44
+ (
45
+ const dictionary& XiGProperties,
46
+ const psiuMulticomponentThermo& thermo,
47
+ const compressible::RASModel& turbulence,
48
+ const volScalarField& Su
49
+ )
50
+ :
51
+ XiGModel(XiGProperties, thermo, turbulence, Su),
52
+ GEtaCoef_(XiGModelCoeffs_.lookup<scalar>("GEtaCoef"))
53
+ {}
54
+
55
+
56
+ // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
57
+
58
+ Foam::XiGModels::KTS::~KTS()
59
+ {}
60
+
61
+
62
+ // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
63
+
64
+ Foam::tmp<Foam::volScalarField> Foam::XiGModels::KTS::G() const
65
+ {
66
+ volScalarField up(sqrt((2.0/3.0)*turbulence_.k()));
67
+
68
+ tmp<volScalarField> tepsilon = turbulence_.epsilon();
69
+ const volScalarField& epsilon = tepsilon();
70
+
71
+ volScalarField tauEta(sqrt(mag(thermo_.muu()/(thermo_.rhou()*epsilon))));
72
+
73
+ return (GEtaCoef_/tauEta);
74
+ }
75
+
76
+
77
+ bool Foam::XiGModels::KTS::read(const dictionary& XiGProperties)
78
+ {
79
+ XiGModel::read(XiGProperties);
80
+
81
+ XiGModelCoeffs_.lookup("GEtaCoef") >> GEtaCoef_;
82
+
83
+ return true;
84
+ }
85
+
86
+
87
+ // ************************************************************************* //
data/applications/legacy/combustion/PDRFoam/XiModels/XiGModels/KTS/KTS.H ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*---------------------------------------------------------------------------*\
2
+ ========= |
3
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
+ \\ / O peration | Website: https://openfoam.org
5
+ \\ / A nd | Copyright (C) 2011-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
+ Class
25
+ Foam::XiGModels::KTS
26
+
27
+ Description
28
+ Simple Kolmogorov time-scale (KTS) model for the flame-wrinkling generation
29
+ rate.
30
+
31
+ SourceFiles
32
+ KTS.C
33
+
34
+ \*---------------------------------------------------------------------------*/
35
+
36
+ #ifndef KTS_H
37
+ #define KTS_H
38
+
39
+ #include "XiGModel.H"
40
+
41
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42
+
43
+ namespace Foam
44
+ {
45
+ namespace XiGModels
46
+ {
47
+
48
+ /*---------------------------------------------------------------------------*\
49
+ Class KTS Declaration
50
+ \*---------------------------------------------------------------------------*/
51
+
52
+ class KTS
53
+ :
54
+ public XiGModel
55
+ {
56
+ // Private Data
57
+
58
+ scalar GEtaCoef_;
59
+
60
+
61
+ public:
62
+
63
+ //- Runtime type information
64
+ TypeName("KTS");
65
+
66
+
67
+ // Constructors
68
+
69
+ //- Construct from components
70
+ KTS
71
+ (
72
+ const dictionary& XiGProperties,
73
+ const psiuMulticomponentThermo& thermo,
74
+ const compressible::RASModel& turbulence,
75
+ const volScalarField& Su
76
+ );
77
+
78
+ //- Disallow default bitwise copy construction
79
+ KTS(const KTS&) = delete;
80
+
81
+
82
+ //- Destructor
83
+ virtual ~KTS();
84
+
85
+
86
+ // Member Functions
87
+
88
+ //- Return the flame-wrinkling generation rate
89
+ virtual tmp<volScalarField> G() const;
90
+
91
+ //- Update properties from given dictionary
92
+ virtual bool read(const dictionary& XiGProperties);
93
+
94
+
95
+ // Member Operators
96
+
97
+ //- Disallow default bitwise assignment
98
+ void operator=(const KTS&) = delete;
99
+ };
100
+
101
+
102
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
103
+
104
+ } // End namespace XiGModels
105
+ } // End namespace Foam
106
+
107
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
108
+
109
+ #endif
110
+
111
+ // ************************************************************************* //
data/applications/legacy/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModel.C ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*---------------------------------------------------------------------------*\
2
+ ========= |
3
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
+ \\ / O peration | Website: https://openfoam.org
5
+ \\ / A nd | Copyright (C) 2011-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 "XiGModel.H"
27
+
28
+ // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
29
+
30
+ namespace Foam
31
+ {
32
+ defineTypeNameAndDebug(XiGModel, 0);
33
+ defineRunTimeSelectionTable(XiGModel, dictionary);
34
+ }
35
+
36
+
37
+ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
38
+
39
+ Foam::XiGModel::XiGModel
40
+ (
41
+ const dictionary& XiGProperties,
42
+ const psiuMulticomponentThermo& thermo,
43
+ const compressible::RASModel& turbulence,
44
+ const volScalarField& Su
45
+ )
46
+ :
47
+ XiGModelCoeffs_
48
+ (
49
+ XiGProperties.subDict
50
+ (
51
+ XiGProperties.lookup<word>("XiGModel")
52
+ )
53
+ ),
54
+ thermo_(thermo),
55
+ turbulence_(turbulence),
56
+ Su_(Su)
57
+ {}
58
+
59
+
60
+ // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
61
+
62
+ Foam::XiGModel::~XiGModel()
63
+ {}
64
+
65
+
66
+ // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
67
+
68
+ bool Foam::XiGModel::read(const dictionary& XiGProperties)
69
+ {
70
+ XiGModelCoeffs_ = XiGProperties.optionalTypeDict(type());
71
+
72
+ return true;
73
+ }
74
+
75
+
76
+ // ************************************************************************* //
data/applications/legacy/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModel.H ADDED
@@ -0,0 +1,162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*---------------------------------------------------------------------------*\
2
+ ========= |
3
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
+ \\ / O peration | Website: https://openfoam.org
5
+ \\ / A nd | Copyright (C) 2011-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
+ Class
25
+ Foam::XiGModel
26
+
27
+ Description
28
+ Base-class for all Xi generation models used by the b-Xi combustion model.
29
+ See Technical Report SH/RE/01R for details on the PDR modelling. For details
30
+ on the use of XiGModel see \link XiModel.H \endlink. The model available is
31
+ \link instabilityG.H \endlink
32
+
33
+ SourceFiles
34
+ XiGModel.C
35
+
36
+ \*---------------------------------------------------------------------------*/
37
+
38
+ #ifndef XiGModel_H
39
+ #define XiGModel_H
40
+
41
+ #include "IOdictionary.H"
42
+ #include "psiuMulticomponentThermo.H"
43
+ #include "compressibleMomentumTransportModels.H"
44
+ #include "runTimeSelectionTables.H"
45
+
46
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
+
48
+ namespace Foam
49
+ {
50
+
51
+ /*---------------------------------------------------------------------------*\
52
+ Class XiGModel Declaration
53
+ \*---------------------------------------------------------------------------*/
54
+
55
+ class XiGModel
56
+ {
57
+
58
+ protected:
59
+
60
+ // Protected data
61
+
62
+ dictionary XiGModelCoeffs_;
63
+
64
+ const psiuMulticomponentThermo& thermo_;
65
+ const compressible::RASModel& turbulence_;
66
+ const volScalarField& Su_;
67
+
68
+
69
+ public:
70
+
71
+ //- Runtime type information
72
+ TypeName("XiGModel");
73
+
74
+
75
+ // Declare run-time constructor selection table
76
+
77
+ declareRunTimeSelectionTable
78
+ (
79
+ autoPtr,
80
+ XiGModel,
81
+ dictionary,
82
+ (
83
+ const dictionary& XiGProperties,
84
+ const psiuMulticomponentThermo& thermo,
85
+ const compressible::RASModel& turbulence,
86
+ const volScalarField& Su
87
+ ),
88
+ (
89
+ XiGProperties,
90
+ thermo,
91
+ turbulence,
92
+ Su
93
+ )
94
+ );
95
+
96
+
97
+ // Constructors
98
+
99
+ //- Construct from components
100
+ XiGModel
101
+ (
102
+ const dictionary& XiGProperties,
103
+ const psiuMulticomponentThermo& thermo,
104
+ const compressible::RASModel& turbulence,
105
+ const volScalarField& Su
106
+ );
107
+
108
+ //- Disallow default bitwise copy construction
109
+ XiGModel(const XiGModel&) = delete;
110
+
111
+
112
+ // Selectors
113
+
114
+ //- Return a reference to the selected XiG model
115
+ static autoPtr<XiGModel> New
116
+ (
117
+ const dictionary& XiGProperties,
118
+ const psiuMulticomponentThermo& thermo,
119
+ const compressible::RASModel& turbulence,
120
+ const volScalarField& Su
121
+ );
122
+
123
+
124
+ //- Destructor
125
+ virtual ~XiGModel();
126
+
127
+
128
+ // Member Functions
129
+
130
+ //- Return the flame-wrinkling generation rate
131
+ virtual tmp<volScalarField> G() const = 0;
132
+
133
+ //- Return the flame diffusivity
134
+ virtual tmp<volScalarField> Db() const
135
+ {
136
+ return volScalarField::New
137
+ (
138
+ "Db",
139
+ turbulence_.rho()*turbulence_.nuEff()
140
+ );
141
+ }
142
+
143
+ //- Update properties from given dictionary
144
+ virtual bool read(const dictionary& XiGProperties) = 0;
145
+
146
+
147
+ // Member Operators
148
+
149
+ //- Disallow default bitwise assignment
150
+ void operator=(const XiGModel&) = delete;
151
+ };
152
+
153
+
154
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155
+
156
+ } // End namespace Foam
157
+
158
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159
+
160
+ #endif
161
+
162
+ // ************************************************************************* //
data/applications/legacy/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModelNew.C ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*---------------------------------------------------------------------------*\
2
+ ========= |
3
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
+ \\ / O peration | Website: https://openfoam.org
5
+ \\ / A nd | Copyright (C) 2011-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 "XiGModel.H"
27
+
28
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
29
+
30
+ Foam::autoPtr<Foam::XiGModel> Foam::XiGModel::New
31
+ (
32
+ const dictionary& propDict,
33
+ const psiuMulticomponentThermo& thermo,
34
+ const compressible::RASModel& turbulence,
35
+ const volScalarField& Su
36
+ )
37
+ {
38
+ const word modelType(propDict.lookup("XiGModel"));
39
+
40
+ Info<< indentOrNl
41
+ << "Selecting flame-wrinkling model " << modelType << endl;
42
+
43
+ dictionaryConstructorTable::iterator cstrIter =
44
+ dictionaryConstructorTablePtr_->find(modelType);
45
+
46
+ if (cstrIter == dictionaryConstructorTablePtr_->end())
47
+ {
48
+ FatalIOErrorInFunction(propDict)
49
+ << "Unknown XiGModel type "
50
+ << modelType << nl << nl
51
+ << "Valid XiGModels are : " << endl
52
+ << dictionaryConstructorTablePtr_->sortedToc()
53
+ << exit(FatalIOError);
54
+ }
55
+
56
+ return autoPtr<XiGModel>(cstrIter()(propDict, thermo, turbulence, Su));
57
+ }
58
+
59
+
60
+ // ************************************************************************* //
data/applications/legacy/combustion/PDRFoam/XiModels/XiGModels/instabilityG/instabilityG.C ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*---------------------------------------------------------------------------*\
2
+ ========= |
3
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
+ \\ / O peration | Website: https://openfoam.org
5
+ \\ / A nd | Copyright (C) 2011-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 "instabilityG.H"
27
+ #include "addToRunTimeSelectionTable.H"
28
+
29
+ // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
30
+
31
+ namespace Foam
32
+ {
33
+ namespace XiGModels
34
+ {
35
+ defineTypeNameAndDebug(instabilityG, 0);
36
+ addToRunTimeSelectionTable(XiGModel, instabilityG, dictionary);
37
+ }
38
+ }
39
+
40
+
41
+ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
42
+
43
+ Foam::XiGModels::instabilityG::instabilityG
44
+ (
45
+ const dictionary& XiGProperties,
46
+ const psiuMulticomponentThermo& thermo,
47
+ const compressible::RASModel& turbulence,
48
+ const volScalarField& Su
49
+ )
50
+ :
51
+ XiGModel(XiGProperties, thermo, turbulence, Su),
52
+ GIn_(XiGModelCoeffs_.lookup("GIn")),
53
+ lambdaIn_(XiGModelCoeffs_.lookup("lambdaIn")),
54
+ XiGModel_(XiGModel::New(XiGModelCoeffs_, thermo, turbulence, Su))
55
+ {}
56
+
57
+
58
+ // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
59
+
60
+ Foam::XiGModels::instabilityG::~instabilityG()
61
+ {}
62
+
63
+
64
+ // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
65
+
66
+ Foam::tmp<Foam::volScalarField> Foam::XiGModels::instabilityG::G() const
67
+ {
68
+ volScalarField turbXiG(XiGModel_->G());
69
+ return (GIn_*GIn_/(GIn_ + turbXiG) + turbXiG);
70
+ }
71
+
72
+
73
+ Foam::tmp<Foam::volScalarField> Foam::XiGModels::instabilityG::Db() const
74
+ {
75
+ const objectRegistry& db = Su_.db();
76
+ const volScalarField& Xi = db.lookupObject<volScalarField>("Xi");
77
+ const volScalarField& rho = db.lookupObject<volScalarField>("rho");
78
+ const volScalarField& mgb = db.lookupObject<volScalarField>("mgb");
79
+
80
+ return XiGModel_->Db()
81
+ + rho*Su_*(Xi - 1.0)*mgb*(0.5*lambdaIn_)/(mgb + 1.0/lambdaIn_);
82
+ }
83
+
84
+
85
+ bool Foam::XiGModels::instabilityG::read(const dictionary& XiGProperties)
86
+ {
87
+ XiGModel::read(XiGProperties);
88
+
89
+ XiGModelCoeffs_.lookup("GIn") >> GIn_;
90
+ XiGModelCoeffs_.lookup("lambdaIn") >> lambdaIn_;
91
+
92
+ return true;
93
+ }
94
+
95
+
96
+ // ************************************************************************* //