349 Commits
19.09 ... 21.03

Author SHA1 Message Date
6fe6137921 Merge pull request #115 from ParticulateFlow/release
Release 21.03
2021-03-22 17:59:49 +01:00
4ebd073845 add -Wno-deprecated-copy to options
to silence warnings stemming from OpenFOAM in g++ 9
2021-03-12 11:41:25 +01:00
affa8b1aa8 add -Wno-cast-function-type to compiler flags in Makefile
silence -Wcast-function-type warnings (stemming from OpenMPI) enabled by
default in g++8
earlier g++ versions might print a message about unrecognized command
line option '-Wno-cast-function-type' but that is the lesser evil
2021-03-12 10:36:48 +01:00
8c70e97db6 bump version number to 21.03 [ci skip] 2021-03-10 12:41:42 +01:00
953cf4d4ff modified MarkovPath random generation 2020-12-11 10:36:23 +01:00
1a37e99dfd Allow turbulentDispersion model to use kinetic energy either from object registry or calculated from turbulence models. 2020-11-13 10:13:37 +01:00
d3c10ba24d Merge pull request #113 from ParticulateFlow/feature/particledispersion
Feature/particledispersion
2020-11-06 11:20:49 +01:00
9aa0c94bf9 Avoid turbulent fluctuations through boundary. 2020-11-04 07:33:18 +01:00
57e98b2f0e Some testing on the turbulent dispersion model. 2020-11-03 09:51:28 +01:00
25efaffdd2 Lookup turbulent kinetic energy in execution loop. 2020-11-02 10:27:05 +01:00
7eacdef7eb Turbulent dispersion model. 2020-10-30 12:26:09 +01:00
5b07b7d03c Merge pull request #107 from ParticulateFlow/feature/register_atom_props
Register and supply per-particle data pointers centrally in cfdemCloud
2020-10-02 13:03:04 +02:00
80c8d29114 Merge pull request #112 from ParticulateFlow/master
updates from release 20.09
2020-10-02 12:40:25 +02:00
71a78be4c9 Merge pull request #111 from ParticulateFlow/release
Release 20.09
2020-10-01 12:33:40 +02:00
e2b454b036 fix up voidfractionTest case [ci skip]
add post folder and testharness configuration
2020-10-01 10:30:13 +02:00
a0ae8b90f7 bump version number to 20.09 2020-09-22 16:00:04 +02:00
78620f134f define member variables as const where appropriate
turn 'word' member variables into 'const word' if they are initialized
once (in the constructor) and never changed
2020-09-22 11:26:57 +02:00
b8c987ae94 use const word class member variables to store particle property names
internal variable naming convention for registered particle properties:
* suffix 'RegName_' indicates class-internal particle property usage;
these names use the typeName of the class as prefix for uniqueness
* suffix 'Name_' indicates particle properties also used in
give/getData; these names can potentially cause a conflict if multiple
models try to communicate a property with the same name (some of them
can be customized via the couplingProperties dict to resolve this
situation)
2020-09-22 11:20:12 +02:00
139506a28c fix up function parameters of getData/giveData
use 'const word&' instead of 'word' to avoid duplication of word and
correct constness
2020-09-21 17:54:29 +02:00
d605ea1701 add some comments [ci skip] 2020-09-21 12:36:58 +02:00
c13aece161 update chemistry tutorials [ci skip]
adjust setup to changes made in the fix chem/shrink/core implementation
in LIGGGHTS (cf. commit abe32ee)
2020-09-17 16:58:51 +02:00
59d5a1f1fd Merge pull request #109 from ParticulateFlow/feature/drag_schiller_naumann
added coarse graining to SchillerNaumann drag
2020-09-16 11:44:53 +02:00
aa82dad8be Update SchillerNaumannDrag.C
The changes are added.
2020-09-16 10:45:51 +02:00
2f5f10c6a5 added coarse graining to SchillerNaumann drag 2020-09-15 15:38:12 +02:00
40e464ab5e add reset flag for particle properties
use a reset flag to indicate if particle properties should be reset to
the initial value each coupling step (note that the property value is
always reset if re-allocation happens when the number of particles has
changed)
2020-09-08 13:02:16 +02:00
75ffbe02ae reset particle properties only if initVal == 0
else old value may still be required;
potentially, an extra flag in registerParticleProperty to indicate
resetting may be a better approach
2020-09-08 11:12:55 +02:00
b06bb1f98a test memory allocation of registered properties by cfdemCloud
perform per-particle property allocation in cfdemCloud instead of model
if registered size > 0
if no reallocation is triggered due to a change in particle number,
reset data to initial values (if registered size > 0)
2020-08-14 14:16:44 +02:00
647c84d323 use particle property registration in force, region and therm. cond. models 2020-08-11 11:32:35 +02:00
214e10e5a3 use particle property registration in chemistry and energy models 2020-08-10 17:56:44 +02:00
b0533b79ab streamline particle property registration 2020-08-10 15:25:50 +02:00
a83d0290c9 retain backward compatibility with OF4 2020-08-06 20:02:56 +02:00
3ea5bf774a test concept for centralized per-particle properties
register any per-particle properties (here: cellsPerParticle_ of
voidFractionModel) in hashtables in cfdemCloud class and in further
consequence handle access to per-particle data pointers centrally
2020-08-05 17:02:09 +02:00
3b29d96c05 [DOC] update particleCellVolume and volWeightedAverage [ci skip]
add new options
2020-08-03 13:26:56 +02:00
71586e1192 add trilinear voidfraction test case [ci skip]
as in CFDEMcoupling-PUBLIC
2020-08-03 13:06:23 +02:00
39d66506a1 add output option and min/max field values to particleCellVolume
as in CFDEMcoupling-PUBLIC
2020-08-03 12:45:11 +02:00
50bd4a6de3 add output option to volWeightedAverage
as in CFDEMcoupling-PUBLIC
2020-08-03 11:24:57 +02:00
4a11ade3b1 mitigate rounding errors
values should be in range [0;1]
2020-07-30 14:28:37 +02:00
3ffc8eef65 fix per-particle voidfraction in trilinear model
all particles incorrectly received the voidfraction of the same 8 cells
closes #106
2020-07-30 13:18:08 +02:00
d4e6ec2e39 add cfdemCompLIGlib shortcut to bashrc [ci skip]
to just compile LIGGGHTS sublibraries but not LIGGGHTS itself
2020-07-29 18:00:59 +02:00
e8766829cd fix incompatible dimensions in volWeightedAverage
ref() gives access to dimensioned field reference
primitiveFieldRef() gives access to primitive type field reference
(both actually return a 'this'-pointer reference)
2020-07-29 17:26:57 +02:00
d67ee0d63e add testharness config for one2one coupling test [ci skip] 2020-07-17 11:31:43 +02:00
893a8ddf31 add alternative files for one2one coupling in ErgunTestMPI case
for testing one2one coupling model
2020-07-17 11:23:49 +02:00
f07b8f370f restore twoWayOne2One::getNumberOfParticles() method
twoWayOne2One was calling base class method and crashed;
reverts 51d10d7d0f and parts of
4959ffc79f where this method was
mistakenly removed
closes #105
2020-07-16 20:59:26 +02:00
dd5dfb6662 remove outdated rcfdem solver from docs [ci skip] 2020-06-22 09:57:45 +02:00
f3c46fd09f Merge pull request #103 from ParticulateFlow/master
Update from release 20.05
2020-06-22 09:52:21 +02:00
fa584672ab Removed outdated rcfdem solver from compilation list. 2020-06-22 07:56:46 +02:00
aab29ab9bf No fines deposition in too dilute regions. 2020-06-22 07:55:51 +02:00
bba5d13264 Merge pull request #100 from ParticulateFlow/release
Release 20.05
2020-06-17 16:13:42 +02:00
9e38718f7f [DOC] update models list 2020-06-17 15:57:28 +02:00
424c680359 [DOC] update solver list
remove documentation off deleted solver
2020-06-17 15:55:36 +02:00
3b7ba89f7a [DOC] add note about OpenFOAM version required for cfdemSolverMultiphase 2020-06-17 15:29:32 +02:00
68e625defe [DOC] update installation instructions to OpenFOAM 6 2020-06-17 15:07:39 +02:00
408c8a36dc bump version number to 20.05 2020-06-15 15:52:20 +02:00
14d5c30dac Added tutorial case for coupled heat transfer with rCFD. Removed old solver and tutorial. 2020-06-03 11:52:52 +02:00
8489811677 Added option to phase in particle-fluid interaction at beginning of simulation. 2020-06-03 11:50:47 +02:00
37bbb436c2 Updated BF tutorial case. 2020-05-13 11:11:59 +02:00
e417d0dc40 Added option to specify deposition time. 2020-04-24 14:45:27 +02:00
116fd3b810 Merge pull request #99 from ParticulateFlow/feature/fines
Feature/fines
2020-04-23 16:02:54 +02:00
52bcfc5dd3 Update tutorial case. 2020-04-23 07:23:58 +02:00
63f1f8fb68 Limiter for isotropic fluctuations. 2020-04-22 14:37:44 +02:00
5f16dce15b Particle deformation in predefined cell set. 2020-04-09 10:57:26 +02:00
9e8a418576 Coarse-graining factors in BeetstraDrag needs to be mutable. 2020-03-16 11:20:21 +01:00
07828a01f8 Merge branch 'develop' of https://github.com/ParticulateFlow/CFDEMcoupling into develop 2020-03-16 10:35:53 +01:00
5710166ccd Fixed error message. 2020-03-16 10:35:38 +01:00
ea7f37b3e1 Check for particle type. 2020-03-16 09:56:04 +01:00
1f5dcc5f33 Extend particleDeformation model for multiple types. 2020-03-12 16:24:18 +01:00
548df2cd3c Merge with develop and some accompanying cleaning up. 2020-02-10 11:05:44 +01:00
a3166f2aca Made tutorial case for dynamic CZ ready for OF 6. 2020-02-10 08:44:31 +01:00
1a85c87851 More options for thermal conduction through walls. 2020-02-10 07:42:35 +01:00
332dc5e057 New tutorial case for BF with dynamic cohesive zone. 2020-02-10 07:41:33 +01:00
9a81b875f1 Merge branch 'develop' of https://github.com/ParticulateFlow/CFDEMcoupling into develop 2019-11-27 16:15:37 +01:00
bb47fc3583 Initialize particle temperatures within given bounds. 2019-11-27 16:14:26 +01:00
a42e6577b5 [OF6] update CircleCI configuration
by default test against OF6 from now on, thus install openfoam6 package
instead of openfoam4
2019-11-14 15:00:10 +01:00
44eabca09b Merge pull request #98 from ParticulateFlow/feature/openfoam6
Update to OpenFOAM 6
2019-11-14 14:15:43 +01:00
86697d0993 minor changes to some case files related to OF4/OF5/OF6
make switching between OpenFOAM versions a bit easier
2019-11-14 14:12:08 +01:00
b089229109 remove unneded mesh files from tutorial case
these files can be generated by a call to blockMesh
2019-11-14 13:26:44 +01:00
9700a366fe [OF6] update cshrc 2019-11-14 11:41:45 +01:00
6c25adaa31 [OF6] adjust particle position IO
OF5 and above write barycentric coordinates of particles and include
tetFace and tetPt in position file
2019-11-14 10:51:23 +01:00
91a4f03dcc [OF6] update versionInfo.h
compatibility information
2019-11-13 16:57:45 +01:00
7a02baff6d Allow to specify additional LIGGGHTS script to be executed directly before end of coupled run, e.g. for specific cleaning-up tasks. 2019-11-13 16:55:57 +01:00
3351b85908 Bug fix: use of pointers instead of autoPtr in BeetstraDragPoly prevents double destruction at the end of run. 2019-11-13 16:54:25 +01:00
d7375f198e Merge branch 'feature/openfoam6' of https://github.com/ParticulateFlow/CFDEMcoupling into feature/openfoam6 2019-11-13 15:54:41 +01:00
34d5e1dc59 [OF6] exit if cfdemSolverMultiphase is compiled against OF6
cfdemSolverMultiphase malfunctions in combination with OpenFOAM 6.
The root of this erroneous behaviour remains unclear at this point.
2019-11-13 15:53:27 +01:00
fe4016eb52 Update of random number generation. Removed deprecated multiIntervalPath model. 2019-11-13 15:53:27 +01:00
8f94dba403 [OF6] adjust chemistry cases to OF6 syntax
OF4 -> OF5:
functionObjects
volRegion/surfaceRegion -> volFieldValue/surfaceFieldValue
fvOptions
limitTemperatureCoeffs: Tmin/Tmax -> min/max

OF5 -> OF6:
combustionProperties: noCombustion<> -> none (template parameters are no
longer required)
2019-11-13 13:42:38 +01:00
1643f8d908 [OF6] fix volScalarField for heat release rate
OF4 -> OF5/OF6:
dimension of dQ() = dimEnergy/dimTime
->
dimension of Qdot() = dimEnergy/dimVolume/dimTime
2019-11-13 13:05:19 +01:00
dc3194c857 introduce OpenFOAM version flag/make code compile with OF4-OF6
extract major openfoam version from WM_PROJECT_VERSION environment
variable in make/options files and use it for a preprocessor flag
(OPENFOAM_VERSION_MAJOR) for conditional compilation

make CFDEMcoupling compile with OF 4.x, 5.x and 6
2019-11-13 09:11:40 +01:00
fe81287d8d [OF6] nCorrPIMPLE() -> nCorrPimple()
adjust to renamed function
2019-11-12 18:04:47 +01:00
f2f6c4bf8c add missing methods in gerhardsRecModel
just copied from standadRecModel, not tested
2019-11-12 18:02:14 +01:00
a31d9f129e re-add include that got lost in auto-merge 2019-11-12 13:16:35 +01:00
ef43147dc8 update libs to OF6: replace calls to osRandomInteger() and integer(...)
osRandomInteger() does no longer exist in OF6; using zero as seed value
for random number generator instead

integer(lower, upper) does no longer exist in OF6, instead using
sampleAB(lower upper); note that there is a slight difference in the
used range: (upper+1-lower) vs (upper-lower)
2019-11-12 12:05:46 +01:00
314bfdc0ac Merge branch 'develop' into feature/openfoam6
Just resolve merge conflicts, does not yet compile with OF6 !

applications/solvers/rcfdemSolverRhoSteadyPimple/rcfdemSolverRhoSteadyPimple.C
2019-11-12 10:06:50 +01:00
73b4879b06 RanzMarshall heat transfer model extended to initialize particle temperatures with a given field. 2019-11-11 11:00:06 +01:00
db693ef7b8 Updated solver list. 2019-11-07 14:12:16 +01:00
6a96ec4f3d Merge pull request #33 from ParticulateFlow/feature/recurrenceLib
Feature/recurrence lib
2019-11-07 13:17:56 +01:00
1fb208082b Obsolete code. Found better solution in steadyDEM. 2019-11-07 12:24:08 +01:00
29cc09a876 Removed double line break. 2019-11-07 12:23:19 +01:00
db465c334a Removed debugging info / moved it into verbose mode. 2019-11-07 12:22:49 +01:00
7f0c4f8efe Slight modification in tutorial case. 2019-11-07 08:15:11 +01:00
33895f0cbd Removed more outdated code. 2019-11-07 08:12:33 +01:00
70a6c634d6 Removed obsolete code. 2019-11-07 07:41:44 +01:00
7399f4b929 Particle deformation model. Option to initialize particle temperatures from field values. 2019-10-31 13:50:28 +01:00
993593aa83 Merge branch 'develop' into feature/recurrenceLib
# Conflicts:
#	src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H
#	src/lagrangian/cfdemParticle/subModels/dataExchangeModel/dataExchangeModel/dataExchangeModel.H
#	src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayOne2One/twoWayOne2One.C
2019-10-24 13:18:53 +02:00
9063c7b7d1 Merge pull request #96 from ParticulateFlow/feature/adaptive_resolution_universe
Merge some general mods from feature/adaptive_resolution_universe
2019-10-24 11:58:19 +02:00
31ba2f01fd add -Wno-unused-parameter compilation flag for twoWayMany2Many lib [ci skip]
silence warnings from (older) MPI lib
2019-10-24 10:55:34 +02:00
896f497323 add some comments [ci skip] 2019-10-24 10:51:17 +02:00
4cfce8bc6c Merge branch 'develop' into feature/adaptive_resolution_universe
# Conflicts:
#	src/lagrangian/cfdemParticle/subModels/dataExchangeModel/dataExchangeModel/dataExchangeModel.H
2019-10-23 20:11:49 +02:00
7854673f21 apply minor change of setCellIDs parameter
change originally made in branch feature/recurrenceLib
2019-10-23 19:47:28 +02:00
cab6b7e88f Merge branch 'develop' into feature/adaptive_resolution_universe
# Conflicts:
#	src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayOne2One/twoWayOne2One.C
2019-10-23 18:03:23 +02:00
7de941746f use LIGGGHTS memory namespace instead of memory class
resolve issue #95
2019-10-23 16:36:02 +02:00
fdb2748fbb clean up header file includes
* include only necessary files
* whenever possible, include headers in .C file not in .H file
2019-10-23 12:53:52 +02:00
4a328144ea fix memory issues in twoWayOne2One
fixes made in branch feature/recurrenceLib
2019-10-23 10:20:06 +02:00
96c621416d Merge branch 'develop' into feature/recurrenceLib
# Conflicts:
#	src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C
#	src/lagrangian/cfdemParticle/subModels/energyModel/heatTransferGunn/heatTransferGunn.C
2019-10-22 19:44:00 +02:00
88bc5cbee9 Merge tag '19.02' into feature/recurrenceLib
# Conflicts:
#	applications/solvers/rcfdemSolverRhoSteadyPimple/EEqn.H
#	applications/solvers/rcfdemSolverRhoSteadyPimple/rcfdemSolverRhoSteadyPimple.C
#	doc/CFDEMcoupling_Manual.txt
#	src/lagrangian/cfdemParticle/subModels/dataExchangeModel/dataExchangeModel/dataExchangeModel.H
#	src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayOne2One/twoWayOne2One.H
#	src/lagrangian/cfdemParticle/subModels/energyModel/heatTransferGunn/heatTransferGunn.C
#	src/lagrangian/cfdemParticle/subModels/energyModel/heatTransferGunn/heatTransferGunn.H
#	src/lagrangian/cfdemParticle/subModels/thermCondModel/SyamlalThermCond/SyamlalThermCond.H
#	src/lagrangian/cfdemParticle/subModels/thermCondModel/ZehnerSchluenderThermCond/ZehnerSchluenderThermCond.C
#	src/lagrangian/cfdemParticle/subModels/thermCondModel/ZehnerSchluenderThermCond/ZehnerSchluenderThermCond.H
#	src/lagrangian/cfdemParticle/subModels/thermCondModel/thermCondModel/thermCondModel.H
2019-10-22 17:24:33 +02:00
439f3c602b Some remodeling of fines models. 2019-10-16 16:43:03 +02:00
713677cd3c improve compatibility with newer OpenFOAM versions
use constructor that explicitly sets the list elements to zero, i.e.
List(const label, const zero);
available in OpenFOAM 4 and newer
2019-10-14 10:26:46 +02:00
69ec630051 Feature for calculation of spatial autocorrelation function. 2019-10-10 16:36:18 +02:00
cef2d3afb1 Merge pull request #94 from ParticulateFlow/master
Update from release 19.09
2019-09-27 08:52:54 +02:00
4b86d32807 Added error message if databases contain less than three times. 2019-09-19 10:29:38 +02:00
211a29bb0e Removed outdated force model from list. 2019-09-19 10:29:14 +02:00
ae113af709 Added default boundary condition for force fields. Relevant for smoothing. 2019-09-09 11:47:45 +02:00
4b68e36602 Allow for spatially varying smoothing lengths. 2019-09-09 11:47:07 +02:00
a7f747a4ab Added stickiness to dust model; also some cleaning up. 2019-09-09 11:42:45 +02:00
9fb9e667db Allow to deactivate smoothing of force fields while smoothing voidfraction. 2019-09-09 11:40:27 +02:00
e94964e9bf Extended fines deposition model, fixed tutorial case. 2019-08-22 11:37:41 +02:00
a6be6be3cc adjust tankDrainage case to OpenFOAM 6
caseDicts/postProcessing/surfaceRegion in OpenFOAM 4 was renamed to
caseDicts/postProcessing/surfaceFieldValue OpenFOAM 6;
OpenFOAM 6 requires pcorrFinal to be defined;
2019-05-17 15:24:26 +02:00
cab4fdcb2f adjust fvSolution settings for multiphase solver in OpenFOAM6
OF6 requires pcorrFinal to be specified
2019-05-17 15:00:28 +02:00
d0400cdc74 update sourcing of OpenFOAM bashrc to OF6 2019-05-17 14:24:55 +02:00
302e8df86b Cleaned up Ergun test case for cfdemSolverRhoPimple. 2019-05-02 11:43:19 +02:00
224b7fc00c Merge pull request #87 from ParticulateFlow/feature/openfoam6-chemistrySolvers
Feature/openfoam6 compressible solvers
2019-04-25 11:16:36 +02:00
ce2646c400 Merge pull request #89 from ParticulateFlow/feature/recurrenceLib_fix_predefinedPath
minor fix in predefinedPath model
2019-04-25 11:06:11 +02:00
c878281031 minor fix in predefinedPath model
* change the default file name for the pre-defined recurrencePath

  The previous default 'recurrencePath' is used by the recModel class
  to record the recurrence-path of the simulation at run-time.
  Thus, the previous default value conflicts with the hard-coded file name
  of the recModel class.

  By changing the default, we can use this model with its default file name
2019-04-24 15:16:42 +02:00
2d4fc39eef Added missing files. 2019-04-24 13:25:30 +02:00
f87ad1d116 Make default setting for critical voidfraction such that empty regions can be recognized as such. 2019-04-15 14:34:02 +02:00
a9b8718c3f adapt cfdemSolverRhoPimpleChem for OF-6. 2019-04-10 14:36:06 +02:00
2fa735a2d4 adapt cfdemSolverRhoSimple for OF6. 2019-04-10 14:17:18 +02:00
c40d8e8907 adapt cfdemSolverRhoPimple for OF-6. 2019-04-10 14:11:18 +02:00
69b3c903b3 fix misleading argument type
using a reference indicates that the argument gets modified
which is not the case here
2019-04-09 17:26:17 +02:00
a4ba6750b0 remove friends from cfdemCloud
All my data are belong to me.
2019-04-09 16:12:42 +02:00
96508745fb move methods from dataExchangeModel to cfdemCloud
methods operate directly on data owned by cfdemCloud, thus
cfdemCloud should have the control over it
2019-04-09 15:49:36 +02:00
671d59d634 make cfdemCloud::setNumberOfParticles public
and remove dataExchangeModel::setNumberOfParticles as we don't
gain anything but another function call
2019-04-09 15:14:55 +02:00
0dd61addde remove unused method fluidVel from cfdemCloud 2019-04-09 14:48:53 +02:00
7b91c8f014 Added RanzMarshall heat transfer model. Fixed issue with thermal conductivity models. 2019-04-02 08:51:16 +02:00
471cb3baae Merge branch 'feature/recurrenceLib' of https://github.com/ParticulateFlow/CFDEMcoupling into feature/recurrenceLib 2019-04-02 07:28:12 +02:00
68ab82ce69 Cleaning up code. 2019-04-02 07:27:44 +02:00
c7e58306bb Merge branch 'feature/recurrenceLib' of https://github.com/ParticulateFlow/CFDEMcoupling into feature/recurrenceLib 2019-03-28 15:29:14 +01:00
11e53185e7 Tutorial case for rCFD. Minor bug fixes. Some code cleaning. 2019-03-28 15:28:33 +01:00
1cf1babc8c [OF6] parameters of MULES::limit
MULES and CMULES have been extended so that the limits can be supplied
as fields. These arguments are templated so that zeroField, oneField or
UniformField<scalar> can be used in place of a scalar value with no
additional overhead.
2019-03-27 11:57:44 +01:00
cc4afe5e17 [OF6] class 'Foam::Random' has no member named 'GaussNormal'
'GaussNormal' has been replaced by 'scalarNormal'
2019-03-27 10:55:55 +01:00
74ef6b9207 Merge pull request #65 from ParticulateFlow/feature/recurrenceLibMinorTweaks
Minor tweaks
2019-02-22 09:31:47 +01:00
36d253303d Therm cond models lookup field and modify it instead of returning it on demand. Furthermore, they do not need specific heat values anymore. 2019-01-11 08:47:17 +01:00
8256dd861b Merge branch 'feature/recurrenceLib' of https://github.com/ParticulateFlow/CFDEMcoupling into feature/recurrenceLib 2019-01-07 09:45:30 +01:00
0b57c2400c Heat transfer model to describe inter-grain conduction in terms of volume fraction instead of explicit contacts. 2019-01-07 09:44:36 +01:00
3f2afc838d addSource need not be present anymore. 2019-01-04 13:12:48 +01:00
b2aa11ffaf Add limiters of p and U in steady-state calculation. 2018-11-29 12:17:05 +01:00
87a730fbe1 Some changes of const / non-const etc. 2018-11-21 09:28:43 +01:00
2ace3db6d1 Add solver to solver-list.txt. 2018-11-20 16:47:30 +01:00
570037e8a5 Merge branch 'feature/recurrenceLib' of https://github.com/ParticulateFlow/CFDEMcoupling into feature/recurrenceLib 2018-11-20 14:05:53 +01:00
058648ef25 Solver for recurrent or steady particle motion and steady flow fields. 2018-11-20 14:05:00 +01:00
1e5b8c9302 Merge with develop. 2018-11-13 15:42:56 +01:00
4b8b50b427 Added solver for pseudo-steady conditions. 2018-11-13 15:23:48 +01:00
e8fd37e965 Update tutorial case for coupled heat transfer. 2018-11-12 15:04:53 +01:00
085f288b19 Tutorial case for rCFD case of a fluidized bed with transient conditions. 2018-11-12 11:54:04 +01:00
588c4d12c3 Merge branch 'feature/recurrenceLib' of https://github.com/ParticulateFlow/CFDEMcoupling into feature/recurrenceLib 2018-10-30 15:53:15 +01:00
c37469e415 use absolute margins instead of scaling factors. 2018-10-30 15:44:29 +01:00
bd03f422dc make cell ids members of the twoWayOne2One class. get rid of leak in the process. 2018-10-30 15:43:41 +01:00
7f7c17f788 Merge branch 'feature/recurrenceLib' of https://github.com/ParticulateFlow/CFDEMcoupling into feature/recurrenceLib 2018-10-29 07:24:18 +01:00
658cebfcf2 Compile one2one data exchange model. 2018-10-29 07:24:04 +01:00
b60ffb829a fix memory leak. 2018-10-26 13:00:00 +02:00
b56bf6b838 bugfix for the case that liggghts and openfoam bounding boxes match EXACTLY. 2018-10-26 11:38:35 +02:00
3520f0735e use a reference to cell id list instead of copying it. 2018-10-26 11:37:44 +02:00
7648045bc2 add clocking to one2one 2018-10-22 11:28:45 +02:00
fbd2bde594 Merge with o2o. 2018-10-22 10:30:41 +02:00
0c7396e565 Control communication of fluctuations. 2018-10-15 13:10:18 +02:00
ed242483fc fixed copy&paste error 2018-09-13 11:14:14 +02:00
5579b80401 Minor tweaks
Moved the fields controlling if, and under what name, the recurrence matrix is
written to disk to the parent class recModel to make the behaviour common to all
derived classes.

Fixed some formatting and added some diagnostic output in class gerhardsRecModel
2018-09-13 10:48:47 +02:00
9a3cf6a4c2 Merge branch 'feature/recurrenceLib' of https://github.com/ParticulateFlow/CFDEMcoupling into feature/recurrenceLib 2018-09-07 09:37:25 +02:00
346334d639 Time dilation factor for databases recorded at "high speed". 2018-09-07 09:36:52 +02:00
7fdc466a76 edit read norm to read the whole recurrence matrix 2018-09-06 12:58:57 +02:00
fd71f367d7 rCFD solver for turbulent single-phase transport 2018-09-06 12:54:35 +02:00
67cd1bf561 Relax time step criterion. 2018-09-05 10:52:33 +02:00
bed9647047 Check if databases exist. 2018-08-30 07:41:20 +02:00
780b99389c Allow calculation of distance matrix for selected subdomain. 2018-08-29 14:43:32 +02:00
a1e4182f71 Merge branch 'feature/o2o' of https://github.com/ParticulateFlow/CFDEMcoupling into feature/recurrenceLib 2018-06-21 16:58:39 +02:00
2929a1d2a7 New communication scheme. 2018-06-21 16:58:25 +02:00
32098fb977 Fixed possible problem for MarkovPath by introducing correlation steps. 2018-06-19 09:22:57 +02:00
9b1fb4474e Merge branch 'feature/recurrenceLib' of https://github.com/ParticulateFlow/CFDEMcoupling into feature/recurrenceLib 2018-06-18 13:16:06 +02:00
4ded7ce4ac Merge with feature/o2o. 2018-06-18 13:15:25 +02:00
b759fc05e0 Merge pull request #55 from ParticulateFlow/feature/recurrenceLib_recurrenceTurbulence
Feature/recurrence lib recurrence turbulence
2018-06-12 17:13:55 +02:00
a15986216a Small fixes addressing comments.
* correcting species transport equation
* making check for laminar turbulence compatible with OF-4.0 and OF-5.0
2018-06-05 16:32:33 +02:00
839c66a283 Merge with develop. 2018-06-05 09:57:53 +02:00
f34c00d5dd Fix compilation issue with missing method exportAveragedVolVectorField()
This method has been made abstract in recModel.H
This method is implemented by the class gerhardRecModel

Now, the utility rSmoother compiles without error
2018-05-25 10:22:31 +02:00
fc93012268 Added diffNorm. 2018-05-25 10:08:57 +02:00
40c23ffb42 Added Euclidean norm model, cleaned up recNorms based on differences of fields. 2018-05-24 11:01:27 +02:00
9fabb5851e Merge pull request #57 from ParticulateFlow/feature/recurrenceLib_predefinedPathAndMat
minor refactoring + support for following predefined path
2018-05-24 07:23:28 +02:00
3132d9bf4e * readNorm: refactor recurrence matrix reading into its own recNorm -> less duplication
* predefinedPath: backport ability to follow prescribed recurrence path
2018-05-23 14:21:30 +02:00
ca29eaff3a Corrected reading of bool. 2018-05-23 12:29:55 +02:00
c25aa8ed46 Allow to use precalculated recurrence matrix. 2018-05-23 12:16:31 +02:00
137a4e8670 Recurrence-based turbulence: test case
The test case consists of an initialisation part to build a small
dataBase and a recurrence run.

In the init case the kEpsilon turbulence model is used for the
liquid phase. In the recurrence run the corresponding recurrence-based
kEpsilon model "recurrenceKEpsilon" is used.
2018-05-17 15:47:46 +02:00
82a80e1215 Recurrence-based turbulence: model and test-app
A base class for recurrence-based turbulence models was created. This class
holds a reference to the recurrenceModel in use.
Thus, turbulent fields can be updated from the data base.

The recurrence-based turbulence models are essentially re-implementations
of the respective standard turbulence models. In addition to being derived
from their respective base class, as mandated by OpenFOAM, each recurrence-based
turbulence model is derived from the class recurrenceTurbulenceModel.
This allows for making use of polymorphism on the recurrence-part of the
turbulence model, as after construction, the solver needs to pass the reference
to the recurrenceModel to the recurrence-based turbulence model.
2018-05-17 15:32:30 +02:00
5615b27130 Recurrence-based turbulence: initial commit
extend recModel to return the names of the recurrence-fields
2018-05-17 15:30:01 +02:00
5feb16c659 Merge pull request #53 from ParticulateFlow/feature/recurrenceLib_simplifyRecPath
reduce code duplication in recPath models.
2018-05-17 14:42:17 +02:00
5ad063f848 make getRecPath() virtual following suggestion by @danielque. 2018-05-17 13:53:58 +02:00
917cd345cb reduce code duplication in recPath models. 2018-05-17 12:45:34 +02:00
beadd7fe18 modified rBaseMirror to read fields from dataBase directory 2018-04-25 14:14:54 +02:00
b7bc6cd1b7 Added absolut norm to recurrence norms. 2018-04-20 10:28:54 +02:00
06d589a2f0 Added maximum norm. 2018-04-19 15:06:09 +02:00
7a6df294c6 Avoid string comparison, set bool instead. 2018-04-10 14:56:56 +02:00
e4d3281a27 Some cleaning up. Isotropic fluctuations can take a spatially varying diffusion parameter and ignore cellsets. New model evaluateFluctuations checks if random steps improve state and avoid within-cell mixing. 2018-04-10 13:37:50 +02:00
2b07600de2 modified mapField script for dataBase 2018-04-09 12:50:46 +02:00
9591c2e4e1 use primary tokens for logical operators instead of alternative tokens
don't start mixing tokens within a project
2018-04-06 13:58:56 +02:00
c764c6c184 clean up whitespaces
get rid of tabs and extra spaces, fix indentation
2018-04-06 13:58:45 +02:00
2df36bd22a use c++ style casts 2018-04-06 12:47:05 +02:00
36a1d4a309 IsotropicFluctuations can take two different diffusion coefficients now. 2018-04-04 14:22:40 +02:00
8a1a1375d7 Removed code used for debugging. 2018-04-04 13:46:39 +02:00
401a6b087d ForceSubmodels specifically for recurrence CFD have become obsolet. 2018-04-04 13:23:13 +02:00
1722034452 cfdemCloud now holds convective and fluctuation velocities of particles for use of LIGGGHTS to move tracers. Multiple models to compute these velocities can be used simultanously. 2018-04-04 13:21:43 +02:00
459d87c47a recModel now contains latest time when a jump has been performed. 2018-04-04 13:19:05 +02:00
52aa18997d Refactoring recurrence path models, databases etc. 2018-03-30 10:56:28 +02:00
3b61dcf530 New relaxation models. 2018-03-30 10:55:41 +02:00
d4c393a623 Corrected times when rec field switches. 2018-03-30 10:53:59 +02:00
b056e89969 Density can easily be calculated from T and p. 2018-03-30 10:53:18 +02:00
a9526b7f08 rCFD solver for coupled heat transfer now takes db weights via function objects. 2018-03-30 10:52:33 +02:00
2ac9f5ab14 Merge branch 'feature/recurrenceLib' of https://github.com/ParticulateFlow/CFDEMcoupling into feature/recurrenceLib 2018-03-23 11:06:34 +01:00
b1a81a5fb9 Isotropic fluctuations can be switched off locally. Current implementation for separation with plane. 2018-03-23 11:06:00 +01:00
27bf29ec64 a script for mapFielding the dataBase for another mesh 2018-03-22 16:20:01 +01:00
83609e3073 Isotropic fluctuations can now print out the current recurrence error if desired. 2018-03-21 15:43:24 +01:00
665ff426b5 Merge branch 'develop' of https://github.com/ParticulateFlow/CFDEMcoupling into feature/recurrenceLib 2018-03-20 13:24:02 +01:00
7fc3caf245 Basics of new rCFD solver for varying conditions. 2018-03-20 13:23:26 +01:00
b9d843a11f Set boundary field type of particle temperature field etc. explicitly to zeroGradient. 2018-03-19 14:06:53 +01:00
327c64933d heatTransferModels can now export current mean particle temperature. 2018-03-14 07:30:10 +01:00
77a7d78282 Yet another bugfix. Interval sizes need to be defined before they are used... 2018-03-13 16:24:46 +01:00
237e85a191 Fixed error with wrong dimension sets. 2018-03-13 16:02:20 +01:00
e3a521ced4 New path model MarkovPath is going to replace multiIntervalPath. Allows for multiple databases, extension of path and adaption of weights during runtime. 2018-03-13 11:12:22 +01:00
22fd652019 Clean-up of treatment of time-averaged fields per database. 2018-03-13 08:20:45 +01:00
0211f3cc74 Option to store time-averaged fields for each database. 2018-03-12 18:00:26 +01:00
27b67395f9 Cleaned up code of multiIntervalPath. Intervals need now to be given in separated databases. 2018-03-12 17:19:08 +01:00
c311c4000c Allow for multiple databases. 2018-03-12 16:57:43 +01:00
528750b8b5 Merge with model for large, incomplete databases. 2018-03-09 07:28:53 +01:00
48c2ac22c0 recurrence model: testing large, incomplete data bases
This is a small, simple tutorial for testing the implementation of
large, incomplete data bases.
In this tutorial case, rStatAnalysis is used as post-processor and
it uses a data base in memory, which is smaller than the number of
snapshots on disk.
2018-03-08 16:49:34 +11:00
4403f4e191 recurrence model: large, incomplete data bases
The standardRecModel class reads all fields of the data base at once. This
might create a problem in cases with a large number of snapshots and/or
a large mesh, as the machine's memory (RAM) would become a bottleneck.

Thus, the class gerhardsRecModel implements an incomplete data base, with
a user-defined number of slots M. In cases with a larger number of
snapshots on disk N, with N > M, the class will manage its data base
in a fashion similar to an operating system managing memory pages.

The class gerhardsRecModel implements a least-recently used (LRU)
algorithm, which vacates the least-used of the dataBase's M slots.
An integer list is used to track the slots' usage, each access to a
slot is logged, thus the least-used slot can be easily determined.

In order to fully utilize the LRU algorithm, the computation of the
recurrence matrix in sqrDiffNorm.C had to modified such, that three
nested for-loops are used, instead of two nested loops. Thus, a certain
number of additional, essentially no-op, loop iterations are expended
in order to accomodate the LRU algorithm. Keeping the two nested loops
would have reaped only part of LRU's potential gains.

In order to accomodate data base management in the classes derived
from the class recModel, some const specifiers had to be removed.
For informational purposes, a method has been added to the class.

The class gerhardsRecModel first checks the existence of all N
to-be-read fields, and then fills the data base with the first M
fields.

Further features included in this commit:

All elements of the recurrence model are initialized with the value of -1.0
Thus, some form of error checking is introduced, as negative values should not
remain within the matrix after computation has finished.

Skipping the 0 directory of the data base. This, might be useful when
using rStatAnalysis as post-processing tool.

The class multiIntervalPath was adapted to use OpenFOAM's
methods for parallel communication.

Reference:

  Modern Operating Systems
  Andrew S. Tannenbaum,
  Prentice Hall, 1992
2018-03-08 16:31:01 +11:00
35a37d5a7b Merge branch 'feature/recurrenceLib' of https://github.com/ParticulateFlow/CFDEMcoupling into feature/recurrenceLib 2018-03-05 10:09:55 +01:00
a00c423da2 replace direct calls to MPI routines by calls to OpenFOAM routines 2018-02-28 14:39:05 +11:00
e29e3732bc edited recSteps calculation
recSteps was calculated twice in the computeRecPath().
2018-02-27 16:01:44 +01:00
ca81a8f14f Merge pull request #47 from ParticulateFlow/feature/recurrenceDemo
recurrence tutorial: laminar vortex shedding
2018-02-26 08:59:36 +01:00
9fd4f62f21 recurrence tutorial: laminar vortex shedding
This 2D case of vortex shedding in laminar cross-flow demonstrates the
concept of recurrence.

This is a bit work-in-progress: please check whether this tutorial runs with
the recurrence model and tools of CFDEMcoupling, namely rStatAnalysis.

The simulation roughly goes through three stages:
  * The initial solution computed by potentialFoam
  * A period of symmetric, steady-state flow
  * Finally, periodic vortex shedding

These three stages are clearly visible in the recurrence plot.

  * We see how not one of the later velocity fields is similar to the initial one
  * We see the intermediate stage with a symmetric flow field
  * We see the periodic vortex shedding
2018-02-26 17:44:16 +11:00
708e4c465c fix output message 2018-02-22 12:14:09 +11:00
d2edf97b05 standardRecModel: skip zero time
Add an optional boolean switch to standardRecModel class to allow
ignoring the 0 directory when building the recurrence data base.

This is useful when using rStatAnalysis as a post-processing tool
on a case where OpenFOAM's purgeWrite feature was used.
If purgeWrite is set to 0, then all time steps will be written to disk.
If purgeWrite is set to N, then only the last N time steps will be stored.
As a new time step is written to disk, the oldest one will be discarded.
However, the 0 directory is excluded from removal.

If purgeWrite is set to 5, and we run a simulation with deltaT=1 und endTime=10,
then the time steps on disk will be: 0, 6, 7, 8, 9, 10.
Running rStatAnalysis on this case, will end in fatal error, as the time step
within the data base will be found to be non-uniform.

The quick and dirty fix, would be to remove or rename the 0 directory, so that
it does not get read. However, telling the recurrence model whether to include
0 or not seems the more elegant solution.
2018-02-22 11:57:54 +11:00
84f54340f6 New recurrence path model for database from multiple, independent intervals (e.g. obtained from symmetrizing operations). 2018-02-08 09:44:41 +01:00
4a3db017f4 Test case for tracers on stationary field. 2018-02-01 07:49:06 +01:00
033c30ba27 Update function arguments. 2018-01-31 14:39:13 +01:00
fe68694a26 Allow for single-snapshot database. 2018-01-31 14:36:40 +01:00
305b047377 Merge pull request #44 from ParticulateFlow/feature/recurrenceLib_rStat
Feature/recurrence lib r stat
2018-01-17 13:09:44 +01:00
1fea5461c9 Demo case for using rStatAnalysis as post-processing tool.
This case is a simple bubble column, which is run by reactingTwoPhaseEulerFoam.
Upon completion, rStatAnalysis can be run to compute the recurrence statistics
of the bubble column.

This demo case must be run in parallel, as rStatAnalysis apparently does not run
as a single, serial process.
2018-01-16 10:41:52 +11:00
334e2f224e Allow for optional, alternative name/path of the dataBase
This changes nothing from the previous behaviour, however, this allows
to use rStatAnalysis as a post-processing tool. A demo case will follow
to demonstrate this.

By default, the data base is located in $CASE_DICT/dataBase. By specifying
the case dict as the path to the data base, rStatAnalysis can now act on
the case's actual time steps, thus post-processing data computed by another
solver.
2018-01-16 10:30:10 +11:00
c8176256cf Added new utilities to list. 2017-12-20 09:23:40 +01:00
cc4c9a9071 Changed way average field is calculated. 2017-12-20 09:18:46 +01:00
199924cee7 Class noPath to skip calculation of recurrence path. 2017-12-20 07:36:08 +01:00
d9411b56bb Minor bugs fixed. 2017-12-19 16:27:30 +01:00
54f04e6604 Some debugging for rSmoother. 2017-12-18 15:31:32 +01:00
bf2940df57 Moved some member from mother to child class of recModel. 2017-12-18 13:10:41 +01:00
c9a6908aec Utility to perform averaging over similar fields. 2017-12-18 12:25:46 +01:00
589f193b11 Utility to add mirrored fields to time series. 2017-12-18 12:25:07 +01:00
63fdfd9026 Tutorial case for rCFD simulation of heat transfer in a fluidized bed. 2017-12-18 11:42:21 +01:00
056f7e6b56 Started to add functionality to superpose similar fields. 2017-12-07 19:41:50 +01:00
6a7acd7d08 Tutorial case bubbleColumn for rCFD model A. 2017-11-13 07:43:51 +01:00
de33b56c91 Renamed fields in solver. 2017-11-08 17:03:06 +01:00
9cf0e275b7 Add void averaging model. 2017-11-08 17:01:35 +01:00
5730ea3822 Added fvOptions for rCFD solvers. 2017-11-08 15:05:57 +01:00
b9bb7fd8f8 Tutorial case to create a recurrence matrix. 2017-11-08 10:37:46 +01:00
f31cb89065 Fixed merge conflict. 2017-09-08 12:25:32 +02:00
8c2726bc99 Updates from current master branch. 2017-09-08 10:32:20 +02:00
13987f0ba3 Basics for statistical analysis of recurrence matrix. 2017-06-22 09:13:48 +02:00
41788a1c95 Output recurrence jump vector. 2017-05-17 12:40:34 +02:00
a5a76110f7 Merge pull request #13 from ParticulateFlow/feature/recurrenceLibFixWarnings
fixed header
2017-03-06 16:29:47 +01:00
d7343605ce fixing more sloppy errors of myself 2017-03-06 16:24:28 +01:00
7ac6ee3937 fixed header 2017-03-06 16:18:33 +01:00
1536a6da54 Merge pull request #12 from ParticulateFlow/feature/recurrenceLibFixWarnings
Feature/recurrence lib fix warnings
2017-03-06 16:15:54 +01:00
a725249334 fix warning : control reaches end of non-void function [-Wreturn-type] 2017-03-06 16:08:54 +01:00
9c12f6acb0 ignore build folders lnInclude and linux64Gcc* 2017-03-06 16:08:05 +01:00
a83140ee71 Recurrence statistics analysis and some minor changes. 2017-01-17 10:34:54 +01:00
9867e0188c Added comment. 2016-12-13 10:39:45 +01:00
56f8aad5a6 Some cleaning up. Appropriate handling of Cv and Cp. 2016-11-29 15:41:37 +01:00
c44e375473 Automatically determine fraction of DEM and CFD timesteps. Read coupling substep from recProperties file. 2016-11-22 11:32:46 +01:00
f84180b2c5 Improved particle temperature averaging. 2016-11-16 15:42:35 +01:00
c18e671956 Get time measurements right. 2016-10-31 11:22:43 +01:00
0d0803e057 Implicit heat transfer. 2016-10-27 16:41:13 +02:00
bfe3836dc4 Merge branch 'feature/recurrenceLib' of https://github.com/ParticulateFlow/CFDEMcoupling into feature/recurrenceLib 2016-10-27 16:39:35 +02:00
c3388c5238 Various changes. 2016-10-27 16:39:01 +02:00
e268853de8 Fixing minor errors. 2016-09-26 13:28:31 +02:00
a3f903e02f Allow monitoring of Re and Nu. 2016-09-26 13:27:47 +02:00
9b28453113 read verbosity flag from recProperties
The classes recNorm and recModel also read the verbose flag from the
dictionary recProperties, as recModel has been doing. Up to now, the
boolean verbose_ of recNorm and recPath was initialized to "false" in the
initialisation list of the constructor. This made all if(verbose_)
tests in child classes of recNorm and recPath useless.
2016-09-20 10:14:34 +02:00
fc0a6e64e3 Just one blank space. 2016-09-15 17:44:34 +02:00
fb311ae59b Temperature equation added. 2016-09-15 17:43:21 +02:00
05c1ed01e6 Export specific heat. 2016-09-15 17:42:35 +02:00
b6b2e7d1f4 Different treatment for velocity fluctuations. 2016-09-15 15:40:34 +02:00
ad3e9641e5 Fluxes. 2016-09-15 15:40:01 +02:00
dc734e39d0 Recurrence CFD with OF4.x, added solver for heat transfer. 2016-09-14 15:55:17 +02:00
9ffdc33ce5 Merge with OF4x; added some heat transfer related models. 2016-09-13 15:16:34 +02:00
fb99b20e8b Updating recLib. 2016-09-13 14:11:22 +02:00
865c52834f Some restructuring. 2016-08-01 14:43:07 +02:00
3ff2ae9daa Some renaming and restructuring. 2016-08-01 07:14:45 +02:00
561f7fa865 Some cleaning up. 2016-07-22 08:08:50 +02:00
907054872b Cleaning up. 2016-07-21 15:28:05 +02:00
1fe6ce4788 Move recurrence stuff to own class. 2016-06-15 14:43:01 +02:00
af47724556 Move recurrence stuff out of cloud, create own structure for it. 2016-06-10 07:52:31 +02:00
3517e71e6d Refactoring of rCFD framework. 2016-06-09 20:48:27 +02:00
09726b8582 Recurrence CFD going to new format. 2016-04-15 11:17:01 +02:00
5d31a644c5 Timing. 2016-01-20 16:04:47 +01:00
1e3062c8b7 Some cleaning up of the fluctuation model. 2016-01-08 10:03:38 +01:00
06dfa5430a Changed fluctuation model. 2015-12-18 10:56:32 +01:00
d454396dd0 Minor changes. 2015-11-11 12:23:58 +01:00
e0b1837476 Recurrence solver based on model A. 2015-11-10 08:46:58 +01:00
41670f2446 Allow for empty averaging and voidfraction models. 2015-11-10 08:44:53 +01:00
30a216a934 Tracer model about to be removed. 2015-11-06 11:47:36 +01:00
8fc8c1991c Minor changes. 2015-11-05 17:04:07 +01:00
6a0928b188 Read or calculate fluxes. 2015-11-04 20:32:53 +01:00
0515ecd2d2 Handling tracer particles in recurrence CFDEM. 2015-11-04 11:59:51 +01:00
9b134cb9db Minor adaptions. 2015-11-04 11:58:53 +01:00
2abbdf1f51 New fluctuation model. 2015-10-29 18:40:26 +01:00
810217b4ad More options for fluctuations. 2015-10-25 11:45:17 +01:00
6124f12d15 Allow for velocity fluctuations. 2015-10-24 18:58:41 +02:00
061758b1e6 Messing around. 2015-10-23 12:13:56 +02:00
963f00d2c4 Might need smoothing for gradient force. 2015-10-23 11:27:43 +02:00
87f91613d7 Minor adaptions. 2015-10-22 15:36:14 +02:00
839e00a00e Added force model depending on error in voidfraction. 2015-10-20 15:35:24 +02:00
434ffad1e9 Switched from auto pointers to pointers to be returend from class standardRecModel. 2015-10-20 12:20:02 +02:00
f058371f65 Added forceModelRec gradConcentration. Will take care to adjust particle number density. 2015-10-16 11:16:35 +02:00
6d6ebf1629 Fixed velocity transfer from OF to LIGGGHTS. 2015-10-16 10:18:17 +02:00
4e60f9c9a8 Recurrence fields accesible via autoPtr now. 2015-10-15 16:28:45 +02:00
8deb1b7b9c Avoid overwriting of velocities. 2015-10-14 08:25:00 +02:00
fed7e6422c Changed local variable to member of class. 2015-10-14 08:18:20 +02:00
09d55794a5 Fixed bug in broadcasting array. Some processors had reserved too little space. 2015-10-13 14:53:34 +02:00
c38449cacd Runs. Sometimes. 2015-10-13 12:55:43 +02:00
b55ba48801 Still crashes on execution. 2015-10-12 15:43:58 +02:00
4aa3d944d5 Restored old version. 2015-10-12 14:43:51 +02:00
c07508f147 Changed path to start compilation in the correct directory. 2015-10-12 13:55:45 +02:00
68f158a3ae Changed how initial fields are provided. 2015-10-09 14:13:22 +02:00
859c26f4bb Compiles now. Crashes on execution. 2015-10-09 12:22:05 +02:00
0b5d507281 Minor changes. 2015-10-08 17:59:27 +02:00
2e93d70940 Might compile now. 2015-10-08 16:12:00 +02:00
433ce8e7fe Source files compile. Solver does not. 2015-10-08 14:12:56 +02:00
63f4497727 New class for recurrence forces. 2015-10-07 18:23:34 +02:00
4282dcf080 More rearranging. 2015-10-06 16:55:13 +02:00
6bb64cd937 Hardly anything new. 2015-10-04 18:21:12 +02:00
c97f483f64 Shoving pieces of code back and forth. 2015-10-02 11:28:58 +02:00
1307dd7153 Some restructuring. 2015-10-01 22:08:16 +02:00
1ebaea53a1 Minor changes, far from being useful. 2015-09-30 19:36:09 +02:00
de96a638a3 Some files for new recurrenceCFD solver. Far from working. 2015-09-30 00:12:15 +02:00
869 changed files with 3057303 additions and 39599 deletions

View File

@ -21,18 +21,18 @@ jobs:
- run:
name: Make project and user dir
command: mkdir -p /root/CFDEM/CFDEMcoupling && mkdir -p /root/CFDEM/-4.1
command: mkdir -p /root/CFDEM/CFDEMcoupling && mkdir -p /root/CFDEM/-6
- checkout:
path: /root/CFDEM/CFDEMcoupling
- run:
name: Add OpenFOAM package repository
command: sudo apt-get install -y software-properties-common wget apt-transport-https && sudo add-apt-repository http://dl.openfoam.org/ubuntu && sudo sh -c "wget -O - http://dl.openfoam.org/gpg.key | apt-key add -"
command: sudo apt-get install -y software-properties-common wget apt-transport-https && sudo sh -c "wget -O - http://dl.openfoam.org/gpg.key | apt-key add -" && sudo add-apt-repository http://dl.openfoam.org/ubuntu
- run:
name: Install OpenFOAM 4.1
command: sudo apt-get update && sudo apt-get -y install openfoam4
name: Install OpenFOAM 6
command: sudo apt-get update && sudo apt-get -y install openfoam6
- run:
name: Clone LIGGGHTS repository
@ -42,7 +42,7 @@ jobs:
name: Build LIGGGHTS
command: >
shopt -s expand_aliases &&
source /opt/openfoam4/etc/bashrc &&
source /opt/openfoam6/etc/bashrc &&
source /root/CFDEM/CFDEMcoupling/etc/bashrc &&
bash /root/CFDEM/CFDEMcoupling/etc/compileLIGGGHTS.sh
no_output_timeout: 30m
@ -51,7 +51,7 @@ jobs:
name: Build CFDEMcoupling library
command: >
shopt -s expand_aliases &&
source /opt/openfoam4/etc/bashrc &&
source /opt/openfoam6/etc/bashrc &&
source /root/CFDEM/CFDEMcoupling/etc/bashrc &&
bash /root/CFDEM/CFDEMcoupling/etc/compileCFDEMcoupling_src.sh
@ -59,7 +59,7 @@ jobs:
name: Build CFDEMcoupling solvers
command: >
shopt -s expand_aliases &&
source /opt/openfoam4/etc/bashrc &&
source /opt/openfoam6/etc/bashrc &&
source /root/CFDEM/CFDEMcoupling/etc/bashrc &&
bash /root/CFDEM/CFDEMcoupling/etc/compileCFDEMcoupling_sol.sh
@ -67,6 +67,6 @@ jobs:
name: Build CFDEMcoupling utilities
command: >
shopt -s expand_aliases &&
source /opt/openfoam4/etc/bashrc &&
source /opt/openfoam6/etc/bashrc &&
source /root/CFDEM/CFDEMcoupling/etc/bashrc &&
bash /root/CFDEM/CFDEMcoupling/etc/compileCFDEMcoupling_uti.sh

View File

@ -14,7 +14,8 @@ EXE_INC = \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/dynamicMesh/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/dynamicMesh/dynamicMesh/lnInclude \
-I$(LIB_SRC)/fvOptions/lnInclude
-I$(LIB_SRC)/fvOptions/lnInclude \
-Wno-deprecated-copy
EXE_LIBS = \
-L$(CFDEM_LIB_DIR)\

View File

@ -1,6 +1,10 @@
FOAM_VERSION_MAJOR := $(word 1,$(subst ., ,$(WM_PROJECT_VERSION)))
PFLAGS+= -DOPENFOAM_VERSION_MAJOR=$(FOAM_VERSION_MAJOR)
include $(CFDEM_ADD_LIBS_DIR)/additionalLibs
EXE_INC = \
$(PFLAGS) \
-I$(CFDEM_OFVERSION_DIR) \
-ImultiphaseMixture/lnInclude \
-I$(LIB_SRC)/transportModels \
@ -13,6 +17,7 @@ EXE_INC = \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/lnInclude \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/cfdTools \
-Wno-deprecated-copy
EXE_LIBS = \
-L$(CFDEM_LIB_DIR)\

View File

@ -46,6 +46,11 @@ Description
int main(int argc, char *argv[])
{
#if OPENFOAM_VERSION_MAJOR >= 6
FatalError << "cfdemSolverMultiphase requires OpenFOAM 4.x or 5.x to work properly" << exit(FatalError);
#endif
#include "postProcess.H"
#include "setRootCase.H"
#include "createTime.H"

View File

@ -1,10 +1,15 @@
FOAM_VERSION_MAJOR := $(word 1,$(subst ., ,$(WM_PROJECT_VERSION)))
PFLAGS+= -DOPENFOAM_VERSION_MAJOR=$(FOAM_VERSION_MAJOR)
EXE_INC = \
$(PFLAGS) \
-IalphaContactAngle \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
-I$(LIB_SRC)/meshTools/lnInclude \
-Wno-deprecated-copy
LIB_LIBS = \
-linterfaceProperties \

View File

@ -679,8 +679,13 @@ void Foam::multiphaseMixture::solveAlphas
alphaPhiCorr,
zeroField(),
zeroField(),
#if OPENFOAM_VERSION_MAJOR < 6
1,
0,
#else
oneField(),
zeroField(),
#endif
true
);

View File

@ -10,6 +10,7 @@ EXE_INC = \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/lnInclude \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/cfdTools \
-Wno-deprecated-copy
EXE_LIBS = \
-L$(CFDEM_LIB_DIR)\

View File

@ -11,6 +11,7 @@ EXE_INC = \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/cfdTools \
-Wno-deprecated-copy
EXE_LIBS = \
-L$(CFDEM_LIB_DIR)\

View File

@ -11,6 +11,7 @@ EXE_INC = \
-I../cfdemSolverPiso \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/lnInclude \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/cfdTools \
-Wno-deprecated-copy
EXE_LIBS = \
-L$(CFDEM_LIB_DIR)\

View File

@ -6,9 +6,6 @@
particleCloud.energyContributions(Qsource);
particleCloud.energyCoefficients(QCoeff);
//thDiff=particleCloud.thermCondM().thermDiff();
thCond=particleCloud.thermCondM().thermCond();
addSource = fvc::ddt(rhoeps, K) + fvc::div(phi, K)
+ (
he.name() == "e"
@ -35,7 +32,6 @@
- Qsource
- fvm::Sp(QCoeff/Cpv, he)
// thermal conduction of the fluid with effective conductivity
// - fvm::laplacian(rhoeps*thDiff,he)
- fvm::laplacian(voidfraction*thCond/Cpv,he)
// + particle-fluid energy transfer due to work
// + fluid energy dissipation due to shearing
@ -54,9 +50,6 @@
thermo.correct();
Info << "Qsource" << max(Qsource).value() << " " << min(Qsource).value() << endl;
Info << "QCoeff" << max(QCoeff).value() << " " << min(QCoeff).value() << endl;
Info << "Cpv" << max(Cpv).value() << " " << min(Cpv).value() << endl;
Info<< "T max/min : " << max(T).value() << " " << min(T).value() << endl;
particleCloud.clockM().start(31,"energySolve");

View File

@ -1,5 +1,7 @@
include $(CFDEM_ADD_LIBS_DIR)/additionalLibs
FOAM_VERSION_MAJOR := $(word 1,$(subst ., ,$(WM_PROJECT_VERSION)))
PFLAGS+= -DOPENFOAM_VERSION_MAJOR=$(FOAM_VERSION_MAJOR)
PFLAGS+= -Dcompre
EXE_INC = \
@ -15,6 +17,7 @@ EXE_INC = \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/lnInclude \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/cfdTools \
-Wno-deprecated-copy
EXE_LIBS = \
-L$(CFDEM_LIB_DIR)\

View File

@ -92,7 +92,7 @@ int main(int argc, char *argv[])
particleCloud.clockM().start(2,"Coupling");
bool hasEvolved = particleCloud.evolve(voidfraction,Us,U);
if(hasEvolved)
if(hasEvolved && smoothenForces)
{
particleCloud.smoothingM().smoothen(particleCloud.forceM(0).impParticleForces());
}
@ -113,7 +113,11 @@ int main(int argc, char *argv[])
particleCloud.clockM().start(26,"Flow");
#if OPENFOAM_VERSION_MAJOR < 6
if (pimple.nCorrPIMPLE() <= 1)
#else
if (pimple.nCorrPimple() <= 1)
#endif
{
#include "rhoEqn.H"
}

View File

@ -58,10 +58,11 @@ Info<< "Reading thermophysical properties\n" << endl;
"addSource",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh
mesh,
dimensionedScalar("zero", dimensionSet(1,-1,-3,0,0,0,0), 0.0)
);
Info<< "\nCreating fluid-particle heat flux field\n" << endl;
@ -94,21 +95,6 @@ Info<< "Reading thermophysical properties\n" << endl;
dimensionedScalar("zero", dimensionSet(1,-1,-3,-1,0,0,0), 0.0)
);
/* Info<< "\nCreating thermal diffusivity field\n" << endl;
volScalarField thDiff
(
IOobject
(
"thDiff",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("zero", dimensionSet(0,2,-1,0,0,0,0), 0.0)
);
*/
Info<< "\nCreating thermal conductivity field\n" << endl;
volScalarField thCond
(
@ -117,11 +103,12 @@ Info<< "Reading thermophysical properties\n" << endl;
"thCond",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("zero", dimensionSet(1,1,-3,-1,0,0,0), 0.0)
dimensionedScalar("zero", dimensionSet(1,1,-3,-1,0,0,0), 0.0),
"zeroGradient"
);
Info<< "\nCreating heat capacity field\n" << endl;
@ -190,6 +177,17 @@ Info<< "Reading thermophysical properties\n" << endl;
)
);
bool smoothenForces
(
pimple.dict().lookupOrDefault<bool>
(
"smoothenForces",
false
)
);
if (smoothenForces) Info << "Smoothening implicit particle forces.\n" << endl;
else Info << "Not smoothening implicit particle forces.\n" << endl;
Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::turbulenceModel> turbulence
(

View File

@ -6,7 +6,6 @@ volScalarField& he = thermo.he();
particleCloud.energyContributions(Qsource);
particleCloud.energyCoefficients(QCoeff);
thCond=particleCloud.thermCondM().thermCond();
Cpv = he.name() == "e" ? thermo.Cv() : thermo.Cp();
// correct source for the thermodynamic reference temperature

View File

@ -1,5 +1,7 @@
include $(CFDEM_ADD_LIBS_DIR)/additionalLibs
FOAM_VERSION_MAJOR := $(word 1,$(subst ., ,$(WM_PROJECT_VERSION)))
PFLAGS+= -DOPENFOAM_VERSION_MAJOR=$(FOAM_VERSION_MAJOR)
PFLAGS+= -Dcompre
EXE_INC = \
@ -19,19 +21,14 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
-I$(LIB_SRC)/ODE/lnInclude \
-I$(LIB_SRC)/combustionModels/lnInclude \
-I$(FOAM_SOLVERS)/combustion/reactingFoam \
-Wno-deprecated-copy
EXE_LIBS = \
@ -48,9 +45,6 @@ EXE_LIBS = \
-l$(CFDEM_LIB_COMP_NAME) \
$(CFDEM_ADD_LIB_PATHS) \
$(CFDEM_ADD_LIBS) \
-lliquidProperties \
-lliquidMixtureProperties \
-lthermophysicalFunctions \
-lreactionThermophysicalModels \
-lchemistryModel \
-lradiationModels \

View File

@ -13,7 +13,11 @@ tmp<fv::convectionScheme<scalar> > mvConvection
{
combustion->correct();
#if OPENFOAM_VERSION_MAJOR < 5
dQ = combustion->dQ();
#else
Qdot = combustion->Qdot();
#endif
label inertIndex = -1;
volScalarField Yt(0.0*Y[0]);
@ -72,4 +76,5 @@ tmp<fv::convectionScheme<scalar> > mvConvection
Y[inertIndex].max(0.0);
}
}
particleCloud.clockM().stop("Y");

View File

@ -30,7 +30,12 @@ Description
#include "fvCFD.H"
#include "turbulentFluidThermoModel.H"
#if OPENFOAM_VERSION_MAJOR < 6
#include "rhoCombustionModel.H"
#else
#include "rhoReactionThermo.H"
#include "CombustionModel.H"
#endif
#include "bound.H"
#include "pimpleControl.H"
#include "fvOptions.H"
@ -115,7 +120,11 @@ int main(int argc, char *argv[])
particleCloud.clockM().start(26,"Flow");
#if OPENFOAM_VERSION_MAJOR < 6
if (pimple.nCorrPIMPLE() <= 1)
#else
if (pimple.nCorrPimple() <= 1)
#endif
{
#include "rhoEqn.H"
}

View File

@ -1,20 +1,28 @@
// thermodynamics, chemistry
#if OPENFOAM_VERSION_MAJOR < 6
Info<< "Creating combustion model\n" << endl;
autoPtr<combustionModels::rhoCombustionModel> combustion
(
combustionModels::rhoCombustionModel::New(mesh)
);
rhoReactionThermo& thermo = combustion->thermo();
#else
Info<< "Reading thermophysical properties\n" << endl;
autoPtr<rhoReactionThermo> pThermo(rhoReactionThermo::New(mesh));
rhoReactionThermo& thermo = pThermo();
#endif
thermo.validate(args.executable(), "h", "e");
basicSpecieMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y();
// read molecular weight
#if OPENFOAM_VERSION_MAJOR < 6
volScalarField W(composition.W());
#else
volScalarField W(thermo.W());
#endif
bool propagateInertSpecie = true;
@ -127,11 +135,12 @@
"thCond",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("zero", dimensionSet(1,1,-3,-1,0,0,0), 0.0)
dimensionedScalar("zero", dimensionSet(1,1,-3,-1,0,0,0), 0.0),
"zeroGradient"
);
Info<< "\nCreating heat capacity field\n" << endl;
@ -197,6 +206,14 @@
)
);
#if OPENFOAM_VERSION_MAJOR >= 6
Info<< "Creating combustion model\n" << endl;
autoPtr<CombustionModel<rhoReactionThermo>> combustion
(
CombustionModel<rhoReactionThermo>::New(thermo, turbulence())
);
#endif
Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt
(
@ -213,6 +230,7 @@
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));
#if OPENFOAM_VERSION_MAJOR < 5
volScalarField dQ
(
IOobject
@ -226,6 +244,21 @@
mesh,
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
);
#else
volScalarField Qdot
(
IOobject
(
"Qdot",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("Qdot", dimEnergy/dimVolume/dimTime, 0.0)
);
#endif
Info<< "\nReading momentum exchange field Ksl\n" << endl;
volScalarField Ksl

View File

@ -1,3 +0,0 @@
cfdemSolverRhoSimple.C
EXE=$(CFDEM_APP_DIR)/cfdemSolverRhoSimple

View File

@ -0,0 +1,3 @@
rStatAnalysis.C
EXE=$(CFDEM_APP_DIR)/rStatAnalysis

View File

@ -0,0 +1,27 @@
include $(CFDEM_ADD_LIBS_DIR)/additionalLibs
EXE_INC = \
-I$(CFDEM_OFVERSION_DIR) \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/lnInclude \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/cfdTools \
-I$(CFDEM_SRC_DIR)/recurrence/lnInclude \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/derived/cfdemCloudRec \
-Wno-deprecated-copy
EXE_LIBS = \
-L$(CFDEM_LIB_DIR)\
-lrecurrence \
-lturbulenceModels \
-lincompressibleTurbulenceModels \
-lincompressibleTransportModels \
-lfiniteVolume \
-lmeshTools \
-l$(CFDEM_LIB_NAME) \
$(CFDEM_ADD_LIB_PATHS) \
$(CFDEM_ADD_LIBS)

View File

@ -0,0 +1,62 @@
/*---------------------------------------------------------------------------*\
CFDEMcoupling academic - Open Source CFD-DEM coupling
Contributing authors:
Thomas Lichtenegger
Copyright (C) 2015- Johannes Kepler University, Linz
-------------------------------------------------------------------------------
License
This file is part of CFDEMcoupling academic.
CFDEMcoupling academic is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
CFDEMcoupling academic is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with CFDEMcoupling academic. If not, see <http://www.gnu.org/licenses/>.
Application
rStatAnalysis
Description
Creates and analyzes a recurrence statistics
\*---------------------------------------------------------------------------*/
#include "recBase.H"
#include "recStatAnalysis.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
#include "postProcess.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createControl.H"
recBase recurrenceBase(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info << "\nAnalyzing recurrence statistics\n" << endl;
recurrenceBase.recStatA().init();
recurrenceBase.recStatA().statistics();
Info << "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,3 @@
rcfdemSolverBase.C
EXE=$(CFDEM_APP_DIR)/rcfdemSolverBase

View File

@ -0,0 +1,28 @@
include $(CFDEM_ADD_LIBS_DIR)/additionalLibs
EXE_INC = \
-I$(CFDEM_OFVERSION_DIR) \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/lnInclude \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/cfdTools \
-I$(CFDEM_SRC_DIR)/recurrence/lnInclude \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/derived/cfdemCloudRec \
-Wno-deprecated-copy
EXE_LIBS = \
-L$(CFDEM_LIB_DIR)\
-lrecurrence \
-lturbulenceModels \
-lincompressibleTurbulenceModels \
-lincompressibleTransportModels \
-lfiniteVolume \
-lmeshTools \
-lfvOptions \
-l$(CFDEM_LIB_NAME) \
$(CFDEM_ADD_LIB_PATHS) \
$(CFDEM_ADD_LIBS)

View File

@ -0,0 +1,125 @@
// dummy fields
Info << "\nCreating dummy pressure and density fields\n" << endl;
volScalarField p
(
IOobject
(
"p",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar("p", dimensionSet(1, 2, -2, 0, 0), 1.0)
);
volScalarField rho
(
IOobject
(
"rho",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar("rho", dimensionSet(1, -3, 0, 0, 0), 1.0)
);
// recurrence fields
Info << "\nCreating recurrence fields.\n" << endl;
volVectorField URec
(
IOobject
(
"URec",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
volScalarField voidfractionRec
(
IOobject
(
"voidfractionRec",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
volVectorField UsRec
(
IOobject
(
"UsRec",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
// calculated fields
Info << "\nCreating fields subject to calculation\n" << endl;
volScalarField voidfraction
(
IOobject
(
"voidfraction",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
voidfractionRec
);
volVectorField Us
(
IOobject
(
"Us",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
UsRec
);
// write fields for t=t_start
voidfraction.write();
Us.write();
//===============================
Info << "Calculating face flux field phi\n" << endl;
surfaceScalarField phiRec
(
IOobject
(
"phiRec",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
linearInterpolate(URec*voidfractionRec) & mesh.Sf()
);
phiRec.write();
singlePhaseTransportModel laminarTransport(URec, phiRec);
autoPtr<incompressible::turbulenceModel> turbulence
(
incompressible::turbulenceModel::New(URec, phiRec, laminarTransport)
);

View File

@ -0,0 +1,114 @@
/*---------------------------------------------------------------------------*\
CFDEMcoupling academic - Open Source CFD-DEM coupling
Contributing authors:
Thomas Lichtenegger, Gerhard Holzinger
Copyright (C) 2015- Johannes Kepler University, Linz
-------------------------------------------------------------------------------
License
This file is part of CFDEMcoupling academic.
CFDEMcoupling academic is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
CFDEMcoupling academic is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with CFDEMcoupling academic. If not, see <http://www.gnu.org/licenses/>.
Application
cfdemSolverRecurrence
Description
Solves a transport equation for a passive scalar on a two-phase solution
Test-bed for a solver based on recurrence statistics
Rules
Solution data to compute the recurrence statistics from, needs to
reside in $CASE_ROOT/dataBase
Time step data in dataBase needs to be evenly spaced in time
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "singlePhaseTransportModel.H"
#include "turbulentTransportModel.H"
#include "fvOptions.H"
#include "cfdemCloudRec.H"
#include "recBase.H"
#include "recModel.H"
#include "cfdemCloud.H"
#include "clockModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
#include "postProcess.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createControl.H"
#include "createFields.H"
#include "createFvOptions.H"
cfdemCloudRec<cfdemCloud> particleCloud(mesh);
recBase recurrenceBase(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info << "\nCalculating particle trajectories based on recurrence statistics\n" << endl;
label recTimeIndex = 0;
scalar recTimeStep = recurrenceBase.recM().recTimeStep();
scalar startTime = runTime.startTime().value();
while (runTime.run())
{
runTime++;
// do stuff (every lagrangian time step)
particleCloud.clockM().start(1,"Global");
Info << "Time = " << runTime.timeName() << nl << endl;
particleCloud.clockM().start(2,"Coupling");
particleCloud.evolve(voidfraction,Us,URec);
particleCloud.clockM().stop("Coupling");
if ( runTime.timeOutputValue() - startTime - (recTimeIndex+1)*recTimeStep + 1.0e-5 > 0.0 )
{
recurrenceBase.updateRecFields();
#include "readFields.H"
recTimeIndex++;
}
particleCloud.clockM().start(27,"Output");
runTime.write();
particleCloud.clockM().stop("Output");
particleCloud.clockM().stop("Global");
Info << "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}
Info << "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,4 @@
recurrenceBase.recM().exportVolScalarField("voidfraction",voidfractionRec);
recurrenceBase.recM().exportVolVectorField("U",URec);
recurrenceBase.recM().exportVolVectorField("Us",UsRec);
recurrenceBase.recM().exportSurfaceScalarField("phi",phiRec);

View File

@ -0,0 +1,3 @@
rcfdemSolverCoupledHeattransfer.C
EXE=$(CFDEM_APP_DIR)/rcfdemSolverCoupledHeattransfer

View File

@ -0,0 +1,28 @@
include $(CFDEM_ADD_LIBS_DIR)/additionalLibs
EXE_INC = \
-I$(CFDEM_OFVERSION_DIR) \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/lnInclude \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/cfdTools \
-I$(CFDEM_SRC_DIR)/recurrence/lnInclude \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/derived/cfdemCloudRec \
-Wno-deprecated-copy
EXE_LIBS = \
-L$(CFDEM_LIB_DIR)\
-lrecurrence \
-lturbulenceModels \
-lincompressibleTurbulenceModels \
-lincompressibleTransportModels \
-lfiniteVolume \
-lmeshTools \
-lfvOptions \
-l$(CFDEM_LIB_NAME) \
$(CFDEM_ADD_LIB_PATHS) \
$(CFDEM_ADD_LIBS)

View File

@ -0,0 +1,35 @@
volScalarField rhoeps = rhoRec*voidfractionRec;
particleCloud.energyContributions(Qsource);
particleCloud.energyCoefficients(QCoeff);
//K = 0.5*magSqr(URec);
addSource = fvc::div(phiRec/fvc::interpolate(rhoRec), pRec);
// main contribution due to gas expansion, not due to transport of kinetic energy
// fvc::ddt(rhoeps, K) + fvc::div(phiRec, K)
fvScalarMatrix TEqn =
(
fvm::ddt(rhoeps, T)
+ fvm::div(phiRec, T)
+ addSource/Cv
- fvm::laplacian(voidfractionRec*thCond/Cv, T)
- Qsource/Cv
- fvm::Sp(QCoeff/Cv, T)
==
fvOptions(rhoeps, T) // no fvOptions support yet
);
fvOptions.constrain(TEqn); // no fvOptions support yet
TEqn.solve();
particleCloud.clockM().start(31,"postFlow");
counter++;
if((counter - couplingSubStep) % dtDEM2dtCFD == 0)
particleCloud.postFlow();
particleCloud.clockM().stop("postFlow");

View File

@ -0,0 +1,230 @@
// dummy fields
Info << "\nCreating dummy pressure field\n" << endl;
volScalarField pRec
(
IOobject
(
"pRec",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("zero", dimensionSet(1,-1,-2,0,0,0,0), 0.0)
);
// recurrence fields
Info << "\nCreating recurrence fields.\n" << endl;
volScalarField rhoRec
(
IOobject
(
"rhoRec",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("zero", dimensionSet(1, -3, 0, 0, 0), 1.0)
);
volVectorField URec
(
IOobject
(
"URec",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh,
dimensionedVector("zero", dimensionSet(0, 1, -1, 0, 0), vector::zero)
);
volScalarField voidfractionRec
(
IOobject
(
"voidfractionRec",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("zero", dimensionSet(0,0,0,0,0,0,0), 0.0)
);
volVectorField UsRec
(
IOobject
(
"UsRec",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh,
dimensionedVector("zero", dimensionSet(0, 1, -1, 0, 0), vector::zero)
);
// heat transfer fields
Info << "\nCreating heat transfer fields.\n" << endl;
volScalarField Qsource
(
IOobject
(
"Qsource",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("zero", dimensionSet(1,-1,-3,0,0,0,0), 0.0)
);
volScalarField QCoeff
( IOobject
(
"QCoeff",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("zero", dimensionSet(1,-1,-3,-1,0,0,0), 0.0)
);
volScalarField thCond
(
IOobject
(
"thCond",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("zero", dimensionSet(1,1,-3,-1,0,0,0), 0.0),
"zeroGradient"
);
volScalarField T
(
IOobject
(
"T",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
// calculated fields
Info << "\nCreating fields subject to calculation\n" << endl;
volScalarField voidfraction
(
IOobject
(
"voidfraction",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
voidfractionRec
);
volVectorField Us
(
IOobject
(
"Us",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
UsRec
);
// write fields for t=t_start
voidfraction.write();
Us.write();
//===============================
Info << "Calculating face flux field phiRec\n" << endl;
surfaceScalarField phiRec
(
IOobject
(
"phiRec",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("zero", dimensionSet(1,0,-1,0,0,0,0), 0.0)
);
phiRec.write();
Info << "Creating dummy turbulence model\n" << endl;
singlePhaseTransportModel laminarTransport(URec, phiRec);
autoPtr<incompressible::turbulenceModel> turbulence
(
incompressible::turbulenceModel::New(URec, phiRec, laminarTransport)
);
const IOdictionary& transportProps = mesh.lookupObject<IOdictionary>("transportProperties");
dimensionedScalar molMass(transportProps.lookup("molM"));
// need to scale R down with 1e3 because return value of RR in g, not kg
dimensionedScalar R("R",dimensionSet(0,2,-2,-1,0,0,0),Foam::constant::thermodynamic::RR / (1e3*molMass.value()));
Info << "specific gas constant R = " << R << endl;
dimensionedScalar Cv(transportProps.lookup("Cv"));
volScalarField addSource
(
IOobject
(
"addSource",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("zero", dimensionSet(1,-1,-3,0,0,0,0), 0.0)
);
// place to put weight functions
IOdictionary weightDict
(
IOobject
(
"weightDict",
runTime.constant(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
)
);
weightDict.add("weights",scalarList(1,1.0));

View File

@ -0,0 +1,131 @@
/*---------------------------------------------------------------------------*\
CFDEMcoupling academic - Open Source CFD-DEM coupling
Contributing authors:
Thomas Lichtenegger
Copyright (C) 2015- Johannes Kepler University, Linz
-------------------------------------------------------------------------------
License
This file is part of CFDEMcoupling academic.
CFDEMcoupling academic is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
CFDEMcoupling academic is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with CFDEMcoupling academic. If not, see <http://www.gnu.org/licenses/>.
Application
rcfdemSolverHeattransfer
Description
Solves heat transfer between fluid and particles based on rCFD
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "fvOptions.H"
#include "singlePhaseTransportModel.H"
#include "turbulentTransportModel.H"
#include "cfdemCloudRec.H"
#include "recBase.H"
#include "recModel.H"
#include "recPath.H"
#include "cfdemCloudEnergy.H"
#include "clockModel.H"
#include "thermCondModel.H"
#include "energyModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
#include "postProcess.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createControl.H"
#include "createFields.H"
#include "createFvOptions.H"
cfdemCloudRec<cfdemCloudEnergy> particleCloud(mesh);
recBase recurrenceBase(mesh);
#include "updateFields.H"
#include "updateRho.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info << "\nCalculating particle trajectories based on recurrence statistics\n" << endl;
label recTimeIndex = 0;
scalar recTimeStep = recurrenceBase.recM().recTimeStep();
scalar startTime = runTime.startTime().value();
// control coupling behavior in case of substepping
// assumes constant timestep size
label counter = 0;
label couplingSubStep = recurrenceBase.couplingSubStep();
double dtProp = particleCloud.dataExchangeM().couplingTime() / runTime.deltaTValue();
label dtDEM2dtCFD = int(dtProp + 0.5);
Info << "deltaT_DEM / deltaT_CFD = " << dtDEM2dtCFD << endl;
if (dtDEM2dtCFD > 1)
Info << "coupling at substep " << couplingSubStep << endl;
while (runTime.run())
{
runTime++;
// do stuff (every lagrangian time step)
particleCloud.clockM().start(1,"Global");
Info << "Time = " << runTime.timeName() << nl << endl;
particleCloud.clockM().start(2,"Coupling");
particleCloud.evolve(voidfraction,Us,URec);
particleCloud.clockM().stop("Coupling");
particleCloud.clockM().start(26,"Flow");
#include "updateRho.H"
#include "TEqImp.H"
particleCloud.clockM().stop("Flow");
particleCloud.clockM().start(32,"ReadFields");
if ( runTime.timeOutputValue() - startTime - (recTimeIndex+1)*recTimeStep + 1.0e-5 > 0.0 )
{
recurrenceBase.updateRecFields();
#include "updateFields.H"
recTimeIndex++;
}
particleCloud.clockM().stop("ReadFields");
particleCloud.clockM().start(33,"Output");
runTime.write();
particleCloud.clockM().stop("Output");
particleCloud.clockM().stop("Global");
Info << "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}
Info << "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,38 @@
// get current weights for various databases
// A: triggered over current value of boundary field
// word boundaryName = "inlet";
// label myinlet = mesh.boundary().findPatchID(boundaryName);
// label startIndex = mesh.boundary()[boundaryName].start();
// B: explicitly define weights
scalarList wList(weightDict.lookupOrDefault("weights",scalarList(1,0.0)));
recurrenceBase.recP().updateIntervalWeights(wList);
// is it neccessary to extend recurrence path?
if(recurrenceBase.recM().endOfPath())
{
recurrenceBase.extendPath();
}
recurrenceBase.recM().exportVolScalarField("voidfraction",voidfractionRec);
recurrenceBase.recM().exportVolScalarField("p",pRec);
recurrenceBase.recM().exportVolVectorField("Us",UsRec);
recurrenceBase.recM().exportSurfaceScalarField("phi",phiRec);
Info << "current database weights: = " << wList << endl;
Info << "current database: " << recurrenceBase.recM().currDataBase() << endl;
for(int i=0;i<wList.size();i++)
{
scalar w = wList[i];
if (recurrenceBase.recM().currDataBase() == i) w -= 1.0;
phiRec += w*recurrenceBase.recM().exportSurfaceScalarFieldAve("phi",i)();
}
{
volScalarField& NuField(const_cast<volScalarField&>(mesh.lookupObject<volScalarField> ("NuField")));
recurrenceBase.recM().exportVolScalarField("NuField",NuField);
}

View File

@ -0,0 +1 @@
rhoRec = pRec / (T * R);

View File

@ -6,9 +6,6 @@
particleCloud.energyContributions(Qsource);
particleCloud.energyCoefficients(QCoeff);
//thDiff=particleCloud.thermCondM().thermDiff();
thCond=particleCloud.thermCondM().thermCond();
addSource =
(
he.name() == "e"
@ -16,7 +13,7 @@
fvc::div(phi, K) +
fvc::div
(
fvc::absolute(phi/fvc::interpolate(rho), voidfraction*U),
fvc::absolute(phi/fvc::interpolate(rho), voidfractionRec*U),
p,
"div(phiv,p)"
)
@ -25,9 +22,6 @@
Cpv = he.name() == "e" ? thermo.Cv() : thermo.Cp();
// correct source for the thermodynamic reference temperature
dimensionedScalar Tref("Tref", dimTemperature, T[0]-he[0]/(Cpv[0]+SMALL));
Qsource += QCoeff*Tref;
fvScalarMatrix EEqn
(
@ -35,12 +29,12 @@
+ addSource
- Qsource
- fvm::Sp(QCoeff/Cpv, he)
- fvm::laplacian(voidfraction*thCond/Cpv,he)
// - fvm::laplacian(voidfractionRec*kf/Cpv,he)
- fvm::laplacian(voidfractionRec*thCond/Cpv,he)
==
fvOptions(rho, he)
);
EEqn.relax();
fvOptions.constrain(EEqn);

View File

@ -0,0 +1,3 @@
rcfdemSolverRhoSteadyPimple.C
EXE=$(CFDEM_APP_DIR)/rcfdemSolverRhoSteadyPimple

View File

@ -1,5 +1,7 @@
include $(CFDEM_ADD_LIBS_DIR)/additionalLibs
FOAM_VERSION_MAJOR := $(word 1,$(subst ., ,$(WM_PROJECT_VERSION)))
PFLAGS+= -DOPENFOAM_VERSION_MAJOR=$(FOAM_VERSION_MAJOR)
PFLAGS+= -Dcompre
EXE_INC = \
@ -15,9 +17,12 @@ EXE_INC = \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/lnInclude \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/cfdTools \
-I$(CFDEM_SRC_DIR)/recurrence/lnInclude \
-Wno-deprecated-copy
EXE_LIBS = \
-L$(CFDEM_LIB_DIR)\
-lrecurrence \
-lcompressibleTransportModels \
-lfluidThermophysicalModels \
-lspecie \

View File

@ -4,7 +4,7 @@ particleCloud.otherForces(fOther);
tmp<fvVectorMatrix> tUEqn
(
fvm::div(phi, U)
+ particleCloud.divVoidfractionTau(U, voidfraction)
+ particleCloud.divVoidfractionTau(U, voidfractionRec)
+ fvm::Sp(Ksl,U)
- fOther
==
@ -18,13 +18,16 @@ fvOptions.constrain(UEqn);
if (modelType=="B" || modelType=="Bfull")
{
solve(UEqn == -fvc::grad(p)+ Ksl*Us);
solve(UEqn == -fvc::grad(p)+ Ksl*UsRec);
}
else
{
solve(UEqn == -voidfraction*fvc::grad(p)+ Ksl*Us);
solve(UEqn == -voidfractionRec*fvc::grad(p)+ Ksl*UsRec);
}
//U.relax();
#include "limitU.H"
fvOptions.correct(U);
K = 0.5*magSqr(U);

View File

@ -51,6 +51,19 @@ Info<< "Reading thermophysical properties\n" << endl;
mesh
);
volScalarField voidfractionRec
(
IOobject
(
"voidfractionRec",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
voidfraction
);
volScalarField addSource
(
IOobject
@ -58,10 +71,11 @@ Info<< "Reading thermophysical properties\n" << endl;
"addSource",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh
mesh,
dimensionedScalar("zero", dimensionSet(1,-1,-3,0,0,0,0), 0.0)
);
Info<< "\nCreating fluid-particle heat flux field\n" << endl;
@ -102,11 +116,12 @@ Info<< "Reading thermophysical properties\n" << endl;
"thCond",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("zero", dimensionSet(1,1,-3,-1,0,0,0), 0.0)
dimensionedScalar("zero", dimensionSet(1,1,-3,-1,0,0,0), 0.0),
"zeroGradient"
);
Info<< "\nCreating heat capacity field\n" << endl;
@ -158,7 +173,7 @@ Info<< "Reading thermophysical properties\n" << endl;
dimensionedScalar::lookupOrDefault
(
"rhoMax",
simple.dict(),
pimple.dict(),
dimDensity,
GREAT
)
@ -169,12 +184,45 @@ Info<< "Reading thermophysical properties\n" << endl;
dimensionedScalar::lookupOrDefault
(
"rhoMin",
simple.dict(),
pimple.dict(),
dimDensity,
0
)
);
dimensionedScalar pMax
(
dimensionedScalar::lookupOrDefault
(
"pMax",
pimple.dict(),
dimPressure,
GREAT
)
);
dimensionedScalar pMin
(
dimensionedScalar::lookupOrDefault
(
"pMin",
pimple.dict(),
dimPressure,
-GREAT
)
);
dimensionedScalar UMax
(
dimensionedScalar::lookupOrDefault
(
"UMax",
pimple.dict(),
dimVelocity,
-1.0
)
);
Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::turbulenceModel> turbulence
(
@ -189,7 +237,7 @@ Info<< "Reading thermophysical properties\n" << endl;
label pRefCell = 0;
scalar pRefValue = 0.0;
setRefCell(p, simple.dict(), pRefCell, pRefValue);
setRefCell(p, pimple.dict(), pRefCell, pRefValue);
mesh.setFluxRequired(p.name());
@ -217,11 +265,11 @@ Info<< "Reading thermophysical properties\n" << endl;
"Ksl",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh
//dimensionedScalar("0", dimensionSet(1, -3, -1, 0, 0), 1.0)
mesh,
dimensionedScalar("0", dimensionSet(1, -3, -1, 0, 0), 0.0)
);
@ -239,4 +287,20 @@ Info<< "Reading thermophysical properties\n" << endl;
mesh
);
volVectorField UsRec
(
IOobject
(
"UsRec",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
Us
);
dimensionedScalar kf("0", dimensionSet(1, 1, -3, -1, 0, 0, 0), 0.026);
//===============================

View File

@ -0,0 +1,2 @@
p = max(p, pMin);
p = min(p, pMax);

View File

@ -0,0 +1,11 @@
if (UMax.value() > 0)
{
forAll(U,cellI)
{
scalar mU(mag(U[cellI]));
if (mU > UMax.value())
{
U[cellI] *= UMax.value() / mU;
}
}
}

View File

@ -7,14 +7,15 @@ volScalarField rAU(1.0/UEqn.A());
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rhoeps*rAU));
if (modelType=="A")
{
rhorAUf *= fvc::interpolate(voidfraction);
rhorAUf *= fvc::interpolate(voidfractionRec);
}
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
//tUEqn.clear();
surfaceScalarField phiUs("phiUs", fvc::interpolate(rhoeps*rAU*Ksl*Us)& mesh.Sf());
surfaceScalarField phiUs("phiUs", fvc::interpolate(rhoeps*rAU*Ksl*UsRec)& mesh.Sf());
if (simple.transonic())
if (pimple.transonic())
{
// transonic version not implemented yet
}
@ -34,7 +35,7 @@ else
// Update the pressure BCs to ensure flux consistency
constrainPressure(p, rhoeps, U, phi, rhorAUf);
while (simple.correctNonOrthogonal())
while (pimple.correctNonOrthogonal())
{
// Pressure corrector
fvScalarMatrix pEqn
@ -49,7 +50,7 @@ else
pEqn.solve();
if (simple.finalNonOrthogonalIter())
if (pimple.finalNonOrthogonalIter())
{
phi += pEqn.flux();
}
@ -59,6 +60,8 @@ else
// Explicitly relax pressure for momentum corrector
p.relax();
#include "limitP.H"
// Recalculate density from the relaxed pressure
rho = thermo.rho();
rho = max(rho, rhoMin);
@ -69,13 +72,15 @@ Info<< "rho max/min : " << max(rho).value()
if (modelType=="A")
{
U = HbyA - rAU*(voidfraction*fvc::grad(p)-Ksl*Us);
U = HbyA - rAU*(voidfractionRec*fvc::grad(p)-Ksl*UsRec);
}
else
{
U = HbyA - rAU*(fvc::grad(p)-Ksl*Us);
U = HbyA - rAU*(fvc::grad(p)-Ksl*UsRec);
}
#include "limitU.H"
U.correctBoundaryConditions();
fvOptions.correct(U);
K = 0.5*magSqr(U);

View File

@ -17,23 +17,31 @@ License
Copyright (C) 2015- Thomas Lichtenegger, JKU Linz, Austria
Application
cfdemSolverRhoSimple
rcfdemSolverRhoSteadyPimple
Description
Steady-state solver for turbulent flow of compressible fluids based on
rhoSimpleFoam where functionality for CFD-DEM coupling has been added.
Transient (DEM) + steady-state (CFD) solver for compressible flow using the
flexible PIMPLE (PISO-SIMPLE) algorithm. Particle-motion is obtained from
a recurrence process.
Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
The code is an evolution of the solver rhoPimpleFoam in OpenFOAM(R) 4.x,
where additional functionality for CFD-DEM coupling is added.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "psiThermo.H"
#include "turbulentFluidThermoModel.H"
#include "bound.H"
#include "simpleControl.H"
#include "pimpleControl.H"
#include "fvOptions.H"
#include "localEulerDdtScheme.H"
#include "fvcSmooth.H"
#include "cfdemCloudRec.H"
#include "recBase.H"
#include "recModel.H"
#include "recPath.H"
#include "cfdemCloudEnergy.H"
#include "implicitCouple.H"
#include "clockModel.H"
@ -61,18 +69,37 @@ int main(int argc, char *argv[])
#include "createFvOptions.H"
// create cfdemCloud
#include "readGravitationalAcceleration.H"
cfdemCloudEnergy particleCloud(mesh);
//#include "readGravitationalAcceleration.H"
cfdemCloudRec<cfdemCloudEnergy> particleCloud(mesh);
#include "checkModelType.H"
recBase recurrenceBase(mesh);
#include "updateFields.H"
turbulence->validate();
//#include "compressibleCourantNo.H"
//#include "setInitialDeltaT.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
label recTimeIndex = 0;
scalar recTimeStep = recurrenceBase.recM().recTimeStep();
scalar startTime = runTime.startTime().value();
const IOdictionary& couplingProps = particleCloud.couplingProperties();
label nEveryFlow(couplingProps.lookupOrDefault<label>("nEveryFlow",1));
Info << "Solving flow equations every " << nEveryFlow << " steps.\n" << endl;
label stepcounter = 0;
Info<< "\nStarting time loop\n" << endl;
while (simple.loop())
while (runTime.run())
{
#include "readTimeControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
runTime++;
particleCloud.clockM().start(1,"Global");
Info<< "Time = " << runTime.timeName() << nl << endl;
@ -81,6 +108,9 @@ int main(int argc, char *argv[])
particleCloud.clockM().start(2,"Coupling");
bool hasEvolved = particleCloud.evolve(voidfraction,Us,U);
//voidfraction = voidfractionRec;
//Us = UsRec;
if(hasEvolved)
{
particleCloud.smoothingM().smoothen(particleCloud.forceM(0).impParticleForces());
@ -101,25 +131,56 @@ int main(int argc, char *argv[])
particleCloud.clockM().stop("Coupling");
particleCloud.clockM().start(26,"Flow");
volScalarField rhoeps("rhoeps",rho*voidfractionRec);
if (stepcounter%nEveryFlow==0)
{
while (pimple.loop())
{
// if needed, perform drag update here
#if OPENFOAM_VERSION_MAJOR < 6
if (pimple.nCorrPIMPLE() <= 1)
#else
if (pimple.nCorrPimple() <= 1)
#endif
{
#include "rhoEqn.H"
}
volScalarField rhoeps("rhoeps",rho*voidfraction);
// Pressure-velocity SIMPLE corrector
// --- Pressure-velocity PIMPLE corrector loop
#include "UEqn.H"
#include "UEqn.H"
#include "EEqn.H"
// --- Pressure corrector loop
while (pimple.correct())
{
// besides this pEqn, OF offers a "pimple consistent"-option
#include "pEqn.H"
rhoeps=rho*voidfractionRec;
}
// besides this pEqn, OF offers a "simple consistent"-option
#include "pEqn.H"
rhoeps=rho*voidfraction;
if (pimple.turbCorr())
{
turbulence->correct();
}
}
}
stepcounter++;
particleCloud.clockM().stop("Flow");
#include "EEqn.H"
turbulence->correct();
particleCloud.clockM().start(32,"postFlow");
if(hasEvolved) particleCloud.postFlow();
particleCloud.clockM().start(31,"postFlow");
particleCloud.postFlow();
particleCloud.clockM().stop("postFlow");
particleCloud.clockM().start(32,"ReadFields");
if ( runTime.timeOutputValue() - startTime - (recTimeIndex+1)*recTimeStep + 1.0e-5 > 0.0 )
{
recurrenceBase.updateRecFields();
#include "updateFields.H"
recTimeIndex++;
}
particleCloud.clockM().stop("ReadFields");
runTime.write();
@ -127,7 +188,7 @@ int main(int argc, char *argv[])
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
particleCloud.clockM().stop("Flow");
particleCloud.clockM().stop("Global");
}

View File

@ -0,0 +1,8 @@
// is it neccessary to extend recurrence path?
if(recurrenceBase.recM().endOfPath())
{
recurrenceBase.extendPath();
}
recurrenceBase.recM().exportVolScalarField("voidfraction",voidfractionRec);
recurrenceBase.recM().exportVolVectorField("Us",UsRec);

View File

@ -0,0 +1,3 @@
recSolverTurbTransport.C
EXE=$(CFDEM_APP_DIR)/recSolverTurbTransport

View File

@ -0,0 +1,27 @@
include $(CFDEM_ADD_LIBS_DIR)/additionalLibs
EXE_INC = \
-I$(CFDEM_OFVERSION_DIR) \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/lnInclude \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/cfdTools \
-I$(CFDEM_SRC_DIR)/recurrence/lnInclude \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/derived/cfdemCloudRec \
EXE_LIBS = \
-L$(CFDEM_LIB_DIR)\
-lrecurrence \
-lturbulenceModels \
-lincompressibleTurbulenceModels \
-lincompressibleTransportModels \
-lfiniteVolume \
-lmeshTools \
-lfvOptions \
-l$(CFDEM_LIB_NAME) \
$(CFDEM_ADD_LIB_PATHS) \
$(CFDEM_ADD_LIBS)

View File

@ -0,0 +1,17 @@
volScalarField alphaEff("alphaEff", turbulence->nu()/Sc + dU2/Sct);
TEqn =
(
fvm::ddt(T)
+ fvm::div(phiRec, T)
- fvm::laplacian(alphaEff, T)
==
fvOptions(T)
);
TEqn.relax(relaxCoeff);
fvOptions.constrain(TEqn);
TEqn.solve();

View File

@ -0,0 +1,174 @@
// dummy fields
Info<< "\nCreating dummy pressure and density fields\n" << endl;
volScalarField p
(
IOobject
(
"p",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar("p", dimensionSet(1, 2, -2, 0, 0), 1.0)
);
volScalarField rho
(
IOobject
(
"rho",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar("rho", dimensionSet(1, -3, 0, 0, 0), 1.0)
);
// recurrence fields
Info<< "\nCreating recurrence fields.\n" << endl;
volVectorField URec
(
IOobject
(
"URec",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
volScalarField U2Rec
(
IOobject
(
"U2Rec",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
// calculated fields
Info<< "\nCreating fields subject to calculation\n" << endl;
volScalarField delta
(
IOobject
(
"delta",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("delta", dimLength, 0.0)
);
delta.primitiveFieldRef()=pow(mesh.V(),1.0/3.0);
delta.write();
Info<< "\ncreating dU2\n" << endl;
volScalarField dU2
(
IOobject
(
"dU2",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
sqrt(0.5*mag(U2Rec - magSqr(URec)))*delta*0.094
);
forAll(dU2, cellI)
{
if (U2Rec[cellI]-magSqr(URec[cellI]) < 0.0)
{
dU2[cellI] = 0.0;
}
}
dU2.write();
Info<< "Calculating face flux field phiRec\n" << endl;
surfaceScalarField phiRec
(
IOobject
(
"phiRec",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
linearInterpolate(URec) & mesh.Sf()
);
phiRec.write();
singlePhaseTransportModel laminarTransport(URec, phiRec);
autoPtr<incompressible::turbulenceModel> turbulence
(
incompressible::turbulenceModel::New(URec, phiRec, laminarTransport)
);
dimensionedScalar Sc("Sc", dimless, laminarTransport);
dimensionedScalar Sct("Sct", dimless, laminarTransport);
// create concentration field
Info<< "Creating scalar transport field\n" << endl;
volScalarField T
(
IOobject
(
"T",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
fvScalarMatrix TEqn(T, dimless*dimVolume/(dimTime));
scalar relaxCoeff(0.0);
Info<< "reading clockProperties\n" << endl;
IOdictionary clockProperties
(
IOobject
(
"clockProperties",
mesh.time().constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
autoPtr<clockModel> myClock
(
clockModel::New
(
clockProperties,
mesh.time()
)
);

View File

@ -0,0 +1,14 @@
recurrenceBase.recM().exportVolScalarField("U2Mean",U2Rec);
recurrenceBase.recM().exportVolVectorField("UMean",URec);
phiRec=linearInterpolate(URec) & mesh.Sf();
dU2=sqrt(0.5*mag(U2Rec - magSqr(URec)))*delta*0.094;
forAll(dU2, cellI)
{
if (U2Rec[cellI]-magSqr(URec[cellI]) < 0.0)
{
dU2[cellI] = 0.0;
}
}

View File

@ -0,0 +1,113 @@
/*---------------------------------------------------------------------------*\
CFDEMcoupling academic - Open Source CFD-DEM coupling
Contributing authors:
Thomas Lichtenegger, Gerhard Holzinger
Copyright (C) 2015- Johannes Kepler University, Linz
-------------------------------------------------------------------------------
License
This file is part of CFDEMcoupling academic.
CFDEMcoupling academic is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
CFDEMcoupling academic is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with CFDEMcoupling academic. If not, see <http://www.gnu.org/licenses/>.
Application
Turbulent Transport Solver Recurrence
Description
Solves a transport equation for a passive scalar on a single-phase solution
for a solver based on recurrence statistics
Rules
Solution data to compute the recurrence statistics from, needs to
reside in $CASE_ROOT/dataBase
Time step data in dataBase needs to be evenly spaced in time
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "singlePhaseTransportModel.H"
#include "turbulentTransportModel.H"
#include "fvOptions.H"
#include "recBase.H"
#include "recModel.H"
#include "clockModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
#include "postProcess.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createControl.H"
#include "createFields.H"
#include "createFvOptions.H"
recBase recurrenceBase(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nCalculating particle trajectories based on recurrence statistics\n" << endl;
label recTimeIndex(0);
scalar recTimeStep_=recurrenceBase.recM().recTimeStep();
while (runTime.run())
{
myClock().start(1,"Global");
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
myClock().start(2,"fieldUpdate");
if ( runTime.timeOutputValue() - (recTimeIndex+1)*recTimeStep_ + 1.0e-5 > 0.0 )
{
Info << "Updating fields at run time " << runTime.timeOutputValue()
<< " corresponding to recurrence time " << (recTimeIndex+1)*recTimeStep_ << ".\n" << endl;
recurrenceBase.updateRecFields();
#include "readFields.H"
recTimeIndex++;
}
myClock().stop("fieldUpdate");
myClock().start(3,"speciesEqn");
#include "TEq.H"
myClock().stop("speciesEqn");
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
myClock().stop("Global");
}
myClock().evalPar();
myClock().normHist();
Info<< "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,3 @@
rtfmSolverSpecies.C
EXE=$(CFDEM_APP_DIR)/rtfmSolverSpecies

View File

@ -0,0 +1,28 @@
include $(CFDEM_ADD_LIBS_DIR)/additionalLibs
EXE_INC = \
-I$(CFDEM_OFVERSION_DIR) \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/lnInclude \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/cfdTools \
-I$(CFDEM_SRC_DIR)/recurrence/lnInclude \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/derived/cfdemCloudRec \
-Wno-deprecated-copy
EXE_LIBS = \
-L$(CFDEM_LIB_DIR)\
-lrecurrence \
-lturbulenceModels \
-lincompressibleTurbulenceModels \
-lincompressibleTransportModels \
-lfiniteVolume \
-lmeshTools \
-lfvOptions \
-l$(CFDEM_LIB_NAME) \
$(CFDEM_ADD_LIB_PATHS) \
$(CFDEM_ADD_LIBS)

View File

@ -0,0 +1,14 @@
TEqn =
(
fvm::ddt(alpha2Rec, T)
+ fvm::div(phi2Rec, T)
- fvm::laplacian(alpha2Rec*turbulence->nu(), T)
==
fvOptions(alpha2Rec, T) // no fvOptions support yet
);
TEqn.relax(relaxCoeff);
fvOptions.constrain(TEqn); // no fvOptions support yet
TEqn.solve();

View File

@ -0,0 +1,135 @@
// dummy fields
Info << "\nCreating dummy pressure and density fields\n" << endl;
volScalarField p
(
IOobject
(
"p",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar("p", dimensionSet(1, 2, -2, 0, 0), 1.0)
);
volScalarField rho
(
IOobject
(
"rho",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar("rho", dimensionSet(1, -3, 0, 0, 0), 1.0)
);
// recurrence fields
Info << "\nCreating recurrence fields.\n" << endl;
volVectorField U1Rec
(
IOobject
(
"U1Rec",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
volScalarField alpha1Rec
(
IOobject
(
"alpha1Rec",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
volVectorField U2Rec
(
IOobject
(
"U2Rec",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
// calculated fields
Info << "\nCreating fields subject to calculation\n" << endl;
volScalarField alpha2Rec
(
IOobject
(
"alpha2Rec",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
1-alpha1Rec
);
// write fields for t=t_start
alpha2Rec.write();
//===============================
Info << "Calculating face flux field phi\n" << endl;
surfaceScalarField phi2Rec
(
IOobject
(
"phi2Rec",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
linearInterpolate(U2Rec*alpha2Rec) & mesh.Sf()
);
phi2Rec.write();
singlePhaseTransportModel laminarTransport(U2Rec, phi2Rec);
autoPtr<incompressible::turbulenceModel> turbulence
(
incompressible::turbulenceModel::New(U2Rec, phi2Rec, laminarTransport)
);
// transport stuff
// create concentration field
volScalarField T
(
IOobject
(
"T",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
fvScalarMatrix TEqn(T, dimless*dimVolume/(dimTime));
T.write();
scalar relaxCoeff(0.0);

View File

@ -0,0 +1,6 @@
recurrenceBase.recM().exportVolScalarField("alpha.air",alpha1Rec);
alpha2Rec=1-alpha1Rec;
recurrenceBase.recM().exportVolVectorField("U.air",U1Rec);
recurrenceBase.recM().exportVolVectorField("U.water",U2Rec);
recurrenceBase.recM().exportSurfaceScalarField("phi.water",phi2Rec);

View File

@ -0,0 +1,112 @@
/*---------------------------------------------------------------------------*\
CFDEMcoupling academic - Open Source CFD-DEM coupling
Contributing authors:
Thomas Lichtenegger, Gerhard Holzinger
Copyright (C) 2015- Johannes Kepler University, Linz
-------------------------------------------------------------------------------
License
This file is part of CFDEMcoupling academic.
CFDEMcoupling academic is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
CFDEMcoupling academic is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with CFDEMcoupling academic. If not, see <http://www.gnu.org/licenses/>.
Application
cfdemSolverRecurrence
Description
Solves a transport equation for a passive scalar on a two-phase solution
Test-bed for a solver based on recurrence statistics
Rules
Solution data to compute the recurrence statistics from, needs to
reside in $CASE_ROOT/dataBase
Time step data in dataBase needs to be evenly spaced in time
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "singlePhaseTransportModel.H"
#include "turbulentTransportModel.H"
#include "fvOptions.H"
#include "cfdemCloudRec.H"
#include "recBase.H"
#include "recModel.H"
#include "cfdemCloud.H"
#include "clockModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
#include "postProcess.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createControl.H"
#include "createFields.H"
#include "createFvOptions.H"
cfdemCloudRec<cfdemCloud> particleCloud(mesh);
recBase recurrenceBase(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info << "\nCalculating particle trajectories based on recurrence statistics\n" << endl;
label recTimeIndex(0);
scalar recTimeStep_=recurrenceBase.recM().recTimeStep();
while (runTime.run())
{
runTime++;
// do stuff (every lagrangian time step)
particleCloud.clockM().start(1,"Global");
Info << "Time = " << runTime.timeName() << nl << endl;
particleCloud.clockM().start(2,"Flow");
#include "TEq.H"
particleCloud.clockM().stop("Flow");
if ( runTime.timeOutputValue() - (recTimeIndex+1)*recTimeStep_ + 1.0e-5 > 0.0 )
{
Info << "Updating fields at run time " << runTime.timeOutputValue()
<< " corresponding to recurrence time " << (recTimeIndex+1)*recTimeStep_ << ".\n" << endl;
recurrenceBase.updateRecFields();
#include "readFields.H"
recTimeIndex++;
}
particleCloud.clockM().start(27,"Output");
runTime.write();
particleCloud.clockM().stop("Output");
particleCloud.clockM().stop("Global");
Info << "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}
Info << "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,9 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
set -x
wclean libso recurrenceTurbulence
wclean
# ----------------------------------------------------------------- end-of-file

View File

@ -0,0 +1,9 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
set -x
wmake libso recurrenceTurbulence
wmake
# ----------------------------------------------------------------- end-of-file

View File

@ -0,0 +1,29 @@
// build equation system
/*
Note the use of the effective viscosity, which is provided by the turbulence model
The recurrence-based turbulence models are derived from the standard base classes
of OpenFOAM, thus they behave as a normal turbulence model would.
*/
alphaRhoPhiCarrier = linearInterpolate(alpha2*rhoCarrier)*phi2;
fvScalarMatrix CEqn
(
fvm::ddt(alphaCarrier*rhoCarrier, C)
+ fvm::div(alphaRhoPhiCarrier, C, "div(alphaRhoPhi,C)")
- fvm::Sp(fvc::div(alphaRhoPhiCarrier), C)
- fvm::laplacian
(
fvc::interpolate(alpha2)
*fvc::interpolate(carrierPhase.turbulence().muEff()/Sc),
C
)
==
fvm::SuSp(alphaCarrier*(1.0 - alphaCarrier)*rhoCarrier*K, C)
+ fvOptions(alphaCarrier*rhoCarrier, C)
);
// solve equations
fvOptions.constrain(CEqn);
CEqn.solve();

View File

@ -0,0 +1,3 @@
testTwoFluidRecurrenceTurbulence.C
EXE = $(FOAM_USER_APPBIN)/testTwoFluidRecurrenceTurbulence

View File

@ -0,0 +1,31 @@
EXE_INC = \
-I$(FOAM_SOLVERS)/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam \
-I$(FOAM_SOLVERS)/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/lnInclude \
-I$(FOAM_SOLVERS)/multiphase/reactingEulerFoam/phaseSystems/lnInclude \
-I$(FOAM_SOLVERS)/multiphase/reactingEulerFoam/interfacialModels/lnInclude \
-I$(FOAM_SOLVERS)/multiphase/reactingEulerFoam/interfacialCompositionModels/lnInclude \
-I$(FOAM_SOLVERS)/multiphase/reactingEulerFoam/twoPhaseCompressibleTurbulenceModels/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/phaseCompressible/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I../../../src/recurrence/lnInclude \
-IrecurrenceTurbulence/lnInclude
EXE_LIBS = \
-lreactingPhaseSystem \
-lreactingTwoPhaseSystem \
-lreactingEulerianInterfacialModels \
-lreactingEulerianInterfacialCompositionModels \
-ltwoPhaseReactingTurbulenceModels \
-lfiniteVolume \
-lfvOptions \
-lmeshTools \
-lsampling \
-L$(FOAM_USER_LIBBIN) \
-lrecurrence \
-lrecurrenceTwoPhaseTurbulenceModels

View File

@ -0,0 +1,70 @@
//===============================
// recurrence turbulence
//===============================
// check both phases for turbulence models
forAllIter(PtrListDictionary<phaseModel>, fluid.phases(), iter)
{
phaseModel& phase = iter();
Info << "Checking phase " << phase.name() << "'s turbulence model: "
<< phase.turbulence().type() << endl;
/*
Check for laminar turbulence. This works with OpenFOAM-4.0 and OpenFOAM-5.0,
as the laminar, multi-phase turbulence model is named "laminar" in OF-4.0
and "Stokes" in OF-5.0
*/
if (phase.turbulence().type() == "laminar" || phase.turbulence().type() == "Stokes")
{
// do nothing
}
else if (isA<Foam::recurrenceTurbulenceModel>(phase.turbulence()))
{
/*
create a reference of the type recurrenceTurbulenceModel
register the recurrence model with the recurrenceTurbulenceModel
*/
// get const-reference to the turbulence model
const phaseCompressibleTurbulenceModel& turbConstRef = phase.turbulence();
// cast away const-ness, the underlying turbulence model is not a const object, so this is bad but fine
phaseCompressibleTurbulenceModel& turbRef = const_cast<phaseCompressibleTurbulenceModel&>(turbConstRef);
// cast away the wrapper class, to get a reference to the turbulence models' base class
PhaseCompressibleTurbulenceModel<phaseModel>& baseTurbRef
(
static_cast<PhaseCompressibleTurbulenceModel<phaseModel>&>(turbRef)
);
// casting down the family tree
Foam::recurrenceTurbulenceModel& recTurbRef
(
dynamic_cast<Foam::recurrenceTurbulenceModel&>(baseTurbRef)
);
// set recurrenceBase pointer
recTurbRef.setRecurrenceBasePtr(&recurrenceBase);
// check model settings
turbRef.validate();
}
else
{
/*
In a recurrence run, we do not compute any turbulence as we do not solve the fluid flow
At this point, the phase is not laminar (i.e. not using turbulence) or
using recurrenceTurbulence (i.e. taking turbulent quantities from the data base).
Hence, abort!
*/
FatalError
<< "Wrong turbulence model type "
<< phase.turbulence().type() << " for phase " << phase.name() << nl << nl
<< "Valid turbulence model types are types derived from recurrenceTurbulenceModel or laminar" << endl
<< exit(FatalError);
}
}

View File

@ -0,0 +1,79 @@
/* --------------------------------------------------------------------------------- */
/* read flotation properties */
/* --------------------------------------------------------------------------------- */
Info<< "Reading scalarTransportProperties\n" << endl;
IOdictionary scalarTransportProperties
(
IOobject
(
"scalarTransportProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
const scalar Sc(scalarTransportProperties.lookupOrDefault<scalar>("Sc",scalar(1.0)));
const word carrierPhaseName(scalarTransportProperties.lookup("carrierPhase"));
if (carrierPhaseName != phase1.name() && carrierPhaseName != phase2.name())
{
FatalError << "No valid carrier phase specified" << nl
<< "Valid phase names are: " << nl
<< phase1.name() << ", " << phase2.name()
<< abort(FatalError);
}
phaseModel& carrierPhase = (carrierPhaseName == phase1.name()) ? phase1 : phase2;
const word dispersePhaseName = (carrierPhaseName == phase1.name()) ? phase2.name() : phase1.name();
volScalarField& rhoCarrier = carrierPhase.thermo().rho();
volScalarField& alphaCarrier = carrierPhase;
surfaceScalarField& alphaRhoPhiCarrier = carrierPhase.alphaRhoPhi();
volScalarField contErrCarrier
(
"contErrCarrier",
fvc::ddt(alphaCarrier, rhoCarrier)
);
Info<< "Reading field C\n" << endl;
volScalarField C
(
IOobject
(
"C",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
volScalarField K
(
IOobject
(
"K",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
),
mesh
);

View File

@ -0,0 +1,9 @@
// update flow fields
recurrenceBase.recM().exportVolScalarField("alpha."+carrierPhaseName,alpha2);
recurrenceBase.recM().exportVolScalarField("alpha."+dispersePhaseName,alpha1);
recurrenceBase.recM().exportVolVectorField("U."+carrierPhaseName,U2);
// update turbulence models
phase1.correctTurbulence();
phase2.correctTurbulence();

View File

@ -0,0 +1,7 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
wclean libso
#------------------------------------------------------------------------------

View File

@ -0,0 +1,9 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Parse arguments for library compilation
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
wmake $targetType
#------------------------------------------------------------------------------

View File

@ -0,0 +1,10 @@
recurrenceTurbulenceModel/recurrenceTurbulenceModel.C
recurrenceTurbulenceModels.C
recurrenceKEpsilon/recurrenceKEpsilon.C
recurrenceKOmega/recurrenceKOmega.C
recurrenceSmagorinsky/recurrenceSmagorinsky.C
LIB = $(FOAM_USER_LIBBIN)/librecurrenceTwoPhaseTurbulenceModels

View File

@ -0,0 +1,27 @@
EXE_INC = \
-I$(FOAM_SOLVERS)/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/lnInclude \
-I$(FOAM_SOLVERS)/multiphase/reactingEulerFoam/phaseSystems/lnInclude \
-I$(FOAM_SOLVERS)/multiphase/reactingEulerFoam/interfacialModels/lnInclude\
-I$(FOAM_SOLVERS)/multiphase/reactingEulerFoam/interfacialCompositionModels/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/transportModels/incompressible/transportModel \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/phaseCompressible/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I../recurrenceTurbulenceModel/lnInclude \
-I../../../../src/recurrence/lnInclude
LIB_LIBS = \
-lreactingPhaseSystem \
-lreactingTwoPhaseSystem \
-lreactingEulerianInterfacialModels \
-lreactingEulerianInterfacialCompositionModels \
-lfiniteVolume \
-lfvOptions \
-lmeshTools \
-L$(FOAM_USER_LIBBIN) \
-lrecurrence \
-lreactingTwoPhaseSystem

View File

@ -0,0 +1,107 @@
# Recurrence-based, multi-phase turbulence modelling
This model implements recurrence-based turbulence models, i.e. the fundamental
turbulent field quantities are read from the data base and are not solved for.
All derived field quantities are computed just in the same way as the proper
turbulence models do. By deriving the recurrence-based turbulence models from
somewhere up the family tree of OpenFOAM's turbulence model class hierarchy,
the recurrence-based turbulence models are fully compatible with OpenFOAM's
generic treatment of turbulence modelling, i.e. solvers and libraries interact
with references to a generic base type of the actual turbulence model. Hence,
solvers and libraries may remain blissfully ignorant of the actual turbulence
model in use.
For laminar phases no special treatment is necessary, as the *laminar*
turbulence model does not compute any fields.
## Development notes
The initial development covers only a small number of turbulence models.
## Notes on usage
The turbulence model in use for the recurrence run must be the recurrence-based
equivalent of the turbulence model used for generating the data base, i.e. if
the data base was computed using the *kEpsilon* model, then the recurrence solver
is to employ the *recurrenceKEpsilon* turbulence model. This model will read
the relevant model coefficients from the *turbulenceProperties* dictionary, and
make sure that the turbulent fields `k` and `epsilon` are contained in the data
base.
Whenever, the solver or a library calls `turbulence->nut()` to access the
turbulent viscosity, the recurrence-based kEpsilon model will compute `nut`
according to kEpsilon's relations `nut = Cmu*sqr(k)/epsilon`, with the fields
`k` and `epsilon` being from the current snapshot provided by the recurrence model.
Thus, the fundamental turbulent field quantities of the employed turbulence model
have to be added to the *volScalarFields* list in the `recProperties` dictionary
controlling the recurrence model. This will ensure that the turbulent field
quantities are read from the data base.
## Notes on the implementation
The base class implements the method `void setRecurrenceBasePtr(recBase*)`, which
is used to give the recurrence-based turbulence models a reference (technically
a pointer) to the recurrence model. Thus, after construction of the turbulence
models and the recurrence model, `setRecurrenceBasePtr()` needs to be called as
the pointer to the recurrence model is initialized by the constructor with `NULL`.
Trying to access the recurrence model from within the recurrence-based turbulence
model prior to setting the pointer to the recurrence model with
`setRecurrenceBasePtr()` will result in a segmentation fault.
In order to be able to call `setRecurrenceBasePtr()`, the generic reference to
the turbulence model needs to be converted into a reference of the base class'
type, i.e. `recurrenceTurbulenceModel`.
This unfortunate deviation from good standards, i.e. making full use of C++'s
polymorphism, should be the only instance of having to use non-pretty hacks.
However, apart from initialisation, i.e. setting the pointer to the recurrence
model, the recurrence-based turbulence models adhere to the generic interface of
OpenFOAM's turbulence models, and can be used as any other turbulence model.
The concrete implementations, e.g. *recurrenceKEpsilon*, use the method
`validate()` to check whether the underlying turbulent quantities are specified
for use in the data base in the *volScalarFields* list in the `recProperties`
dictionary. This method is part of the signature of the class `Foam::turbulenceModel`,
which is the very base class of all turbulence models in OpenFOAM.
In proper turbulence models, this method is used to check whether the internal
fields are properly initialized and to update all derived quantities.
In the solver, `validate()` must not be called prior to `setRecurrenceBasePtr()`,
as validate accesses the recurrence model. The wrong order of function calls will
result in a segmentation fault, as the pointer to the recurrence model is
initialized by the constructor with `NULL`.
The concrete implementations, e.g. *recurrenceKEpsilon*, use the method
`correct()` to update the turbulent field quantities from the data base,
and in turn update the derived quantities, such as `nut`.
This method is part of the signature of the class `Foam::turbulenceModel`,
which is the very base class of all turbulence models in OpenFOAM.
In proper turbulence models, this method is used to solve for the next time step.
## Compilation
Source OpenFOAM and simply compile with
```bash
./Allwclean
./Allwmake
```
The script `Allwclean` will clear all previous builds. This step is not needed for
first-time compilation. It is, however, recommended for subsequent compilations, as
it completely clears the slate. The script `Allwmake` will run the compilation for
the passive particle model.
## Required software
This model has been tested with the following versions of OpenFOAM:
* OpenFOAM-4.0
* OpenFOAM-5.0

View File

@ -0,0 +1,193 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "recurrenceKEpsilon.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
void Foam::RASModels::recurrenceKEpsilon::correctNut()
{
this->nut_ = Cmu_*sqr(k_)/epsilon_;
this->nut_.correctBoundaryConditions();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::RASModels::recurrenceKEpsilon::recurrenceKEpsilon
(
const volScalarField& alpha,
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& alphaRhoPhi,
const surfaceScalarField& phi,
const transportModel& phase,
const word& propertiesName,
const word& type
)
:
eddyViscosity<RASModel<EddyDiffusivity<phaseCompressibleTurbulenceModel>>>
(
type,
alpha,
rho,
U,
alphaRhoPhi,
phi,
phase,
propertiesName
),
recurrenceTurbulenceModel(U.group()),
Cmu_
(
dimensioned<scalar>::lookupOrAddToDict
(
"Cmu",
this->coeffDict_,
0.09
)
),
k_
(
IOobject
(
IOobject::groupName("k", U.group()),
this->runTime_.timeName(),
this->mesh_,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
this->mesh_,
dimensionedScalar("k0", dimensionSet(0,2,-2,0,0), 0.0)
),
epsilon_
(
IOobject
(
IOobject::groupName("epsilon", U.group()),
this->runTime_.timeName(),
this->mesh_,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
this->mesh_,
dimensionedScalar("eps0", dimensionSet(0,2,-3,0,0), 0.0)
)
{
if (type == typeName)
{
printCoeffs(type);
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::RASModels::recurrenceKEpsilon::~recurrenceKEpsilon()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::RASModels::recurrenceKEpsilon::read()
{
if
(
eddyViscosity<RASModel<EddyDiffusivity<phaseCompressibleTurbulenceModel>>>::read()
)
{
Cmu_.readIfPresent(this->coeffDict());
return true;
}
else
{
return false;
}
}
void Foam::RASModels::recurrenceKEpsilon::correct()
{
// update turbulence fields
recurrenceBasePtr_->recM().exportVolScalarField("k."+group_, this->k_);
recurrenceBasePtr_->recM().exportVolScalarField("epsilon."+group_, this->epsilon_);
// update nut
correctNut();
}
void Foam::RASModels::recurrenceKEpsilon::validate()
{
/*
Check whether k and epsilon are included in the dataBase.
The check only makes sure that these fields are included in the
volScalarFields list of recProperties.
Whether the fields are actually contained in the dataBase is
done by the recurrenceModel itself.
*/
bool foundK(false);
bool foundEpsilon(false);
wordList fieldNames(recurrenceBasePtr_->recM().volScalarFieldNames());
forAll(fieldNames, i)
{
word curFieldName = fieldNames[i];
if (curFieldName == k_.name())
{
foundK = true;
}
if (curFieldName == epsilon_.name())
{
foundEpsilon = true;
}
}
if (not (foundK and foundEpsilon))
{
FatalError
<< "Fields " << k_.name() << " and " << epsilon_.name()
<< " not specified in the volScalarFields list of recProperties!" << nl
<< "volScalarFields : " << fieldNames << nl
<< "Add these fields and make sure they are contained in the dataBase." << nl
<< exit(FatalError);
}
}
// ************************************************************************* //

View File

@ -0,0 +1,161 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::recurrenceKEpsilon
Description
recurrence-based kEpsilon turbulence model
This model provides kEpslion's turbulence quantities that were computed
elsewhere, i.e. taken from the recurrence dataBase.
To be used by recurrence solvers.
SourceFiles
recurrenceKEpsilon.C
\*---------------------------------------------------------------------------*/
#ifndef recurrenceKEpsilon_H
#define recurrenceKEpsilon_H
#include "RASModel.H"
#include "eddyViscosity.H"
#include "phaseCompressibleTurbulenceModel.H"
#include "EddyDiffusivity.H"
#include "recurrenceTurbulenceModel.H"
#include "autoPtr.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace RASModels
{
/*---------------------------------------------------------------------------*\
Class recurrenceKEpsilon Declaration
\*---------------------------------------------------------------------------*/
class recurrenceKEpsilon
:
public eddyViscosity<RASModel<EddyDiffusivity<phaseCompressibleTurbulenceModel>>>,
public recurrenceTurbulenceModel
{
// Private data
// Private Member Functions
//- Disallow default bitwise copy construct
recurrenceKEpsilon(const recurrenceKEpsilon&);
//- Disallow default bitwise assignment
void operator=(const recurrenceKEpsilon&);
protected:
// Protected data
// Model coefficients
dimensionedScalar Cmu_;
// Fields
volScalarField k_;
volScalarField epsilon_;
// Protected Member Functions
virtual void correctNut();
public:
//- Runtime type information
TypeName("recurrenceKEpsilon");
// Constructors
//- Construct from components
recurrenceKEpsilon
(
const volScalarField& alpha,
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& alphaRhoPhi,
const surfaceScalarField& phi,
const phaseModel& transport,
const word& propertiesName = turbulenceModel::propertiesName,
const word& type = typeName
);
//- Destructor
virtual ~recurrenceKEpsilon();
// Member Functions
//- Re-read model coefficients if they have changed
virtual bool read();
//- Return the turbulence kinetic energy
virtual tmp<volScalarField> k() const
{
return k_;
}
//- Return the turbulence kinetic energy dissipation rate
virtual tmp<volScalarField> epsilon() const
{
return epsilon_;
}
//- Update the turbulent fields
virtual void correct();
//- Check model settings
virtual void validate();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace RASModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,193 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "recurrenceKOmega.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
void Foam::RASModels::recurrenceKOmega::correctNut()
{
this->nut_ = k_/omega_;
this->nut_.correctBoundaryConditions();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::RASModels::recurrenceKOmega::recurrenceKOmega
(
const volScalarField& alpha,
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& alphaRhoPhi,
const surfaceScalarField& phi,
const transportModel& phase,
const word& propertiesName,
const word& type
)
:
eddyViscosity<RASModel<EddyDiffusivity<phaseCompressibleTurbulenceModel>>>
(
type,
alpha,
rho,
U,
alphaRhoPhi,
phi,
phase,
propertiesName
),
recurrenceTurbulenceModel(U.group()),
Cmu_
(
dimensioned<scalar>::lookupOrAddToDict
(
"Cmu",
this->coeffDict_,
0.09
)
),
k_
(
IOobject
(
IOobject::groupName("k", U.group()),
this->runTime_.timeName(),
this->mesh_,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
this->mesh_,
dimensionedScalar("k0", dimensionSet(0,2,-2,0,0), 0.0)
),
omega_
(
IOobject
(
IOobject::groupName("omega", U.group()),
this->runTime_.timeName(),
this->mesh_,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
this->mesh_,
dimensionedScalar("om0", dimensionSet(0,0,-1,0,0), 0.0)
)
{
if (type == typeName)
{
printCoeffs(type);
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::RASModels::recurrenceKOmega::~recurrenceKOmega()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::RASModels::recurrenceKOmega::read()
{
if
(
eddyViscosity<RASModel<EddyDiffusivity<phaseCompressibleTurbulenceModel>>>::read()
)
{
Cmu_.readIfPresent(this->coeffDict());
return true;
}
else
{
return false;
}
}
void Foam::RASModels::recurrenceKOmega::correct()
{
// update turbulence fields
recurrenceBasePtr_->recM().exportVolScalarField("k."+group_, this->k_);
recurrenceBasePtr_->recM().exportVolScalarField("omega."+group_, this->omega_);
// update nut
correctNut();
}
void Foam::RASModels::recurrenceKOmega::validate()
{
/*
Check whether k and omega are included in the dataBase.
The check only makes sure that these fields are included in the
volScalarFields list of recProperties.
Whether the fields are actually contained in the dataBase is
done by the recurrenceModel itself.
*/
bool foundK(false);
bool foundOmega(false);
wordList fieldNames(recurrenceBasePtr_->recM().volScalarFieldNames());
forAll(fieldNames, i)
{
word curFieldName = fieldNames[i];
if (curFieldName == k_.name())
{
Info << "Found " << k_.name()<< endl;
foundK = true;
}
if (curFieldName == omega_.name())
{
Info << "Found " << omega_.name()<< endl;
foundOmega = true;
}
}
if (not (foundK and foundOmega))
{
FatalError
<< "Fields " << k_.name() << " and " << omega_.name()
<< " not specified in the volScalarFields list of recProperties!" << nl
<< "volScalarFields : " << fieldNames << nl
<< "Add these fields and make sure they are contained in the dataBase." << nl
<< exit(FatalError);
}
}
// ************************************************************************* //

View File

@ -0,0 +1,188 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::recurrenceKOmega
Description
recurrence-based kOmega turbulence model
This model provides kOmega's turbulence quantities that were computed
elsewhere, i.e. taken from the recurrence dataBase
To be used by recurrence solvers
SourceFiles
recurrenceKOmega.C
\*---------------------------------------------------------------------------*/
#ifndef recurrenceKOmega_H
#define recurrenceKOmega_H
#include "RASModel.H"
#include "eddyViscosity.H"
#include "phaseCompressibleTurbulenceModel.H"
#include "EddyDiffusivity.H"
#include "recurrenceTurbulenceModel.H"
#include "autoPtr.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace RASModels
{
/*---------------------------------------------------------------------------*\
Class recurrenceKOmega Declaration
\*---------------------------------------------------------------------------*/
class recurrenceKOmega
:
public eddyViscosity<RASModel<EddyDiffusivity<phaseCompressibleTurbulenceModel>>>,
public recurrenceTurbulenceModel
{
// Private data
// Private Member Functions
//- Disallow default bitwise copy construct
recurrenceKOmega(const recurrenceKOmega&);
//- Disallow default bitwise assignment
void operator=(const recurrenceKOmega&);
protected:
// Protected data
// Model coefficients
dimensionedScalar Cmu_;
// Fields
volScalarField k_;
volScalarField omega_;
// Protected Member Functions
virtual void correctNut();
public:
//- Runtime type information
TypeName("recurrenceKOmega");
// Constructors
//- Construct from components
recurrenceKOmega
(
const volScalarField& alpha,
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& alphaRhoPhi,
const surfaceScalarField& phi,
const phaseModel& transport,
const word& propertiesName = turbulenceModel::propertiesName,
const word& type = typeName
);
//- Destructor
virtual ~recurrenceKOmega();
// Member Functions
//- Re-read model coefficients if they have changed
virtual bool read();
//- Return the turbulence kinetic energy
virtual tmp<volScalarField> k() const
{
return k_;
}
//- Return the turbulence specific dissipation rate
virtual tmp<volScalarField> omega() const
{
return omega_;
}
//- Return the turbulence kinetic energy dissipation rate
virtual tmp<volScalarField> epsilon() const
{
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"epsilon",
this->mesh_.time().timeName(),
this->mesh_
),
Cmu_*k_*omega_,
omega_.boundaryField().types()
)
);
}
//- Update the turbulent fields
virtual void correct();
//- Check model settings
virtual void validate();
// Setters
void setRecurrenceBasePtr(recBase* recurrenceBasePtr)
{
recurrenceBasePtr_ = recurrenceBasePtr;
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace RASModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,158 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "recurrenceSmagorinsky.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::LESModels::recurrenceSmagorinsky::k
(
const tmp<volTensorField>& gradU
) const
{
volSymmTensorField D(symm(gradU));
volScalarField a(this->Ce_/this->delta());
volScalarField b((2.0/3.0)*tr(D));
volScalarField c(2*Ck_*this->delta()*(dev(D) && D));
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
IOobject::groupName("k", this->U_.group()),
this->runTime_.timeName(),
this->mesh_
),
sqr((-b + sqrt(sqr(b) + 4*a*c))/(2*a))
)
);
}
void Foam::LESModels::recurrenceSmagorinsky::correctNut()
{
volScalarField k(this->k(fvc::grad(this->U_)));
this->nut_ = Ck_*this->delta()*sqrt(k);
this->nut_.correctBoundaryConditions();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::LESModels::recurrenceSmagorinsky::recurrenceSmagorinsky
(
const volScalarField& alpha,
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& alphaRhoPhi,
const surfaceScalarField& phi,
const transportModel& phase,
const word& propertiesName,
const word& type
)
:
LESeddyViscosity<EddyDiffusivity<phaseCompressibleTurbulenceModel>>
(
type,
alpha,
rho,
U,
alphaRhoPhi,
phi,
phase,
propertiesName
),
recurrenceTurbulenceModel(U.group()),
Ck_
(
dimensioned<scalar>::lookupOrAddToDict
(
"Ck",
this->coeffDict_,
0.094
)
)
{
if (type == typeName)
{
this->printCoeffs(type);
}
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::LESModels::recurrenceSmagorinsky::read()
{
if (LESeddyViscosity<EddyDiffusivity<phaseCompressibleTurbulenceModel>>::read())
{
Ck_.readIfPresent(this->coeffDict());
return true;
}
else
{
return false;
}
}
Foam::tmp<Foam::volScalarField> Foam::LESModels::recurrenceSmagorinsky::epsilon() const
{
volScalarField k(this->k(fvc::grad(this->U_)));
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
IOobject::groupName("epsilon", this->U_.group()),
this->runTime_.timeName(),
this->mesh_
),
this->Ce_*k*sqrt(k)/this->delta()
)
);
}
void Foam::LESModels::recurrenceSmagorinsky::correct()
{
// update nut
correctNut();
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View File

@ -0,0 +1,146 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::LESModels::recurrenceSmagorinsky
Description
The recurrenceSmagorinsky SGS model.
This model provides Smagorinsky's turbulence quantities.
To be used by recurrence solvers.
SourceFiles
recurrenceSmagorinsky.C
\*---------------------------------------------------------------------------*/
#ifndef recurrenceSmagorinsky_H
#define recurrenceSmagorinsky_H
#include "LESModel.H"
#include "LESeddyViscosity.H"
#include "phaseCompressibleTurbulenceModel.H"
#include "EddyDiffusivity.H"
#include "recurrenceTurbulenceModel.H"
#include "autoPtr.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace LESModels
{
/*---------------------------------------------------------------------------*\
Class recurrenceSmagorinsky Declaration
\*---------------------------------------------------------------------------*/
class recurrenceSmagorinsky
:
public LESeddyViscosity<EddyDiffusivity<phaseCompressibleTurbulenceModel>>,
public recurrenceTurbulenceModel
{
// Private Member Functions
// Disallow default bitwise copy construct and assignment
recurrenceSmagorinsky(const recurrenceSmagorinsky&);
void operator=(const recurrenceSmagorinsky&);
protected:
// Protected data
dimensionedScalar Ck_;
// Protected Member Functions
//- Return SGS kinetic energy
// calculated from the given velocity gradient
tmp<volScalarField> k(const tmp<volTensorField>& gradU) const;
//- Update the SGS eddy viscosity
virtual void correctNut();
public:
//- Runtime type information
TypeName("recurrenceSmagorinsky");
// Constructors
//- Construct from components
recurrenceSmagorinsky
(
const volScalarField& alpha,
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& alphaRhoPhi,
const surfaceScalarField& phi,
const phaseModel& transport,
const word& propertiesName = turbulenceModel::propertiesName,
const word& type = typeName
);
//- Destructor
virtual ~recurrenceSmagorinsky()
{}
// Member Functions
//- Read model coefficients if they have changed
virtual bool read();
//- Return SGS kinetic energy
virtual tmp<volScalarField> k() const
{
return k(fvc::grad(this->U_));
}
//- Return sub-grid disipation rate
virtual tmp<volScalarField> epsilon() const;
//- Correct Eddy-Viscosity and related properties
virtual void correct();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace LESModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,63 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "recurrenceTurbulenceModel.H"
namespace Foam
{
defineTypeNameAndDebug(recurrenceTurbulenceModel, 0);
}
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::recurrenceTurbulenceModel::recurrenceTurbulenceModel
(
const word group
)
:
recurrenceBasePtr_(NULL),
group_(group)
{
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::recurrenceTurbulenceModel::~recurrenceTurbulenceModel()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// ************************************************************************* //

View File

@ -0,0 +1,124 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::recurrenceTurbulenceModel
Description
recurrence-based turbulence model base class
This turbulence model class provides a framework for derived turbulence
models to provide turbulence quantities that were computed elsewhere,
i.e. taken from the recurrence dataBase.
A concrete recurrence-based turbulence model implementation, e.g. recurrenceKEpsilon,
needs to be derived from the base class of the original turbulence model
and this class. This class provides the link to the recurrence model. The original
base class provides the proper turbulence modelling interfaces of OpenFOAM's
turbulence modelling framework.
To be used by recurrence solvers.
SourceFiles
recurrenceTurbulenceModel.C
\*---------------------------------------------------------------------------*/
#ifndef recurrenceTurbulenceModel_H
#define recurrenceTurbulenceModel_H
#include "recBase.H"
#include "recModel.H"
#include "autoPtr.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class recurrenceTurbulenceModel Declaration
\*---------------------------------------------------------------------------*/
class recurrenceTurbulenceModel
{
// Private Member Functions
//- Disallow default bitwise copy construct
recurrenceTurbulenceModel(const recurrenceTurbulenceModel&);
//- Disallow default bitwise assignment
void operator=(const recurrenceTurbulenceModel&);
protected:
// Protected data
recBase* recurrenceBasePtr_;
const word group_;
// Protected Member Functions
public:
//- Runtime type information
TypeName("recurrenceTurbulenceModel");
// Constructors
//- Construct from components
recurrenceTurbulenceModel
(
const word group
);
//- Destructor
virtual ~recurrenceTurbulenceModel();
// Member Functions
void setRecurrenceBasePtr(recBase* recurrenceBasePtr)
{
recurrenceBasePtr_ = recurrenceBasePtr;
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,89 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "phaseCompressibleTurbulenceModel.H"
#include "addToRunTimeSelectionTable.H"
#include "makeTurbulenceModel.H"
#include "laminar.H"
#include "RASModel.H"
#include "LESModel.H"
#include "recurrenceKEpsilon.H"
#include "recurrenceKOmega.H"
#include "recurrenceSmagorinsky.H"
// Instructions for OpenFOAM-5.0
/*makeTurbulenceModelTypes
(
volScalarField,
volScalarField,
compressibleTurbulenceModel,
PhaseCompressibleTurbulenceModel,
ThermalDiffusivity,
phaseModel
);
makeTurbulenceModel
(phaseModelPhaseCompressibleTurbulenceModel, RAS, recurrenceKEpsilon);
makeTurbulenceModel
(phaseModelPhaseCompressibleTurbulenceModel, RAS, recurrenceKOmega);
makeTurbulenceModel
(phaseModelPhaseCompressibleTurbulenceModel, LES, recurrenceSmagorinsky);
*/
// Instructions for OpenFOAM-4.0
makeBaseTurbulenceModel
(
volScalarField,
volScalarField,
compressibleTurbulenceModel,
PhaseCompressibleTurbulenceModel,
ThermalDiffusivity,
phaseModel
);
#define makeRASModel(Type) \
makeTurbulenceModel \
(phaseModelPhaseCompressibleTurbulenceModel, RAS, Type)
#define makeLESModel(Type) \
makeTurbulenceModel \
(phaseModelPhaseCompressibleTurbulenceModel, LES, Type)
makeRASModel(recurrenceKEpsilon);
makeRASModel(recurrenceKOmega);
makeLESModel(recurrenceSmagorinsky);
// ************************************************************************* //

View File

@ -0,0 +1,165 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
testTwoFluidRecurrenceTurbulence
Description
A modified variant of the two-fluid, recurrence model A solver
with the extension of recurrence-based, multi-phase turbulence modelling.
This application is used to test whether turbulent fields can be provided
by the recurrence-based turbulence models.
Run this test application in a recurrence case, with turbulence enabled and
the necessary turbulent field quantities present in the data base.
Note the initialisation in checkTurbulenceModels.H
Updating the turbulence model is done by calling phaseX.correctTurbulence()
in the file readFields.H
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "twoPhaseSystem.H"
#include "phaseCompressibleTurbulenceModel.H"
#include "pimpleControl.H"
#include "localEulerDdtScheme.H"
#include "fvcSmooth.H"
#include "recBase.H"
#include "recModel.H"
#include "recurrenceTurbulenceModel.H"
/* // uncomment for OpenFOAM-5.0
namespace Foam
{
tmp<volScalarField> byDt(const volScalarField& vf)
{
if (fv::localEulerDdt::enabled(vf.mesh()))
{
return fv::localEulerDdt::localRDeltaT(vf.mesh())*vf;
}
else
{
return vf/vf.mesh().time().deltaT();
}
}
tmp<surfaceScalarField> byDt(const surfaceScalarField& sf)
{
if (fv::localEulerDdt::enabled(sf.mesh()))
{
return fv::localEulerDdt::localRDeltaTf(sf.mesh())*sf;
}
else
{
return sf/sf.mesh().time().deltaT();
}
}
}
*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
#include "postProcess.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createControl.H"
#include "createTimeControls.H"
#include "createRDeltaT.H" // remove for OpenFOAM-5.0
#include "createFields.H"
#include "createFieldRefs.H"
#include "createTransportFields.H"
if (!LTS)
{
#include "CourantNo.H"
#include "setInitialDeltaT.H"
}
Switch faceMomentum
(
pimple.dict().lookupOrDefault<Switch>("faceMomentum", false)
);
recBase recurrenceBase(mesh);
#include "checkTurbulenceModels.H"
#include "pUf/createDDtU.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting recurrence-based time loop\n" << endl;
label recTimeIndex(0);
scalar recTimeStep_=recurrenceBase.recM().recTimeStep();
while (runTime.run())
{
#include "readTimeControls.H"
#include "CourantNos.H"
#include "setDeltaT.H"
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "CEqn.H"
if ( runTime.timeOutputValue() - (recTimeIndex+1)*recTimeStep_ + 1.0e-5 > 0.0 )
{
Info << "Updating fields at run time " << runTime.timeOutputValue()
<< " corresponding to recurrence time " << (recTimeIndex+1)*recTimeStep_ << ".\n" << endl;
recurrenceBase.updateRecFields();
#include "readFields.H"
recTimeIndex++;
}
runTime.write();
#include "writeCField.H"
Info<< "ExecutionTime = "
<< runTime.elapsedCpuTime()
<< " s\n\n" << endl;
}
Info<< "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,12 @@
/* ----------------------------------------------
Write averaged particle volume fraction
---------------------------------------------- */
// essential information
Info << "Total mass :";
Info << tab << sum(C*rhoCarrier*alphaCarrier*mesh.V());
Info << endl;
Info << "Total Carrier mass :";
Info << tab << sum(rhoCarrier*alphaCarrier*mesh.V());
Info << endl;

View File

@ -9,6 +9,7 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-Wno-deprecated-copy
EXE_LIBS = \

View File

@ -0,0 +1,30 @@
#!/bin/sh
# Source run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# to be executed from one level above the source directory
if [ $# -eq 0 ]
then
sourceName="dataBase"
targetName="dataBaseCoarse"
else
sourceName=$1
targetName=$2
fi
cd $sourceName
for time in *
do
if [ $time != "system" ] && [ $time != "constant" ];
then
cd ../$targetName
echo "Found $time."
sed -i "/^startTime/c\startTime \t$time;" ./system/controlDict
grep 'startTime' ./system/controlDict
mapFields ../$sourceName -sourceTime $time -consistent
cd ../$sourceName
fi
done

View File

@ -0,0 +1,39 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object mirrorProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//===========================================================================//
// sub-models & settings
refPoint (0 0 0);
refDirection (1 0 0);
fieldName U;
dataBaseName dataBase;
// ************************************************************************* //

View File

@ -0,0 +1,3 @@
rBaseMirrorScalar.C
EXE=$(CFDEM_APP_DIR)/rBaseMirrorScalar

View File

@ -0,0 +1,17 @@
include $(CFDEM_ADD_LIBS_DIR)/additionalLibs
EXE_INC = \
$(PFLAGS) \
-I$(LIB_SRC)/finiteVolume/cfdTools \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/fvOptions/lnInclude \
-Wno-deprecated-copy
EXE_LIBS = \
-lfiniteVolume \
-lmeshTools \
-lsampling \
-lfvOptions

View File

@ -0,0 +1,17 @@
IOdictionary mirrorProperties
(
IOobject
(
"mirrorProperties",
mesh.time().constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
vector refPoint(mirrorProperties.lookup("refPoint"));
vector refDirection(mirrorProperties.lookup("refDirection"));
word fieldName(mirrorProperties.lookup("fieldName"));
word dataBaseName(mirrorProperties.lookup("dataBaseName"));

View File

@ -0,0 +1,136 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Application
rBaseMirror
Description
Read time series and extend it by mirrored fields if geometry possesses
the same symmetry
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
argList::noParallel();
timeSelector::addOptions();
#include "setRootCase.H"
#include "createTime.H"
// read in start and end time from controlDict
scalar startTime=runTime.startTime().value();
scalar endTime=runTime.endTime().value();
scalar origTimeRange = endTime - startTime;
Info << "start time = " << runTime.startTime() << endl;
Info << "end time = " << runTime.endTime() << endl;
// check which time directories are present
// instantList timeDirs = timeSelector::select0(runTime, args);
// runTime.setTime(timeDirs[0], 0);
#include "createMesh.H"
#include "createFields.H"
Foam::Time recTime(fileName(dataBaseName), "", "../system", "../constant", false);
instantList timeDirs(recTime.times());
recTime.setTime(timeDirs[0],0);
#include "readFields.H"
Info << fieldName << endl;
volScalarField transformedField = origField;
scalar t;
label shiftedTimeI = 0;
// check number of time directories
label shift = 0;
forAll(timeDirs, timeI)
{
if (recTime.timeName() == "constant") continue;
recTime.setTime(timeDirs[timeI], timeI);
t = recTime.value();
if(t < startTime) continue;
if(t > endTime) continue;
shift++;
}
scalar dt = origTimeRange / (shift - 1.0);
recTime.setEndTime(startTime + 2 * origTimeRange + dt);
label cellI_transformed = -1;
forAll(timeDirs, timeI)
{
recTime.setTime(timeDirs[timeI], timeI);
t = recTime.value();
if(t < startTime) continue;
if(t > endTime) continue;
Info << "time = " << t << ", time index = " << timeI << endl;
#include "readFields.H"
forAll(transformedField, cellI)
{
vector position = mesh.C()[cellI];
vector transformedPosition = 2 * ((refPoint - position) & refDirection) * refDirection / (refDirection & refDirection) + position;
cellI_transformed = mesh.findCell(transformedPosition);
if(cellI_transformed < 0)
{
Info << "Couldn't find transformed cell. Stopping." << endl;
return 0;
}
scalar value = origField[cellI_transformed];
scalar transformedValue = value;
transformedField[cellI] = transformedValue;
}
shiftedTimeI = timeI + shift;
t = recTime.value() + origTimeRange + dt;
runTime.setTime(t, shiftedTimeI);
Info << "creating transformed fields for time = " << t << ", time index = " << shiftedTimeI << endl;
transformedField.write();
}
Info << "\nEnd" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,13 @@
volScalarField origField
(
IOobject
(
fieldName,
recTime.timePath(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
),
mesh
);

View File

@ -0,0 +1,3 @@
rBaseMirrorVec.C
EXE=$(CFDEM_APP_DIR)/rBaseMirrorVec

View File

@ -0,0 +1,17 @@
include $(CFDEM_ADD_LIBS_DIR)/additionalLibs
EXE_INC = \
$(PFLAGS) \
-I$(LIB_SRC)/finiteVolume/cfdTools \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/fvOptions/lnInclude \
-Wno-deprecated-copy
EXE_LIBS = \
-lfiniteVolume \
-lmeshTools \
-lsampling \
-lfvOptions

View File

@ -0,0 +1,17 @@
IOdictionary mirrorProperties
(
IOobject
(
"mirrorProperties",
mesh.time().constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
vector refPoint(mirrorProperties.lookup("refPoint"));
vector refDirection(mirrorProperties.lookup("refDirection"));
word fieldName(mirrorProperties.lookup("fieldName"));
word dataBaseName(mirrorProperties.lookup("dataBaseName"));

View File

@ -0,0 +1,134 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Application
rBaseMirror
Description
Read time series and extend it by mirrored fields if geometry possesses
the same symmetry
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
argList::noParallel();
timeSelector::addOptions();
#include "setRootCase.H"
#include "createTime.H"
// read in start and end time from controlDict
scalar startTime=runTime.startTime().value();
scalar endTime=runTime.endTime().value();
scalar origTimeRange = endTime - startTime;
Info << "start time = " << runTime.startTime() << endl;
Info << "end time = " << runTime.endTime() << endl;
// check which time directories are present
//instantList timeDirs = timeSelector::select0(runTime, args);
//runTime.setTime(timeDirs[0], 0);
#include "createMesh.H"
#include "createFields.H"
Foam::Time recTime(fileName(dataBaseName), "", "../system", "../constant", false);
instantList timeDirs(recTime.times());
recTime.setTime(timeDirs[0],0);
#include "readFields.H"
Info << fieldName << endl;
volVectorField transformedField = origField;
scalar t;
label shiftedTimeI = 0;
// check number of time directories
label shift = 0;
forAll(timeDirs, timeI)
{
if (recTime.timeName() == "constant") continue;
recTime.setTime(timeDirs[timeI], timeI);
t = recTime.value();
if(t < startTime) continue;
if(t > endTime) continue;
shift++;
}
scalar dt = origTimeRange / (shift - 1.0);
recTime.setEndTime(startTime + 2 * origTimeRange + dt);
label cellI_transformed = -1;
forAll(timeDirs, timeI)
{
recTime.setTime(timeDirs[timeI], timeI);
t = recTime.value();
if(t < startTime) continue;
if(t > endTime) continue;
Info << "time = " << t << ", time index = " << timeI << endl;
#include "readFields.H"
forAll(transformedField, cellI)
{
vector position = mesh.C()[cellI];
vector transformedPosition = 2 * ((refPoint - position) & refDirection) * refDirection / (refDirection & refDirection) + position;
cellI_transformed = mesh.findCell(transformedPosition);
if(cellI_transformed < 0)
{
Info << "Couldn't find transformed cell. Stopping." << endl;
return 0;
}
vector value = origField[cellI_transformed];
vector transformedValue = -2 * (value & refDirection) * refDirection / (refDirection & refDirection) + value;
transformedField[cellI] = transformedValue;
}
shiftedTimeI = timeI + shift;
t = recTime.value() + origTimeRange + dt;
runTime.setTime(t, shiftedTimeI);
Info << "creating transformed fields for time = " << t << ", time index = " << shiftedTimeI << endl;
transformedField.write();
}
Info << "\nEnd" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,14 @@
volVectorField origField
(
IOobject
(
fieldName,
recTime.timePath(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
),
mesh
);

View File

@ -0,0 +1,3 @@
rSmoother.C
EXE=$(CFDEM_APP_DIR)/rSmoother

View File

@ -0,0 +1,19 @@
include $(CFDEM_ADD_LIBS_DIR)/additionalLibs
EXE_INC = \
-I$(CFDEM_OFVERSION_DIR) \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(CFDEM_SRC_DIR)/recurrence/lnInclude \
-Wno-deprecated-copy
EXE_LIBS = \
-L$(CFDEM_LIB_DIR)\
-lrecurrence \
-lfiniteVolume \
-lmeshTools \
-l$(CFDEM_LIB_NAME) \
$(CFDEM_ADD_LIB_PATHS) \
-lsampling \
-lfvOptions \
$(CFDEM_ADD_LIBS)

View File

@ -0,0 +1,28 @@
IOdictionary recProperties
(
IOobject
(
"recProperties",
mesh.time().constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
scalar threshold(readScalar(recProperties.lookup("threshold")));
volVectorField U_smooth
(
IOobject
(
"U_smooth",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedVector("zero", dimensionSet(0,1,-1,0,0,0,0), vector(0.0, 0.0, 0.0))
);

View File

@ -0,0 +1,90 @@
/*---------------------------------------------------------------------------*\
CFDEMcoupling academic - Open Source CFD-DEM coupling
Contributing authors:
Thomas Lichtenegger
Copyright (C) 2015- Johannes Kepler University, Linz
-------------------------------------------------------------------------------
License
This file is part of CFDEMcoupling academic.
CFDEMcoupling academic is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
CFDEMcoupling academic is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with CFDEMcoupling academic. If not, see <http://www.gnu.org/licenses/>.
Application
rSmoother
Description
Loops over all recurrence times and averages fields over given similarity range
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "fvOptions.H"
#include "recBase.H"
#include "recModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
#include "postProcess.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createControl.H"
#include "createFields.H"
recBase recurrenceBase(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// set time step to that of recurrence database
runTime.setDeltaT(recurrenceBase.recM().recTimeStep());
// check start and end time
if (abs(runTime.startTime().value() - recurrenceBase.recM().recStartTime()) > 1e-5)
{
Info << "Stopping. Start time and database start time are different." << endl;
Info << "Start time = " << runTime.startTime().value() << endl;
Info << "Database start time = " << recurrenceBase.recM().recStartTime() << endl;
return 0;
}
if (runTime.endTime().value() > recurrenceBase.recM().recEndTime())
{
runTime.setEndTime(recurrenceBase.recM().recEndTime());
Info << "End time set to database end time." << endl;
}
label index = -1;
Info << "\nSmoothing recurrence statistics\n" << endl;
while (runTime.run())
{
// runtime can't be larger than recurrence database size
index = runTime.timeIndex();
#include "updateFields.H"
runTime++;
}
Info << "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,4 @@
Info << "averaging fields for time = " << runTime.value() << ", time index = " << index << endl;
recurrenceBase.recM().exportAveragedVolVectorField(U_smooth, "UMean", threshold, index);
U_smooth.write();

Some files were not shown because too many files have changed in this diff Show More