249 Commits
18.10 ... 19.09

Author SHA1 Message Date
e3765ec50d Merge pull request #93 from ParticulateFlow/release
Release 19.09
2019-09-26 17:08:15 +02:00
2292493e35 increase runtime of test case 2019-09-26 15:44:30 +02:00
ba35af963a fix probe location 2019-09-26 15:13:28 +02:00
5bf3402415 write DEM data to DEM/post folder 2019-09-26 13:01:04 +02:00
29afb0e920 fix up probe locations in chemistry tutorials 2019-09-26 12:38:43 +02:00
b24acc76fa fix up thermo_temp settings
- set dynamic to 'no' as number of particles does not change
- for a single particle set 'extra' dof to 0 to obtain correct ke
2019-09-26 09:51:11 +02:00
6d69a6effe [DOC] adjust breadcrumbs.html
link to cfdem website instead of lammps
remove quick-link that only exists in LIGGGHTS/LAMMPS
2019-09-25 17:45:44 +02:00
c79226da68 [DOC] add missing theme files 2019-09-25 09:13:53 +02:00
4c25d64af6 define probes directly in controlDict
test harness is not yet prepared to handle '#include' properly or read
probes from probesDict
2019-09-24 17:50:44 +02:00
f4b62ab0e0 fix typos in liggghts input scripts 2019-09-24 16:04:18 +02:00
fd26c2cb88 update testharness run configurations
remove post_scripts that we currently don't need for testing
2019-09-24 16:03:45 +02:00
7ce1c7d7be bump version number to 19.09 2019-09-20 13:22:45 +02:00
24f7273e75 Merge pull request #79 from ParticulateFlow/feature/cfdemSolverRhoPimple
feature/cfdemRhoPimpleChem
2019-09-19 17:02:04 +02:00
4ac94e82c7 fix up Allclean.sh scripts [ci skip]
note that #!/bin/sh may invoke a different shell than #!/bin/bash
2019-09-19 16:40:07 +02:00
e452aa7929 clean up parCFDDEMrun.sh files
perform clean up via Allclean.sh scripts
2019-09-19 16:38:12 +02:00
75f132450f use different controlDict for test harness runs
original case runtime is too long for test harness execution
2019-09-19 15:48:05 +02:00
838e0851b1 adjust case decomposition 2019-09-19 15:45:44 +02:00
6da1afb450 add execution of DEM init script to Allrun.sh 2019-09-19 15:45:28 +02:00
069aaed120 ignore temporary files from VIM [ci skip] 2019-09-19 13:52:54 +02:00
4cb4132cf0 remove temporary file [ci skip] 2019-09-19 13:47:43 +02:00
ef43a2b5e4 replace $casePath/CFD with $FOAM_CASE [ci skip] 2019-09-19 13:33:34 +02:00
be0fee8938 clean up whitespaces and comments 2019-09-19 13:32:58 +02:00
a31e6b0f86 delete temporary files 2019-09-19 13:30:16 +02:00
04c77886e8 fix test harness run configuration 2019-09-19 13:29:33 +02:00
35bb6ba7eb replace $casePath/CFD with $FOAM_CASE [ci skip] 2019-09-19 12:30:24 +02:00
b4a3c358ff fix test harness run configurations 2019-09-19 12:29:23 +02:00
a854a89116 clean up whitespaces and comments 2019-09-19 12:28:50 +02:00
faba96f750 delete temporary files 2019-09-19 12:24:33 +02:00
d5b12a5e30 delete temporary file and clean up whitespaces 2019-09-19 12:24:02 +02:00
0c1ddfb0cc clean up whitespaces 2019-09-19 12:12:50 +02:00
e37d3b4e7e fix test harness run configuration [ci skip] 2019-09-19 09:42:57 +02:00
a26052a8b7 replace $casePath/CFD with $FOAM_CASE 2019-09-19 09:41:06 +02:00
16700acdc1 adjust file permissions and clean up comments [ci skip] 2019-09-19 09:38:01 +02:00
7b00b7efed clean up whitespaces and comments 2019-09-19 09:32:01 +02:00
e06741a47d add required folder structure for DEM dump and restart files 2019-09-19 09:13:52 +02:00
6b1c2d76f1 add .sh file extension to Allclean scripts 2019-09-19 09:09:12 +02:00
ad34ba0efe clean up some tutorial files [ci skip] 2019-09-18 21:15:31 +02:00
5d0ec35256 fix testharness run.config 2019-09-18 21:10:13 +02:00
4531711ed8 clean up whitespaces 2019-09-18 21:06:16 +02:00
7fb0161ca8 Add tutorial case for polydisperse R2 reaction with inert Quartz particles 2019-09-18 17:51:18 +02:00
df71bf5522 Remove obsolete tutorial case 2019-09-18 17:48:19 +02:00
f3135c083e change fix densities to global in the tutorials. 2019-09-18 17:28:38 +02:00
14b64ef281 Move the ISO4695 Case into the SingleParticleCases folder 2019-09-18 16:43:56 +02:00
939429d341 Add Case for GOD0k1 2019-09-18 16:43:11 +02:00
fbea5be83a Add Case for GOD 0k1 33CO3 H2..
..that works with the latest version of LIGGGHTS and CFDEMcoupling
2019-09-18 16:42:14 +02:00
4da9233db2 Modify Case for GOD0k1 30CO6H2
..updated it to the latest version of LIGGGHTS and CFDEMcoupling.
2019-09-18 16:40:03 +02:00
f80785c116 Remove ISO4695 case from tutorials to be added under subfolder
SingleParticleCases
2019-09-18 16:35:24 +02:00
b518d6df84 Hematite Reduction Tutorial for Standardized ISO Conditions ISO4695 2019-09-16 16:25:48 +02:00
42329ae7b9 Fix typo in README.md [ci skip] 2019-09-02 11:47:57 +02:00
04ecb57c16 update input script due to internal changes [ci skip]
the relevant settings have been moved to internal fixes managed by fix
chem/shrink/core
2019-08-14 17:28:21 +02:00
2cb102fee3 remove outdated fix parameter 2019-08-14 17:05:21 +02:00
2e10933575 clean up some formatting [ci skip] 2019-08-14 16:21:40 +02:00
3ce4d419ca remove superfluous semicolon 2019-08-14 16:09:07 +02:00
acfe33cc50 simplify construction of list 2019-08-14 16:08:22 +02:00
ad3ccf0359 eliminate temporary variables and fix interpolation_ branch
Xfluid_ was uninitialized with interpolation on
there is probably not much to be gained from temporary variables here
2019-08-14 16:07:29 +02:00
110fba695a remove unnecessary temporary variable
MixtureBinaryDiffusion_ is not used for anything else
2019-08-14 15:48:47 +02:00
704ac32a23 clean up some foramtting [ci skip] 2019-08-14 15:15:39 +02:00
c89d46f633 fix setting of molar fractions in species.C
Xfluid ended up uninitialized if interpolation was on (causing
molarFractions_ to receive uninitialzed values) or no particles were
found in partition (output to Info was uninitialzed)
2019-08-14 15:03:52 +02:00
da0c33b2cb remove some fields from probes [ci skip] 2019-08-12 13:40:59 +02:00
b381009d4b add probes name [ci skip]
test harness expects name field
2019-08-12 12:55:34 +02:00
b4e891bdd9 move probe definitions to controlDict
until testharness properly supports #include directives
2019-08-12 12:15:14 +02:00
89c6f87e0c display info only if verbose is true [ci skip] 2019-08-09 16:20:17 +02:00
4f8d2dc676 replace $casePath/CFD with $FOAM_CASE 2019-08-09 16:09:21 +02:00
d5f331c831 testharnes does not yet support #include directives in OF dictionaries 2019-08-09 15:37:07 +02:00
8b74c167be fix test harness run configuration [ci skip] 2019-08-09 15:01:12 +02:00
a58098cc97 adapt settings for test harness [ci skip] 2019-08-09 13:19:10 +02:00
bb65be3c6b make parallel decomposition more flexible 2019-08-09 12:57:59 +02:00
5d402bb4f9 write output into post folder [ci skip] 2019-08-09 12:54:08 +02:00
5d606017dc update deprecated Foam settings [ci skip] 2019-08-09 12:51:22 +02:00
d67d861f6f fix up poperty/atom name in Spreitzer chemistry tutorial [ci skip] 2019-08-08 17:42:32 +02:00
ba3f79095e clean up whitespaces [ci skip] 2019-08-08 17:12:22 +02:00
204363744e fix single particle chemistry tutorial [ci skip] 2019-08-08 17:11:26 +02:00
299a24fe4f fix OpenFOAM init files
at least my installed version of OpenFOAM (tag version-4.0) does not
accept pure double values as type
2019-08-08 14:31:37 +02:00
7c48f9b20c add post and restart folders to chemistry tutorials 2019-08-08 14:13:24 +02:00
26099f72b1 correct solver name and # of processors in run.config [ci skip] 2019-08-08 13:45:08 +02:00
f9a638e291 clean up some tutorial files [ci skip] 2019-08-08 13:43:49 +02:00
6f9af416bb replace misleading comments [ci skip] 2019-08-08 13:26:21 +02:00
e765bc4eb2 remove periodicity info from dumps
boundaries are fixed, thus periodicity does not give any useful
information
2019-08-08 13:19:21 +02:00
cde5d933e7 clean up some tutorial files [ci skip] 2019-08-08 13:10:13 +02:00
b777ae6e9b clean up whitespaces and comments [ci skip] 2019-08-08 12:34:16 +02:00
a35e0dac09 correct solver name in run.config 2019-08-08 11:06:24 +02:00
bb2aa55fdf add .sh file extension to Allclean script 2019-08-08 11:05:50 +02:00
85b116eeb2 remove unneeded creation of temporary string object [ci skip]
can be assigned as is
2019-08-08 10:41:27 +02:00
889f44803d Merge pull request #92 from ParticulateFlow/feature/timestepfraction
Feature/timestepfraction
2019-08-08 10:32:54 +02:00
7bb266bc41 clamp tsf between 0 and 1
the time step fraction should never be outside these bounds since we
don't allow variable time steps; hence any value outside these bounds
must come from numerical rounding/precision issues;
by doing this we no longer need the check in cfdemCloud
2019-07-26 16:59:56 +02:00
d4bb711e9c replace time().deltaT().value() by time().deltaTValue()
avoid creation of temporary dimensionedScalar that is not needed
2019-07-26 16:31:54 +02:00
62489f3165 try to increase precision of tsf calculation
cf. CFDEMcoupling-PUBLIC
2019-07-26 16:29:22 +02:00
efec037d6b fix up comments [ci skip] 2019-07-26 16:17:38 +02:00
d3d7d07cdb increase precision of time step fraction output [ci skip] 2019-07-26 16:11:09 +02:00
b462327d2d apply some formatting changes [ci skip] 2019-07-26 15:59:04 +02:00
de8c0c0e39 Merge pull request #91 from ParticulateFlow/bugfix/beetstraDrag-cg
Fix beetstra drag for coarse-grained cases
2019-05-20 17:04:49 +02:00
29b7ae5ff9 make typeCG mutable (b/c setForce is const). 2019-05-16 11:09:03 +02:00
b64dfacc33 fix problem introduced with e9a7a0f15a that causes drag to be severely underestimated when a cg factor directly from liggghts is used. 2019-05-16 10:15:23 +02:00
31b3aa939e [DOC] fix links in README.md 2019-04-25 13:37:08 +02:00
e68f20c63d Merge pull request #86 from ParticulateFlow/master
update README.md
2019-04-03 20:56:23 +02:00
d98d72319a update README.md [ci skip] 2019-04-03 19:02:06 +02:00
645481215d Merge pull request #85 from ParticulateFlow/develop
add configuration file for CircleCI
2019-04-03 18:58:03 +02:00
d9c846caab add configuration file for CircleCI
use ubuntu trusty environment
use openfoam4 package provided by openfoam.org
build only master and develop
2019-04-03 18:16:29 +02:00
9061d95e2a Update and rename README to README.md 2019-04-03 18:11:23 +02:00
cc48c0b36c Create LICENSE 2019-04-03 18:08:58 +02:00
8dd994c4a0 Merge pull request #81 from ParticulateFlow/master
Merge changes from release 19.02
2019-02-22 17:19:11 +01:00
8625396bea Merge pull request #80 from ParticulateFlow/release
Release 19.02
2019-02-22 15:57:02 +01:00
3d186d3dcd Merge with develop resolve and resolve conflicts 2019-02-21 15:35:30 +01:00
e52b1028a2 add dSauter field read 2019-02-21 15:29:32 +01:00
ec095a490c bump version number to 19.02 2019-02-21 15:05:54 +01:00
c441753ff9 clean up whitespaces
no tabs, no extra whitespaces!
2019-02-21 14:53:31 +01:00
c8eb21bedc clean up whitespaces
no tabs, no extra whitespaces!
2019-02-21 14:45:03 +01:00
77b8d587a1 clean up whitespaces 2019-02-21 14:32:14 +01:00
750dc74ce9 [DOC] fix minor typos 2019-02-21 14:26:56 +01:00
dfac4df0a9 [DOC] clean up 2019-02-21 14:06:04 +01:00
209fc5c78f clean up whitespaces 2019-02-21 14:05:36 +01:00
cd3bc3874a [DOC] update chemistry model documentation 2019-02-21 13:39:23 +01:00
edd77aa751 clean up whitespaces 2019-02-21 13:02:35 +01:00
73015cffde [DOC] add minimal description of solvers
provisional documentation, needs to be extended
2019-02-21 10:57:21 +01:00
3275a87e05 [DOC] fix formatting in documentation of one2one data exchange model 2019-02-21 10:55:09 +01:00
809519f937 [DOC] add link to one2one data exchange model documentation 2019-02-21 10:54:21 +01:00
581fae739b Fix application name and description of cfdemSolverRhoSimple 2019-02-21 10:40:52 +01:00
696d73b10b clean up whitespaces 2019-02-20 15:02:49 +01:00
5665e75005 clean up whitespaces 2019-02-20 14:47:42 +01:00
5bb94b9695 use spaces not tabs 2019-02-20 14:19:42 +01:00
94d7ef5b78 add verbose switch to check reactionHeat per particle 2019-01-10 15:35:51 +01:00
c28b2418b2 add volScalarField dSauter 2019-01-07 17:13:45 +01:00
5b4ec1f67e Merge branch 'develop' into feature/cfdemSolverRhoPimple
Previous merge didn't pull from latest rep, merge again with
origin/develop branch.
Fix conflicts in heatTransferGunn, now using multiType for
coarseGraining, EEqn (using Tref for thermodynamic data)
Update rest without conflicts.
2019-01-07 16:10:50 +01:00
8edf5ac409 Merge remote-tracking branch 'origin/develop' into feature/cfdemSolverRhoPimple 2019-01-07 15:27:36 +01:00
2f0a2854a4 Debug information output 2019-01-07 15:15:41 +01:00
04445e0797 Uncomment mass sources 2019-01-07 15:14:55 +01:00
a285c98082 Info outpute order change 2019-01-07 15:14:29 +01:00
8ec17ce965 Merge branch 'develop' of https://github.com/ParticulateFlow/CFDEMcoupling into develop 2019-01-03 14:14:10 +01:00
ebdc5253e6 HeattransferGunn with coarse graining for several types and parcels. 2019-01-03 14:13:27 +01:00
fa1c3dcae9 Merge pull request #76 from ParticulateFlow/feature/o2o
One-to-one communication (few-to-few?)
2018-12-05 07:55:37 +01:00
c3534493b6 Adapt o2o to untangling of getCG() by @danielque 2018-12-04 15:08:34 +01:00
46e58f4e7d Merge pull request #78 from ParticulateFlow/bugfix/implicit_heattransfer
Bugfix/implicit heattransfer: Respect thermodynamic reference temperature (resolves #77)
2018-12-04 10:02:19 +01:00
66e0fc59e8 add scale factor for coarse graining 2018-11-27 10:09:07 +01:00
930b2a4158 bugfix: correct explicit part of heat source term for different thermodynamic temperature when using "sophisticated" thermodynamic models like JANAF. 2018-11-26 17:18:12 +01:00
51d10d7d0f remove superfluous method getNumberOfParticles. 2018-11-16 16:04:42 +01:00
e589f3876a remove dependency on duplicated library_cfd_coupling_one2one.* 2018-11-16 15:50:48 +01:00
fb63f86bec improve constness of setters in dataExchangeModel. 2018-11-16 15:21:58 +01:00
487f3f9614 pass label by ref rather than copying it. 2018-11-16 15:18:14 +01:00
4959ffc79f include suggestions by @danielque. 2018-11-16 15:15:31 +01:00
a68a15272b improve constness. 2018-11-16 10:25:34 +01:00
717b95ab0b add warning description to docu for O2O. 2018-11-16 10:21:39 +01:00
191d1b84a0 make merge from develop compile. 2018-11-16 10:21:01 +01:00
5e444722c9 extend documentation. cellIdComm is not mentioned on purpose, since no case with performance gains from it has been found so far. 2018-11-13 10:55:28 +01:00
27708dd9b7 Merge branch 'develop' into feature/o2o 2018-11-13 10:47:50 +01:00
eab214a0c4 No mass source changes for testing purposes 2018-11-08 16:09:04 +01:00
52709a1537 Give out information about Temperature 2018-11-08 16:08:36 +01:00
2c476432c9 remove the need for createFieldRefs 2018-11-08 16:08:02 +01:00
e9a3b544c0 Revert to implicit 2018-11-08 16:07:31 +01:00
bd444010bc Add info output about heat source and specific heat 2018-11-08 16:06:56 +01:00
15c9edf336 Merge pull request #75 from ParticulateFlow/feature/OF4x-multiphase
Feature/of4x multiphase
2018-10-23 09:59:41 +02:00
bd17bf0e49 Update the copyright info in surfaceTensionForce files 2018-10-16 09:19:54 +02:00
b5d5b56824 [DOC] fix up and add links to new documentation 2018-10-15 10:33:19 +02:00
f2f3230de0 clean up shell script files 2018-10-15 10:02:06 +02:00
1c44a3a09f remove bottleneck in locating particles by using appropriate container for cell ids. 2018-10-13 13:35:35 +02:00
62fe28535c add prerun scripts for testharness runs of cfdemSolverMultiphase 2018-10-12 16:36:09 +02:00
908de24636 add prerun script to damBreak case
prerun script for testharness
2018-10-12 14:39:33 +02:00
953cdb5b8b renaming to avoid same nameing 2018-10-12 12:08:14 +02:00
b841abd46f Remove implicit term,
add information outputs for Qsource/coeff and Cpv
2018-10-12 12:07:16 +02:00
3858931124 Updated documentation 2018-10-12 10:32:06 +02:00
4acd0de949 Added documentation for surfaceTensionForce force model 2018-10-12 10:31:46 +02:00
eaa11b4781 Added option for arbitrary field name in surfaceTensionForce 2018-10-12 10:31:05 +02:00
50af8d451f Remove html files from doc 2018-10-11 16:11:40 +02:00
e2b1a2fa9f Untrack files that should not be tracked 2018-10-11 15:57:45 +02:00
0058f1af36 Update temporalSmoothing documentation 2018-10-11 15:06:49 +02:00
1202f655d7 Removed init of small_scale_hearth_drainage tutorial case 2018-10-11 15:06:23 +02:00
542261bbf8 Change notation in temporal smoothing model 2018-10-11 13:37:29 +02:00
dfd665c15f Update tutorial cases 2018-10-11 13:36:10 +02:00
146e783415 Merge 'develop' into feature/OF4x-multiphase 2018-10-11 13:10:33 +02:00
64512450a7 Merge pull request #74 from ParticulateFlow/master
Update from master
2018-10-09 13:31:39 +02:00
56a16fee98 Single Particle Hematite Reduction Tutorial Case
incoming gas is 30% CO 4% CO2 6% H2.
2018-09-14 10:34:04 +02:00
8c819e4d1d Tutorial Case Magnetite - Wustite...
iron-oxide reduction in fludized beds, for the reaction magnetite-
wustite. No heat-transfer models active, coarse-grained, Temp is limited
to 2000 Kelvin. Hematite is considered to be completely reacted, minimum
radius size is entered. Works as intended.
2018-09-14 10:28:21 +02:00
ec0f4f29ce Remove limitation for molar fraction 2018-09-14 10:23:52 +02:00
02800f51a9 Revert previous fix for mass source term 2018-08-14 12:39:55 +02:00
f523116c41 Change naming of changed species mass fields for better evaluation,
get data in data exchange models was missing an argument. Fixed the mass
source term received from DEM side.
2018-08-14 11:01:46 +02:00
80ddfcd6aa Give info about reactantPerParticle if verbose. 2018-08-14 10:35:08 +02:00
1b4a41a319 make fvOptions work in cfdemSolverPiso. 2018-08-06 15:56:11 +02:00
3fb47021be Reallocate the arrays even if particle number doesn't change,
without reallocation, the fields can cause MPI problems.
2018-07-27 10:50:07 +02:00
46803bf5c7 Remove unnecessary field calculations and interpolations...
rho and molar concentration was used for debugging, they are not being
communicated with DEM and not used within the model thus removed.
2018-07-24 12:05:34 +02:00
9dbf342629 Get diffusant fields directly from volScalarFields..
instead of equalizing it to species fields. Change indexing for
continuity, and cleanup of old code.
2018-07-16 14:01:44 +02:00
93b2c11874 fixed no chemistry model 2018-07-11 14:44:48 +02:00
8d0661d83e Merge branch 'develop' into feature/o2o 2018-07-02 10:44:40 +02:00
3f98108ab8 correctly destroy prev_cell_ids as suggested by @danielque. 2018-06-20 09:53:33 +02:00
a7bd3191a2 fix memory leak. 2018-06-19 15:39:42 +02:00
070fcbe15c communicate particle cell ids to liggghts and back.
this allows for use of a turboEngine-like locate section
with an initial guess for the cell.

to use this, add a
`fix             prev_cell_ids all property/atom prev_cell_ids scalar no
no no -1`
to the liggghts run script and set `useCellIdComm yes` in the
twoWayOne2OneProps section of the couplingProperties.

a check whether the particle is contained in the bounding box
of the domain is added regardless of the setting.
2018-06-19 12:45:46 +02:00
29bf7f59ce ignore vscode project dirs. 2018-04-25 10:09:32 +02:00
5050ae1b5f change position of debug output. 2018-04-05 16:15:50 +02:00
278087b021 copy on-proc info rather than sending it via MPI. 2018-04-05 15:07:25 +02:00
072e11134a use safer way of offsetting in arrays. 2018-04-05 14:42:57 +02:00
f4ae35eb88 send only when there is data to be sent. receive only when there is data to be received and only wait when you actually have something to receive. 2018-03-29 19:05:06 +02:00
0aa38589a3 add more verbosity. 2018-03-29 18:59:55 +02:00
ec8220c63b Remove more unnecessary output 2018-03-29 16:11:51 +02:00
3bd79f999b Set modeltype also when #include modeltype is executed in if statement. Create additionalChecks file for solver specific checks prior to simulation. 2018-03-29 15:16:01 +02:00
a1cfbdb958 Remove unnecessary output 2018-03-29 10:22:22 +02:00
afe1257367 Remove accidental random letter 2018-03-28 16:25:25 +02:00
5a1dcb4048 Added option to skip checkModelType, can be useful to in some cases use Archimedes instead of gradPForce for stability reasons, which would generate an error otherwise 2018-03-28 14:27:27 +02:00
bc4f7254da Remove call to particleCloud for viscous term, dimension issue with modelType B because of the use of incompressible turbulence models 2018-03-28 14:09:45 +02:00
31b2e8d161 Missing comma added 2018-03-28 13:41:19 +02:00
f16ff451e8 Update license part of the files 2018-03-28 13:38:25 +02:00
d1c115896f Add documentation for cfdemSolverMultiphase 2018-03-27 12:49:41 +02:00
9ad296a5e1 Add documentation for gradPForceSmooth 2018-03-27 12:49:20 +02:00
ee5150bb8a Added documentation for temporalSmoothing smoothing model 2018-03-27 10:28:05 +02:00
b540ddcde4 Throw error if temporalSmoothing is selected in couplingProperties 2018-03-27 10:27:10 +02:00
67b7607a79 Update variable names to be consistent with paper + cleanup 2018-03-27 10:26:20 +02:00
e20fe0ab91 Remove MRF from createFields 2018-03-26 13:10:17 +02:00
9d036344a6 Cleanup pEqn 2018-03-26 12:48:58 +02:00
b825513094 Added support for modelType B and Bfull 2018-03-26 12:37:37 +02:00
b80fb7a9c7 Removed maxAlphaCo because it's only used in adjustable time step 2018-03-22 14:18:59 +01:00
e38cc7e2ab Reinstate checkModelType and allow gradPForceSmooth to be used instead of gradPForce 2018-03-22 13:44:19 +01:00
0c7a77c582 Add warning if ddt(voidfraction) is ignored 2018-03-22 12:37:02 +01:00
9230212797 Reinstate ddt(voidfraction) from particle cloud and reformulate phiS 2018-03-22 12:36:23 +01:00
0b365aa6a5 Minor change, move rhoPhi and cleanup 2018-03-22 10:39:41 +01:00
9953a3af76 Added support for fvOptions and removed unsupported MRF stuff 2018-03-22 10:30:17 +01:00
e5bc651a5d added docu for one2one. 2018-03-15 14:47:36 +01:00
ae268bf137 added documentation for engineSearchMany2Many. 2018-03-14 16:40:52 +01:00
6e5bdc2bbd option for using a static processor map added. 2018-03-14 16:13:24 +01:00
fb448affa3 scatter located particle ids among receiving procs. 2018-03-14 13:15:27 +01:00
318469aa26 use total number of particles instead of maxtag. 2018-03-14 13:14:15 +01:00
e2f74d2892 do not free the comm on destruction. 2018-03-14 11:04:36 +01:00
e1472f5ed3 moved procmap creation temporarily moved to couple(). debug output added. 2018-03-10 17:48:25 +01:00
e6fed5eaf7 Added short description for the tutorial 2018-03-01 16:43:25 +01:00
ae6b1a7209 Cleanup 2018-03-01 16:42:07 +01:00
1a75b56f89 Fix run case 2018-03-01 16:27:27 +01:00
9e30c8934d Copy restart files to run case 2018-03-01 15:53:54 +01:00
25aede1f13 Fix init case 2018-03-01 15:45:05 +01:00
14ab34e1af Update to OF-4.x syntax for init case 2018-03-01 15:29:13 +01:00
86b31017e7 Copied tutorial from outdated feature/cfdemSolverMultiphase branch and started restructuring 2018-03-01 14:58:14 +01:00
9c95cfe2e1 Cleanup 2018-03-01 14:17:43 +01:00
9304e403b1 Initial commit. Works, but validation pending. 2018-02-23 12:55:17 +01:00
375686831e Moved tutorials blockMeshDict file to /system 2017-09-22 10:58:50 +02:00
ff41603bc2 Updated tutorials with new /etc location 2017-09-22 10:57:49 +02:00
8054b35f8b Cleanup 2017-09-22 10:56:56 +02:00
bad73896c1 Updated cfdemSolverMultiphase Make/options 2017-09-22 10:55:09 +02:00
eb752cbdd6 Merge branch 'develop' into feature/OF4x-multiphase 2017-09-22 10:31:39 +02:00
d577248752 Added temporal smoothing to Make/files 2017-08-03 13:48:03 +02:00
134a511488 Reorginzied function objects and updated plot script 2017-07-28 13:25:32 +02:00
46567490e1 Cleanup of old function object syntax 2017-07-26 13:45:12 +02:00
35d35339d2 tankDrainage tutorial case updated to OpenFOAM-4.x 2017-07-26 12:55:46 +02:00
cc3e8f7495 cleanup 2017-07-03 14:15:53 +02:00
4a0b96191b Added functionality to temporally smoothen a vector field 2017-07-03 13:47:51 +02:00
f91b4e4266 Added smooth pressure force to 4.x 2017-07-03 09:55:39 +02:00
065373049d Added temporal smoothing model to 4.x 2017-07-03 09:55:04 +02:00
9b1fab0f00 Auto write density 2017-06-22 12:35:33 +02:00
5c17f4b7a3 Fixed mixture viscosity calculation to avoid numerical difussion 2017-06-22 12:27:55 +02:00
96e4b8f454 testmerge 2017-06-20 16:05:10 +02:00
fff2eb3f35 Added smooth pressure gradient force model 2016-08-10 13:49:15 +02:00
b409fdf57d added solver and library to compile lists 2016-08-04 16:38:46 +02:00
21af66f36c multiphase tutorials updated 2016-08-04 16:23:50 +02:00
c7a57d1169 surfaceTension force model added 2016-08-04 16:01:13 +02:00
7b06e4d3a2 multiphase solver reworked to OF4.x 2016-08-04 16:00:50 +02:00
520 changed files with 66972 additions and 591 deletions

72
.circleci/config.yml Normal file
View File

@ -0,0 +1,72 @@
version: 2
jobs:
build:
branches:
only:
- master
- develop
docker:
- image: ubuntu:trusty
environment:
WM_NCOMPPROCS: 2
working_directory: /root/CFDEM/CFDEMcoupling
steps:
- run:
name: Install package dependencies
command: sudo apt-get update && sudo apt-get install -y build-essential cmake openmpi-bin libopenmpi-dev python-dev git bc
- run:
name: Make project and user dir
command: mkdir -p /root/CFDEM/CFDEMcoupling && mkdir -p /root/CFDEM/-4.1
- 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 -"
- run:
name: Install OpenFOAM 4.1
command: sudo apt-get update && sudo apt-get -y install openfoam4
- run:
name: Clone LIGGGHTS repository
command: git clone https://github.com/ParticulateFlow/LIGGGHTS-PFM.git /root/CFDEM/LIGGGHTS
- run:
name: Build LIGGGHTS
command: >
shopt -s expand_aliases &&
source /opt/openfoam4/etc/bashrc &&
source /root/CFDEM/CFDEMcoupling/etc/bashrc &&
bash /root/CFDEM/CFDEMcoupling/etc/compileLIGGGHTS.sh
no_output_timeout: 30m
- run:
name: Build CFDEMcoupling library
command: >
shopt -s expand_aliases &&
source /opt/openfoam4/etc/bashrc &&
source /root/CFDEM/CFDEMcoupling/etc/bashrc &&
bash /root/CFDEM/CFDEMcoupling/etc/compileCFDEMcoupling_src.sh
- run:
name: Build CFDEMcoupling solvers
command: >
shopt -s expand_aliases &&
source /opt/openfoam4/etc/bashrc &&
source /root/CFDEM/CFDEMcoupling/etc/bashrc &&
bash /root/CFDEM/CFDEMcoupling/etc/compileCFDEMcoupling_sol.sh
- run:
name: Build CFDEMcoupling utilities
command: >
shopt -s expand_aliases &&
source /opt/openfoam4/etc/bashrc &&
source /root/CFDEM/CFDEMcoupling/etc/bashrc &&
bash /root/CFDEM/CFDEMcoupling/etc/compileCFDEMcoupling_uti.sh

3
.gitignore vendored
View File

@ -5,7 +5,10 @@
log_*
log.*
*~
*.swp
*.swo
**/linux*Gcc*/
**/.vscode
lnInclude

674
LICENSE Normal file
View File

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program 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.
This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

80
README
View File

@ -1,80 +0,0 @@
/*---------------------------------------------------------------------------*\
CFDEMcoupling - Open Source CFD-DEM coupling
CFDEMcoupling is part of the CFDEMproject
www.cfdem.com
Christoph Goniva, christoph.goniva@cfdem.com
Copyright 2009-2012 JKU Linz
Copyright 2012-2015 DCS Computing GmbH, Linz
Copyright 2015- JKU Linz
-------------------------------------------------------------------------------
License
This file is part of CFDEMcoupling.
CFDEMcoupling 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 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; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
This code provides models and solvers to realize coupled CFD-DEM simulations
using LIGGGHTS and OpenFOAM.
Note: this code is not part of OpenFOAM (see DISCLAIMER).
\*---------------------------------------------------------------------------*/
CFDEM(R) coupling provides an open source parallel coupled CFD-DEM framework
combining the strengths of the LIGGGHTS(R) DEM code and the Open Source
CFD package OpenFOAM(R)(*). The CFDEM(R)coupling toolbox allows to expand
standard CFD solvers of OpenFOAM(R)(*) to include a coupling to the DEM
code LIGGGHTS(R). In this toolbox the particle representation within the
CFD solver is organized by "cloud" classes. Key functionalities are organised
in sub-models (e.g. force models, data exchange models, etc.) which can easily
be selected and combined by dictionary settings.
The coupled solvers run fully parallel on distributed-memory clusters.
Features are:
- its modular approach allows users to easily implement new models
- its MPI parallelization enables to use it for large scale problems
- the use of GIT allows to easily update to the latest version
- basic documentation is provided
The file structure:
- "src" directory including the source files of the coupling toolbox and models
- "applications" directory including the solver files for coupled CFD-DEM simulations
- "doc" directory including the documentation of CFDEM(R)coupling
- "tutorials" directory including basic tutorial cases showing the functionality
Details on installation are given on the "www.cfdem.com"
The functionality of this CFD-DEM framwork is described via "tutorial cases" showing
how to use different solvers and models.
CFDEM(R)coupling stands for Computational Fluid Dynamics (CFD) -
Discrete Element Method (DEM) coupling.
CFDEM(R)coupling is an open-source code, distributed freely under the terms of the
GNU Public License (GPL).
Core development of CFDEM(R)coupling is done by
Christoph Goniva and Christoph Kloss, both at DCS Computing GmbH, 2012
/*---------------------------------------------------------------------------*\
(*) "OpenFOAM(R)" is a registered trade mark of OpenCFD Limited, a wholly owned subsidiary of the ESI Group.
This offering is not approved or endorsed by OpenCFD Limited, the producer of the OpenFOAM software and owner of the OPENFOAM® and OpenCFD® trade marks.
\*---------------------------------------------------------------------------*/

33
README.md Executable file
View File

@ -0,0 +1,33 @@
# CFDEMcoupling
CFDEM®coupling stands for Computational Fluid Dynamics (CFD) - Discrete Element Method (DEM) coupling. It combines the open source packages OpenFOAM® (CFD) and LIGGGHTS® (DEM) to simulate particle-laden flows. CFDEM®coupling is part of the [CFDEM®project](https://www.cfdem.com).
[![CircleCI](https://circleci.com/gh/ParticulateFlow/CFDEMcoupling.svg?style=shield&circle-token=e4b6af30d3aa7aee109d206116f01600bf9ee9c6)](https://circleci.com/gh/ParticulateFlow/CFDEMcoupling)
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.html)
## Disclaimer
> This is an academic adaptation of the CFDEM®coupling software package, released by the
[Department of Particulate Flow Modelling at Johannes Kepler University in Linz, Austria.](https://www.jku.at/pfm)
> LIGGGHTS® and CFDEM® are registered trademarks, and this offering is not approved or
endorsed by DCS Computing GmbH, the official producer of the LIGGGHTS® and CFDEM®coupling software.
> This offering is not approved or endorsed by OpenCFD Limited, producer and distributor of the OpenFOAM software via www.openfoam.com, and owner of the OPENFOAM® and OpenCFD® trade marks.
## Features
- Documentation and tutorials to get started
- A modular approach that allows for easy implementation of new models
- MPI parallelization for large scale problems
## License
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.html)
- This software is distributed under the [GNU General Public License](https://opensource.org/licenses/GPL-3.0).
- Copyright © 2009- JKU Linz
- Copyright © 2012-2015 DCS Computing GmbH, Linz
- Some parts of CFDEM®coupling are based on OpenFOAM® and Copyright on these
parts is held by the OpenFOAM® Foundation (www.openfoam.org)
and potentially other parties.
- Some parts of CFDEM®coupling are contributed by other parties, which are
holding the Copyright. This is listed in each file of the distribution.

View File

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

View File

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

View File

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

View File

@ -0,0 +1,30 @@
include $(CFDEM_ADD_LIBS_DIR)/additionalLibs
EXE_INC = \
-I$(CFDEM_OFVERSION_DIR) \
-ImultiphaseMixture/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/lnInclude \
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/cfdTools \
EXE_LIBS = \
-L$(CFDEM_LIB_DIR)\
-lcfdemMultiphaseInterFoam \
-linterfaceProperties \
-lincompressibleTransportModels \
-lturbulenceModels \
-lincompressibleTurbulenceModels \
-lfiniteVolume \
-lfvOptions \
-lmeshTools \
-lsampling \
-l$(CFDEM_LIB_NAME) \
$(CFDEM_ADD_LIB_PATHS) \
$(CFDEM_ADD_LIBS)

View File

@ -0,0 +1,61 @@
const surfaceScalarField& rhoPhi(mixture.rhoPhi());
volScalarField muEff = rho*(turbulence->nu() + turbulence->nut());
if (modelType == "A")
muEff *= voidfraction;
fvVectorMatrix UEqn
(
fvm::ddt(rhoEps, U) - fvm::Sp(fvc::ddt(rhoEps),U)
+ fvm::div(rhoPhi, U) - fvm::Sp(fvc::div(rhoPhi),U)
//+ particleCloud.divVoidfractionTau(U, voidfraction)
- fvm::laplacian(muEff, U) - fvc::div(muEff*dev2(fvc::grad(U)().T()))
==
fvOptions(rho, U)
- fvm::Sp(Ksl,U)
);
UEqn.relax();
fvOptions.constrain(UEqn);
if (pimple.momentumPredictor() && (modelType=="B" || modelType=="Bfull"))
{
solve
(
UEqn
==
fvc::reconstruct
(
(- ghf*fvc::snGrad(rho) - fvc::snGrad(p_rgh)) * mesh.magSf()
)
+
fvc::reconstruct
(
mixture.surfaceTensionForce() * mesh.magSf()
) * voidfraction
+ Ksl*Us
);
fvOptions.correct(U);
}
else if (pimple.momentumPredictor())
{
solve
(
UEqn
==
fvc::reconstruct
(
(
mixture.surfaceTensionForce()
- ghf*fvc::snGrad(rho)
- fvc::snGrad(p_rgh)
) * mesh.magSf()
) * voidfraction
+ Ksl*Us
);
fvOptions.correct(U);
}

View File

@ -0,0 +1,17 @@
// Additional solver-specific checks
// Useful if one wants to e.g. initialize floating particles using the Archimedes model
if (particleCloud.couplingProperties().found("unrestrictedForceModelSelection"))
{
Warning << "Using unrestrictedForceModelSelection, results may be incorrect!" << endl;
} else
{
#include "checkModelType.H"
}
word modelType = particleCloud.modelType();
if(!particleCloud.couplingProperties().found("useDDTvoidfraction"))
{
Warning << "Suppressing ddt(voidfraction) is not recommended with this solver as it may generate incorrect results!" << endl;
}

View File

@ -0,0 +1,21 @@
scalar alphaCoNum = 0.0;
scalar meanAlphaCoNum = 0.0;
if (mesh.nInternalFaces())
{
scalarField sumPhi
(
mixture.nearInterface()().primitiveField()
*fvc::surfaceSum(mag(phi))().primitiveField()
);
alphaCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
meanAlphaCoNum =
0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue();
}
Info<< "Interface Courant Number mean: " << meanAlphaCoNum
<< " max: " << alphaCoNum << endl;
// ************************************************************************* //

View File

@ -0,0 +1,148 @@
/*---------------------------------------------------------------------------*\
License
This 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.
This code 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 this code. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2018- Mathias Vångö, JKU Linz, Austria
Application
cfdemSolverMultiphase
Description
CFD-DEM solver for n incompressible fluids which captures the interfaces and
includes surface-tension and contact-angle effects for each phase. It is based
on the OpenFOAM(R)-4.x solver multiphaseInterFoam but extended to incorporate
DEM functionalities from the open-source DEM code LIGGGHTS.
Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "multiphaseMixture.H"
#include "turbulentTransportModel.H"
#include "pimpleControl.H"
#include "fvOptions.H"
#include "CorrectPhi.H"
#include "cfdemCloud.H"
#include "implicitCouple.H"
#include "clockModel.H"
#include "smoothingModel.H"
#include "forceModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
#include "postProcess.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createControl.H"
#include "initContinuityErrs.H"
#include "createFields.H"
#include "createFvOptions.H"
#include "correctPhi.H"
#include "CourantNo.H"
turbulence->validate();
// create cfdemCloud
cfdemCloud particleCloud(mesh);
#include "additionalChecks.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.loop())
{
#include "CourantNo.H"
#include "alphaCourantNo.H"
particleCloud.clockM().start(1,"Global");
Info<< "Time = " << runTime.timeName() << nl << endl;
particleCloud.clockM().start(2,"Coupling");
bool hasEvolved = particleCloud.evolve(voidfraction,Us,U);
if(hasEvolved)
{
particleCloud.smoothingM().smoothen(particleCloud.forceM(0).impParticleForces());
}
Info << "update Ksl.internalField()" << endl;
Ksl = particleCloud.momCoupleM(0).impMomSource();
Ksl.correctBoundaryConditions();
//Force Checks
vector fTotal(0,0,0);
vector fImpTotal = sum(mesh.V()*Ksl.internalField()*(Us.internalField()-U.internalField())).value();
reduce(fImpTotal, sumOp<vector>());
Info << "TotalForceExp: " << fTotal << endl;
Info << "TotalForceImp: " << fImpTotal << endl;
#include "solverDebugInfo.H"
particleCloud.clockM().stop("Coupling");
particleCloud.clockM().start(26,"Flow");
if(particleCloud.solveFlow())
{
mixture.solve();
rho = mixture.rho();
rhoEps = rho * voidfraction;
// --- Pressure-velocity PIMPLE corrector loop
while (pimple.loop())
{
#include "UEqn.H"
// --- Pressure corrector loop
while (pimple.correct())
{
#include "pEqn.H"
}
if (pimple.turbCorr())
{
turbulence->correct();
}
}
}
else
{
Info << "skipping flow solution." << endl;
}
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
particleCloud.clockM().stop("Flow");
particleCloud.clockM().stop("Global");
}
Info<< "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,11 @@
CorrectPhi
(
U,
phi,
p_rgh,
dimensionedScalar("rAUf", dimTime/rho.dimensions(), 1),
geometricZeroField(),
pimple
);
#include "continuityErrs.H"

View File

@ -0,0 +1,156 @@
//===============================
// particle interaction modelling
//===============================
Info<< "\nReading momentum exchange field Ksl\n" << endl;
volScalarField Ksl
(
IOobject
(
"Ksl",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
//dimensionedScalar("0", dimensionSet(1, -3, -1, 0, 0), 1.0)
);
Info<< "\nReading voidfraction field voidfraction = (Vgas/Vparticle)\n" << endl;
volScalarField voidfraction
(
IOobject
(
"voidfraction",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
voidfraction.oldTime();
Info<< "Reading particle velocity field Us\n" << endl;
volVectorField Us
(
IOobject
(
"Us",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< "Reading field p_rgh\n" << endl;
volScalarField p_rgh
(
IOobject
(
"p_rgh",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< "Reading field U\n" << endl;
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< "Reading/calculating face flux field phi\n" << endl;
surfaceScalarField phi
(
IOobject
(
"phi",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
linearInterpolate(U*voidfraction) & mesh.Sf()
);
multiphaseMixture mixture(U, phi, voidfraction);
// Need to store rho for ddt(rho, U)
volScalarField rho
(
IOobject
(
"rho",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mixture.rho()
);
rho.oldTime();
volScalarField rhoEps ("rhoEps", rho * voidfraction);
// Construct incompressible turbulence model
autoPtr<incompressible::turbulenceModel> turbulence
(
incompressible::turbulenceModel::New(U, phi, mixture)
);
#include "readGravitationalAcceleration.H"
#include "readhRef.H"
#include "gh.H"
volScalarField p
(
IOobject
(
"p",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
p_rgh + rho*gh
);
label pRefCell = 0;
scalar pRefValue = 0.0;
setRefCell
(
p,
p_rgh,
pimple.dict(),
pRefCell,
pRefValue
);
if (p_rgh.needReference())
{
p += dimensionedScalar
(
"p",
p.dimensions(),
pRefValue - getRefCellValue(p, pRefCell)
);
}
mesh.setFluxRequired(p_rgh.name());

View File

@ -0,0 +1,5 @@
phase/phase.C
alphaContactAngle/alphaContactAngleFvPatchScalarField.C
multiphaseMixture.C
LIB = $(CFDEM_LIB_DIR)/libcfdemMultiphaseInterFoam

View File

@ -0,0 +1,13 @@
EXE_INC = \
-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
LIB_LIBS = \
-linterfaceProperties \
-lincompressibleTransportModels \
-lfiniteVolume \
-lmeshTools

View File

@ -0,0 +1,146 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 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 "alphaContactAngleFvPatchScalarField.H"
#include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
alphaContactAngleFvPatchScalarField::interfaceThetaProps::interfaceThetaProps
(
Istream& is
)
:
theta0_(readScalar(is)),
uTheta_(readScalar(is)),
thetaA_(readScalar(is)),
thetaR_(readScalar(is))
{}
Istream& operator>>
(
Istream& is,
alphaContactAngleFvPatchScalarField::interfaceThetaProps& tp
)
{
is >> tp.theta0_ >> tp.uTheta_ >> tp.thetaA_ >> tp.thetaR_;
return is;
}
Ostream& operator<<
(
Ostream& os,
const alphaContactAngleFvPatchScalarField::interfaceThetaProps& tp
)
{
os << tp.theta0_ << token::SPACE
<< tp.uTheta_ << token::SPACE
<< tp.thetaA_ << token::SPACE
<< tp.thetaR_;
return os;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
)
:
zeroGradientFvPatchScalarField(p, iF)
{}
alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
(
const alphaContactAngleFvPatchScalarField& gcpsf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
zeroGradientFvPatchScalarField(gcpsf, p, iF, mapper),
thetaProps_(gcpsf.thetaProps_)
{}
alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const dictionary& dict
)
:
zeroGradientFvPatchScalarField(p, iF),
thetaProps_(dict.lookup("thetaProperties"))
{
evaluate();
}
alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
(
const alphaContactAngleFvPatchScalarField& gcpsf,
const DimensionedField<scalar, volMesh>& iF
)
:
zeroGradientFvPatchScalarField(gcpsf, iF),
thetaProps_(gcpsf.thetaProps_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void alphaContactAngleFvPatchScalarField::write(Ostream& os) const
{
fvPatchScalarField::write(os);
os.writeKeyword("thetaProperties")
<< thetaProps_ << token::END_STATEMENT << nl;
writeEntry("value", os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeField
(
fvPatchScalarField,
alphaContactAngleFvPatchScalarField
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,215 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 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::alphaContactAngleFvPatchScalarField
Description
Contact-angle boundary condition for multi-phase interface-capturing
simulations. Used in conjuction with multiphaseMixture.
SourceFiles
alphaContactAngleFvPatchScalarField.C
\*---------------------------------------------------------------------------*/
#ifndef alphaContactAngleFvPatchScalarField_H
#define alphaContactAngleFvPatchScalarField_H
#include "zeroGradientFvPatchFields.H"
#include "multiphaseMixture.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class alphaContactAngleFvPatch Declaration
\*---------------------------------------------------------------------------*/
class alphaContactAngleFvPatchScalarField
:
public zeroGradientFvPatchScalarField
{
public:
class interfaceThetaProps
{
//- Equilibrium contact angle
scalar theta0_;
//- Dynamic contact angle velocity scale
scalar uTheta_;
//- Limiting advancing contact angle
scalar thetaA_;
//- Limiting receeding contact angle
scalar thetaR_;
public:
// Constructors
interfaceThetaProps()
{}
interfaceThetaProps(Istream&);
// Member functions
//- Return the equilibrium contact angle theta0
scalar theta0(bool matched=true) const
{
if (matched) return theta0_;
else return 180.0 - theta0_;
}
//- Return the dynamic contact angle velocity scale
scalar uTheta() const
{
return uTheta_;
}
//- Return the limiting advancing contact angle
scalar thetaA(bool matched=true) const
{
if (matched) return thetaA_;
else return 180.0 - thetaA_;
}
//- Return the limiting receeding contact angle
scalar thetaR(bool matched=true) const
{
if (matched) return thetaR_;
else return 180.0 - thetaR_;
}
// IO functions
friend Istream& operator>>(Istream&, interfaceThetaProps&);
friend Ostream& operator<<(Ostream&, const interfaceThetaProps&);
};
typedef HashTable
<
interfaceThetaProps,
multiphaseMixture::interfacePair,
multiphaseMixture::interfacePair::hash
> thetaPropsTable;
private:
// Private data
thetaPropsTable thetaProps_;
public:
//- Runtime type information
TypeName("alphaContactAngle");
// Constructors
//- Construct from patch and internal field
alphaContactAngleFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&
);
//- Construct from patch, internal field and dictionary
alphaContactAngleFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const dictionary&
);
//- Construct by mapping given alphaContactAngleFvPatchScalarField
// onto a new patch
alphaContactAngleFvPatchScalarField
(
const alphaContactAngleFvPatchScalarField&,
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct and return a clone
virtual tmp<fvPatchScalarField> clone() const
{
return tmp<fvPatchScalarField>
(
new alphaContactAngleFvPatchScalarField(*this)
);
}
//- Construct as copy setting internal field reference
alphaContactAngleFvPatchScalarField
(
const alphaContactAngleFvPatchScalarField&,
const DimensionedField<scalar, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchScalarField> clone
(
const DimensionedField<scalar, volMesh>& iF
) const
{
return tmp<fvPatchScalarField>
(
new alphaContactAngleFvPatchScalarField(*this, iF)
);
}
// Member functions
//- Return the contact angle properties
const thetaPropsTable& thetaProps() const
{
return thetaProps_;
}
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,772 @@
/*---------------------------------------------------------------------------*\
License
This 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.
This code 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 this code. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2018- Mathias Vångö, JKU Linz, Austria
\*---------------------------------------------------------------------------*/
#include "multiphaseMixture.H"
#include "alphaContactAngleFvPatchScalarField.H"
#include "Time.H"
#include "subCycle.H"
#include "MULES.H"
#include "surfaceInterpolate.H"
#include "fvcGrad.H"
#include "fvcSnGrad.H"
#include "fvcDiv.H"
#include "fvcFlux.H"
// * * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * //
const Foam::scalar Foam::multiphaseMixture::convertToRad =
Foam::constant::mathematical::pi/180.0;
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::multiphaseMixture::calcAlphas()
{
scalar level = 0.0;
alphas_ == 0.0;
forAllIter(PtrDictionary<phase>, phases_, iter)
{
alphas_ += level*iter();
level += 1.0;
}
}
Foam::tmp<Foam::volScalarField>
Foam::multiphaseMixture::calcNu() const
{
PtrDictionary<phase>::const_iterator iter = phases_.begin();
tmp<volScalarField> tnu = iter()*iter().nu();
volScalarField& nu = tnu.ref();
for (++iter; iter != phases_.end(); ++iter)
{
nu += iter()*iter().nu();
}
return tnu;
}
Foam::tmp<Foam::surfaceScalarField>
Foam::multiphaseMixture::calcStf() const
{
tmp<surfaceScalarField> tstf
(
new surfaceScalarField
(
IOobject
(
"stf",
mesh_.time().timeName(),
mesh_
),
mesh_,
dimensionedScalar
(
"stf",
dimensionSet(1, -2, -2, 0, 0),
0.0
)
)
);
surfaceScalarField& stf = tstf.ref();
forAllConstIter(PtrDictionary<phase>, phases_, iter1)
{
const phase& alpha1 = iter1();
PtrDictionary<phase>::const_iterator iter2 = iter1;
++iter2;
for (; iter2 != phases_.end(); ++iter2)
{
const phase& alpha2 = iter2();
sigmaTable::const_iterator sigma =
sigmas_.find(interfacePair(alpha1, alpha2));
if (sigma == sigmas_.end())
{
FatalErrorInFunction
<< "Cannot find interface " << interfacePair(alpha1, alpha2)
<< " in list of sigma values"
<< exit(FatalError);
}
stf += dimensionedScalar("sigma", dimSigma_, sigma())
*fvc::interpolate(K(alpha1, alpha2))*
(
fvc::interpolate(alpha2)*fvc::snGrad(alpha1)
- fvc::interpolate(alpha1)*fvc::snGrad(alpha2)
);
}
}
return tstf;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::multiphaseMixture::multiphaseMixture
(
const volVectorField& U,
const surfaceScalarField& phi,
const volScalarField& voidfraction
)
:
IOdictionary
(
IOobject
(
"transportProperties",
U.time().constant(),
U.db(),
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
),
phases_(lookup("phases"), phase::iNew(U, phi)),
mesh_(U.mesh()),
U_(U),
phi_(phi),
voidfraction_(voidfraction),
rhoPhi_
(
IOobject
(
"rhoPhi",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_,
dimensionedScalar("rhoPhi", dimMass/dimTime, 0.0)
),
surfaceTensionForce_
(
IOobject
(
"surfaceTensionForce",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh_,
dimensionedScalar("surfaceTensionForce", dimensionSet(1, -2, -2, 0, 0), 0.0)
),
alphas_
(
IOobject
(
"alphas",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh_,
dimensionedScalar("alphas", dimless, 0.0)
),
nu_
(
IOobject
(
"nu",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
calcNu()
),
sigmas_(lookup("sigmas")),
dimSigma_(1, 0, -2, 0, 0),
deltaN_
(
"deltaN",
1e-8/pow(average(mesh_.V()), 1.0/3.0)
)
{
calcAlphas();
alphas_.write();
surfaceTensionForce_ = calcStf();
}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::multiphaseMixture::rho() const
{
PtrDictionary<phase>::const_iterator iter = phases_.begin();
tmp<volScalarField> trho = iter()*iter().rho();
volScalarField& rho = trho.ref();
for (++iter; iter != phases_.end(); ++iter)
{
rho += iter()*iter().rho();
}
return trho;
}
Foam::tmp<Foam::scalarField>
Foam::multiphaseMixture::rho(const label patchi) const
{
PtrDictionary<phase>::const_iterator iter = phases_.begin();
tmp<scalarField> trho = iter().boundaryField()[patchi]*iter().rho().value();
scalarField& rho = trho.ref();
for (++iter; iter != phases_.end(); ++iter)
{
rho += iter().boundaryField()[patchi]*iter().rho().value();
}
return trho;
}
Foam::tmp<Foam::volScalarField>
Foam::multiphaseMixture::mu() const
{
return rho()*nu();
// PtrDictionary<phase>::const_iterator iter = phases_.begin();
// tmp<volScalarField> tmu = iter()*iter().rho()*iter().nu();
// volScalarField& mu = tmu.ref();
// for (++iter; iter != phases_.end(); ++iter)
// {
// mu += iter()*iter().rho()*iter().nu();
// }
// return tmu;
}
Foam::tmp<Foam::scalarField>
Foam::multiphaseMixture::mu(const label patchi) const
{
PtrDictionary<phase>::const_iterator iter = phases_.begin();
tmp<scalarField> tmu =
iter().boundaryField()[patchi]
*iter().rho().value()
*iter().nu(patchi);
scalarField& mu = tmu.ref();
for (++iter; iter != phases_.end(); ++iter)
{
mu +=
iter().boundaryField()[patchi]
*iter().rho().value()
*iter().nu(patchi);
}
return tmu;
}
Foam::tmp<Foam::surfaceScalarField>
Foam::multiphaseMixture::muf() const
{
return nuf()*fvc::interpolate(rho());
// PtrDictionary<phase>::const_iterator iter = phases_.begin();
// tmp<surfaceScalarField> tmuf =
// fvc::interpolate(iter())*iter().rho()*fvc::interpolate(iter().nu());
// surfaceScalarField& muf = tmuf.ref();
// for (++iter; iter != phases_.end(); ++iter)
// {
// muf +=
// fvc::interpolate(iter())*iter().rho()*fvc::interpolate(iter().nu());
// }
// return tmuf;
}
Foam::tmp<Foam::volScalarField>
Foam::multiphaseMixture::nu() const
{
return nu_;
}
Foam::tmp<Foam::scalarField>
Foam::multiphaseMixture::nu(const label patchi) const
{
//return nu_.boundaryField()[patchi];
PtrDictionary<phase>::const_iterator iter = phases_.begin();
tmp<scalarField> tnu =
iter().boundaryField()[patchi]
*iter().nu(patchi);
scalarField& nu = tnu.ref();
for (++iter; iter != phases_.end(); ++iter)
{
nu +=
iter().boundaryField()[patchi]
*iter().nu(patchi);
}
return tnu;
}
Foam::tmp<Foam::surfaceScalarField>
Foam::multiphaseMixture::nuf() const
{
//return muf()/fvc::interpolate(rho());
PtrDictionary<phase>::const_iterator iter = phases_.begin();
tmp<surfaceScalarField> tnuf =
fvc::interpolate(iter())*fvc::interpolate(iter().nu());
surfaceScalarField& nuf = tnuf.ref();
for (++iter; iter != phases_.end(); ++iter)
{
nuf +=
fvc::interpolate(iter())*fvc::interpolate(iter().nu());
}
return tnuf;
}
void Foam::multiphaseMixture::solve()
{
correct();
const Time& runTime = mesh_.time();
volScalarField& alpha = phases_.first();
const dictionary& alphaControls = mesh_.solverDict("alpha");
label nAlphaSubCycles(readLabel(alphaControls.lookup("nAlphaSubCycles")));
scalar cAlpha(readScalar(alphaControls.lookup("cAlpha")));
if (nAlphaSubCycles > 1)
{
surfaceScalarField rhoPhiSum
(
IOobject
(
"rhoPhiSum",
runTime.timeName(),
mesh_
),
mesh_,
dimensionedScalar("0", rhoPhi_.dimensions(), 0)
);
dimensionedScalar totalDeltaT = runTime.deltaT();
for
(
subCycle<volScalarField> alphaSubCycle(alpha, nAlphaSubCycles);
!(++alphaSubCycle).end();
)
{
FatalError << "Sub-cycling of the alpha equation not yet implemented!!" << abort(FatalError);
solveAlphas(cAlpha);
rhoPhiSum += (runTime.deltaT()/totalDeltaT)*rhoPhi_;
}
rhoPhi_ = rhoPhiSum;
}
else
{
solveAlphas(cAlpha);
}
// Update the mixture kinematic viscosity
nu_ = calcNu();
surfaceTensionForce_ = calcStf();
}
void Foam::multiphaseMixture::correct()
{
forAllIter(PtrDictionary<phase>, phases_, iter)
{
iter().correct();
}
}
Foam::tmp<Foam::surfaceVectorField> Foam::multiphaseMixture::nHatfv
(
const volScalarField& alpha1,
const volScalarField& alpha2
) const
{
/*
// Cell gradient of alpha
volVectorField gradAlpha =
alpha2*fvc::grad(alpha1) - alpha1*fvc::grad(alpha2);
// Interpolated face-gradient of alpha
surfaceVectorField gradAlphaf = fvc::interpolate(gradAlpha);
*/
surfaceVectorField gradAlphaf
(
fvc::interpolate(alpha2)*fvc::interpolate(fvc::grad(alpha1))
- fvc::interpolate(alpha1)*fvc::interpolate(fvc::grad(alpha2))
);
// Face unit interface normal
return gradAlphaf/(mag(gradAlphaf) + deltaN_);
}
Foam::tmp<Foam::surfaceScalarField> Foam::multiphaseMixture::nHatf
(
const volScalarField& alpha1,
const volScalarField& alpha2
) const
{
// Face unit interface normal flux
return nHatfv(alpha1, alpha2) & mesh_.Sf();
}
// Correction for the boundary condition on the unit normal nHat on
// walls to produce the correct contact angle.
// The dynamic contact angle is calculated from the component of the
// velocity on the direction of the interface, parallel to the wall.
void Foam::multiphaseMixture::correctContactAngle
(
const phase& alpha1,
const phase& alpha2,
surfaceVectorField::Boundary& nHatb
) const
{
const volScalarField::Boundary& gbf
= alpha1.boundaryField();
const fvBoundaryMesh& boundary = mesh_.boundary();
forAll(boundary, patchi)
{
if (isA<alphaContactAngleFvPatchScalarField>(gbf[patchi]))
{
const alphaContactAngleFvPatchScalarField& acap =
refCast<const alphaContactAngleFvPatchScalarField>(gbf[patchi]);
vectorField& nHatPatch = nHatb[patchi];
vectorField AfHatPatch
(
mesh_.Sf().boundaryField()[patchi]
/mesh_.magSf().boundaryField()[patchi]
);
alphaContactAngleFvPatchScalarField::thetaPropsTable::
const_iterator tp =
acap.thetaProps().find(interfacePair(alpha1, alpha2));
if (tp == acap.thetaProps().end())
{
FatalErrorInFunction
<< "Cannot find interface " << interfacePair(alpha1, alpha2)
<< "\n in table of theta properties for patch "
<< acap.patch().name()
<< exit(FatalError);
}
bool matched = (tp.key().first() == alpha1.name());
scalar theta0 = convertToRad*tp().theta0(matched);
scalarField theta(boundary[patchi].size(), theta0);
scalar uTheta = tp().uTheta();
// Calculate the dynamic contact angle if required
if (uTheta > SMALL)
{
scalar thetaA = convertToRad*tp().thetaA(matched);
scalar thetaR = convertToRad*tp().thetaR(matched);
// Calculated the component of the velocity parallel to the wall
vectorField Uwall
(
U_.boundaryField()[patchi].patchInternalField()
- U_.boundaryField()[patchi]
);
Uwall -= (AfHatPatch & Uwall)*AfHatPatch;
// Find the direction of the interface parallel to the wall
vectorField nWall
(
nHatPatch - (AfHatPatch & nHatPatch)*AfHatPatch
);
// Normalise nWall
nWall /= (mag(nWall) + SMALL);
// Calculate Uwall resolved normal to the interface parallel to
// the interface
scalarField uwall(nWall & Uwall);
theta += (thetaA - thetaR)*tanh(uwall/uTheta);
}
// Reset nHatPatch to correspond to the contact angle
scalarField a12(nHatPatch & AfHatPatch);
scalarField b1(cos(theta));
scalarField b2(nHatPatch.size());
forAll(b2, facei)
{
b2[facei] = cos(acos(a12[facei]) - theta[facei]);
}
scalarField det(1.0 - a12*a12);
scalarField a((b1 - a12*b2)/det);
scalarField b((b2 - a12*b1)/det);
nHatPatch = a*AfHatPatch + b*nHatPatch;
nHatPatch /= (mag(nHatPatch) + deltaN_.value());
}
}
}
Foam::tmp<Foam::volScalarField> Foam::multiphaseMixture::K
(
const phase& alpha1,
const phase& alpha2
) const
{
tmp<surfaceVectorField> tnHatfv = nHatfv(alpha1, alpha2);
correctContactAngle(alpha1, alpha2, tnHatfv.ref().boundaryFieldRef());
// Simple expression for curvature
return -fvc::div(tnHatfv & mesh_.Sf());
}
Foam::tmp<Foam::volScalarField>
Foam::multiphaseMixture::nearInterface() const
{
tmp<volScalarField> tnearInt
(
new volScalarField
(
IOobject
(
"nearInterface",
mesh_.time().timeName(),
mesh_
),
mesh_,
dimensionedScalar("nearInterface", dimless, 0.0)
)
);
forAllConstIter(PtrDictionary<phase>, phases_, iter)
{
tnearInt.ref() = max(tnearInt(), pos(iter() - 0.01)*pos(0.99 - iter()));
}
return tnearInt;
}
void Foam::multiphaseMixture::solveAlphas
(
const scalar cAlpha
)
{
static label nSolves=-1;
nSolves++;
word alphaScheme("div(phi,alpha)");
word alpharScheme("div(phirb,alpha)");
surfaceScalarField phic(mag(phi_/mesh_.magSf()));
phic = min(cAlpha*phic, max(phic));
PtrList<surfaceScalarField> alphaPhiCorrs(phases_.size());
int phasei = 0;
forAllIter(PtrDictionary<phase>, phases_, iter)
{
phase& alpha = iter();
alphaPhiCorrs.set
(
phasei,
new surfaceScalarField
(
"phi" + alpha.name() + "Corr",
fvc::flux
(
phi_,
alpha,
alphaScheme
)
)
);
surfaceScalarField& alphaPhiCorr = alphaPhiCorrs[phasei];
forAllIter(PtrDictionary<phase>, phases_, iter2)
{
phase& alpha2 = iter2();
if (&alpha2 == &alpha) continue;
surfaceScalarField phir(phic*nHatf(alpha, alpha2));
alphaPhiCorr += fvc::flux
(
-fvc::flux(-phir, alpha2, alpharScheme),
alpha,
alpharScheme
);
}
MULES::limit
(
1.0/mesh_.time().deltaT().value(),
voidfraction_,
alpha,
phi_,
alphaPhiCorr,
zeroField(),
zeroField(),
1,
0,
true
);
phasei++;
}
MULES::limitSum(alphaPhiCorrs);
rhoPhi_ = dimensionedScalar("0", dimensionSet(1, 0, -1, 0, 0), 0);
volScalarField sumAlpha
(
IOobject
(
"sumAlpha",
mesh_.time().timeName(),
mesh_
),
mesh_,
dimensionedScalar("sumAlpha", dimless, 0)
);
phasei = 0;
forAllIter(PtrDictionary<phase>, phases_, iter)
{
phase& alpha = iter();
surfaceScalarField& alphaPhi = alphaPhiCorrs[phasei];
alphaPhi += upwind<scalar>(mesh_, phi_).flux(alpha);
MULES::explicitSolve
(
voidfraction_,
alpha,
alphaPhi,
zeroField(),
zeroField()
);
rhoPhi_ += alphaPhi*alpha.rho();
Info<< alpha.name() << " volume fraction, min, max = "
<< alpha.weightedAverage(mesh_.V()).value()
<< ' ' << min(alpha).value()
<< ' ' << max(alpha).value()
<< endl;
sumAlpha += alpha;
phasei++;
}
Info<< "Phase-sum volume fraction, min, max = "
<< sumAlpha.weightedAverage(mesh_.V()).value()
<< ' ' << min(sumAlpha).value()
<< ' ' << max(sumAlpha).value()
<< endl;
calcAlphas();
}
bool Foam::multiphaseMixture::read()
{
if (transportModel::read())
{
bool readOK = true;
PtrList<entry> phaseData(lookup("phases"));
label phasei = 0;
forAllIter(PtrDictionary<phase>, phases_, iter)
{
readOK &= iter().read(phaseData[phasei++].dict());
}
lookup("sigmas") >> sigmas_;
return readOK;
}
else
{
return false;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,284 @@
/*---------------------------------------------------------------------------*\
License
This 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.
This code 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 this code. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2018- Mathias Vångö, JKU Linz, Austria
Class
multiphaseMixture
Description
This class is based on the OpenFOAM(R) Foam::multiphaseMixture class,
which is an incompressible multi-phase mixture with built in solution
for the phase fractions with interface compression for interface-capturing.
It has been extended to include the void fraction in the volume fraction
transport equations.
Derived from transportModel so that it can be unsed in conjunction with
the incompressible turbulence models.
Surface tension and contact-angle is handled for the interface
between each phase-pair.
SourceFiles
multiphaseMixture.C
\*---------------------------------------------------------------------------*/
#ifndef multiphaseMixture_H
#define multiphaseMixture_H
#include "incompressible/transportModel/transportModel.H"
#include "IOdictionary.H"
#include "phase.H"
#include "PtrDictionary.H"
#include "volFields.H"
#include "surfaceFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class multiphaseMixture Declaration
\*---------------------------------------------------------------------------*/
class multiphaseMixture
:
public IOdictionary,
public transportModel
{
public:
class interfacePair
:
public Pair<word>
{
public:
class hash
:
public Hash<interfacePair>
{
public:
hash()
{}
label operator()(const interfacePair& key) const
{
return word::hash()(key.first()) + word::hash()(key.second());
}
};
// Constructors
interfacePair()
{}
interfacePair(const word& alpha1Name, const word& alpha2Name)
:
Pair<word>(alpha1Name, alpha2Name)
{}
interfacePair(const phase& alpha1, const phase& alpha2)
:
Pair<word>(alpha1.name(), alpha2.name())
{}
// Friend Operators
friend bool operator==
(
const interfacePair& a,
const interfacePair& b
)
{
return
(
((a.first() == b.first()) && (a.second() == b.second()))
|| ((a.first() == b.second()) && (a.second() == b.first()))
);
}
friend bool operator!=
(
const interfacePair& a,
const interfacePair& b
)
{
return (!(a == b));
}
};
private:
// Private data
//- Dictionary of phases
PtrDictionary<phase> phases_;
const fvMesh& mesh_;
const volVectorField& U_;
const surfaceScalarField& phi_;
const volScalarField& voidfraction_;
surfaceScalarField rhoPhi_;
surfaceScalarField surfaceTensionForce_;
volScalarField alphas_;
volScalarField nu_;
typedef HashTable<scalar, interfacePair, interfacePair::hash>
sigmaTable;
sigmaTable sigmas_;
dimensionSet dimSigma_;
//- Stabilisation for normalisation of the interface normal
const dimensionedScalar deltaN_;
//- Conversion factor for degrees into radians
static const scalar convertToRad;
// Private member functions
void calcAlphas();
tmp<volScalarField> calcNu() const;
void solveAlphas(const scalar cAlpha);
tmp<surfaceVectorField> nHatfv
(
const volScalarField& alpha1,
const volScalarField& alpha2
) const;
tmp<surfaceScalarField> nHatf
(
const volScalarField& alpha1,
const volScalarField& alpha2
) const;
void correctContactAngle
(
const phase& alpha1,
const phase& alpha2,
surfaceVectorField::Boundary& nHatb
) const;
tmp<volScalarField> K(const phase& alpha1, const phase& alpha2) const;
tmp<surfaceScalarField> calcStf() const;
public:
// Constructors
//- Construct from components
multiphaseMixture
(
const volVectorField& U,
const surfaceScalarField& phi,
const volScalarField& voidfraction
);
//- Destructor
virtual ~multiphaseMixture()
{}
// Member Functions
//- Return the phases
const PtrDictionary<phase>& phases() const
{
return phases_;
}
//- Return the velocity
const volVectorField& U() const
{
return U_;
}
//- Return the volumetric flux
const surfaceScalarField& phi() const
{
return phi_;
}
const surfaceScalarField& rhoPhi() const
{
return rhoPhi_;
}
//- Return the mixture density
tmp<volScalarField> rho() const;
//- Return the mixture density for patch
tmp<scalarField> rho(const label patchi) const;
//- Return the dynamic laminar viscosity
tmp<volScalarField> mu() const;
//- Return the dynamic laminar viscosity for patch
tmp<scalarField> mu(const label patchi) const;
//- Return the face-interpolated dynamic laminar viscosity
tmp<surfaceScalarField> muf() const;
//- Return the kinematic laminar viscosity
tmp<volScalarField> nu() const;
//- Return the laminar viscosity for patch
tmp<scalarField> nu(const label patchi) const;
//- Return the face-interpolated dynamic laminar viscosity
tmp<surfaceScalarField> nuf() const;
tmp<surfaceScalarField> surfaceTensionForce() const
{
return surfaceTensionForce_;
}
//- Indicator of the proximity of the interface
// Field values are 1 near and 0 away for the interface.
tmp<volScalarField> nearInterface() const;
//- Solve for the mixture phase-fractions
void solve();
//- Correct the mixture properties
void correct();
//- Read base transportProperties dictionary
bool read();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,98 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "phase.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::phase::phase
(
const word& phaseName,
const dictionary& phaseDict,
const volVectorField& U,
const surfaceScalarField& phi
)
:
volScalarField
(
IOobject
(
IOobject::groupName("alpha", phaseName),
U.mesh().time().timeName(),
U.mesh(),
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
U.mesh()
),
name_(phaseName),
phaseDict_(phaseDict),
nuModel_
(
viscosityModel::New
(
IOobject::groupName("nu", phaseName),
phaseDict_,
U,
phi
)
),
rho_("rho", dimDensity, phaseDict_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::autoPtr<Foam::phase> Foam::phase::clone() const
{
NotImplemented;
return autoPtr<phase>(NULL);
}
void Foam::phase::correct()
{
nuModel_->correct();
}
bool Foam::phase::read(const dictionary& phaseDict)
{
phaseDict_ = phaseDict;
if (nuModel_->read(phaseDict_))
{
phaseDict_.lookup("rho") >> rho_;
return true;
}
else
{
return false;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,163 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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/>.
Class
Foam::phase
Description
Single incompressible phase derived from the phase-fraction.
Used as part of the multiPhaseMixture for interface-capturing multi-phase
simulations.
SourceFiles
phase.C
\*---------------------------------------------------------------------------*/
#ifndef phase_H
#define phase_H
#include "volFields.H"
#include "dictionaryEntry.H"
#include "incompressible/viscosityModels/viscosityModel/viscosityModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class phase Declaration
\*---------------------------------------------------------------------------*/
class phase
:
public volScalarField
{
// Private data
word name_;
dictionary phaseDict_;
autoPtr<viscosityModel> nuModel_;
dimensionedScalar rho_;
public:
// Constructors
//- Construct from components
phase
(
const word& name,
const dictionary& phaseDict,
const volVectorField& U,
const surfaceScalarField& phi
);
//- Return clone
autoPtr<phase> clone() const;
//- Return a pointer to a new phase created on freestore
// from Istream
class iNew
{
const volVectorField& U_;
const surfaceScalarField& phi_;
public:
iNew
(
const volVectorField& U,
const surfaceScalarField& phi
)
:
U_(U),
phi_(phi)
{}
autoPtr<phase> operator()(Istream& is) const
{
dictionaryEntry ent(dictionary::null, is);
return autoPtr<phase>(new phase(ent.keyword(), ent, U_, phi_));
}
};
// Member Functions
const word& name() const
{
return name_;
}
const word& keyword() const
{
return name();
}
//- Return const-access to phase1 viscosityModel
const viscosityModel& nuModel() const
{
return nuModel_();
}
//- Return the kinematic laminar viscosity
tmp<volScalarField> nu() const
{
return nuModel_->nu();
}
//- Return the laminar viscosity for patch
tmp<scalarField> nu(const label patchi) const
{
return nuModel_->nu(patchi);
}
//- Return const-access to phase1 density
const dimensionedScalar& rho() const
{
return rho_;
}
//- Correct the phase properties
void correct();
//-Inherit read from volScalarField
using volScalarField::read;
//- Read base transportProperties dictionary
bool read(const dictionary& phaseDict);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,73 @@
{
volScalarField rAU("rAU", 1.0/UEqn.A());
surfaceScalarField rAUepsf("rAUepsf", fvc::interpolate(rAU*voidfraction));
surfaceScalarField rAUepsSqf("rAUepsSqf", fvc::interpolate(rAU*voidfraction*voidfraction));
volVectorField Ueps("Ueps", U * voidfraction);
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh));
surfaceScalarField phiHbyA
(
"phiHbyA",
fvc::flux(HbyA*voidfraction)
+ fvc::interpolate(voidfraction*rho*rAU)*fvc::ddtCorr(U, phi)
);
adjustPhi(phiHbyA, U, p_rgh);
if (modelType == "A")
rAUepsf = rAUepsSqf;
surfaceScalarField phig (-ghf*fvc::snGrad(rho)*rAUepsf*mesh.magSf());
surfaceScalarField phiSt (mixture.surfaceTensionForce()*rAUepsSqf*mesh.magSf());
surfaceScalarField phiS (fvc::flux(voidfraction*Us*Ksl*rAU));
phiHbyA += phig + phiSt + phiS;
// Update the pressure BCs to ensure flux consistency
constrainPressure(p_rgh, Ueps, phiHbyA, rAUepsf);
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix p_rghEqn
(
fvm::laplacian(rAUepsf, p_rgh) == particleCloud.ddtVoidfraction() + fvc::div(phiHbyA)
);
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
if (pimple.finalNonOrthogonalIter())
{
phi = phiHbyA - p_rghEqn.flux();
p_rgh.relax();
if (modelType == "A")
U = HbyA + voidfraction*rAU*fvc::reconstruct((phig-p_rghEqn.flux()+phiSt)/rAUepsf) + rAU*Us*Ksl;
else
U = HbyA + rAU*fvc::reconstruct((phig-p_rghEqn.flux()+phiSt)/rAUepsf) + rAU*Us*Ksl;
U.correctBoundaryConditions();
fvOptions.correct(U);
}
}
#include "continuityErrs.H"
p == p_rgh + rho*gh;
if (p_rgh.needReference())
{
p += dimensionedScalar
(
"p",
p.dimensions(),
pRefValue - getRefCellValue(p, pRefCell)
);
p_rgh = p - rho*gh;
}
}

View File

@ -15,10 +15,10 @@ fvOptions.constrain(UEqn);
if (piso.momentumPredictor() && (modelType=="B" || modelType=="Bfull"))
{
solve(UEqn == - fvc::grad(p) + Ksl/rho*Us);
fvOptions.correct(U);
fvOptions.correct(U);
}
else if (piso.momentumPredictor())
{
solve(UEqn == - voidfraction*fvc::grad(p) + Ksl/rho*Us);
fvOptions.correct(U);
}
}

View File

@ -86,12 +86,12 @@ int main(int argc, char *argv[])
Ksl = particleCloud.momCoupleM(0).impMomSource();
Ksl.correctBoundaryConditions();
//Force Checks
vector fTotal(0,0,0);
vector fImpTotal = sum(mesh.V()*Ksl.internalField()*(Us.internalField()-U.internalField())).value();
reduce(fImpTotal, sumOp<vector>());
Info << "TotalForceExp: " << fTotal << endl;
Info << "TotalForceImp: " << fImpTotal << endl;
//Force Checks
vector fTotal(0,0,0);
vector fImpTotal = sum(mesh.V()*Ksl.internalField()*(Us.internalField()-U.internalField())).value();
reduce(fImpTotal, sumOp<vector>());
Info << "TotalForceExp: " << fTotal << endl;
Info << "TotalForceImp: " << fImpTotal << endl;
#include "solverDebugInfo.H"
particleCloud.clockM().stop("Coupling");

View File

@ -96,17 +96,17 @@
#define createPhi_H
Info<< "Reading/calculating face flux field phi\n" << endl;
surfaceScalarField phi
(
IOobject
(
(
IOobject
(
"phi",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
linearInterpolate(U*voidfraction) & mesh.Sf()
);
),
linearInterpolate(U*voidfraction) & mesh.Sf()
);
#endif
@ -123,4 +123,4 @@ surfaceScalarField phi
incompressible::turbulenceModel::New(U, phi, laminarTransport)
);
#include "createMRF.H"
#include "createMRF.H"

View File

@ -31,12 +31,12 @@ constrainPressure(p, Uvoidfraction, phiHbyA, rAUvoidfraction, MRF);
while (piso.correctNonOrthogonal())
{
// Pressure corrector
fvScalarMatrix pEqn
(
fvm::laplacian(rAUvoidfraction, p) == fvc::div(phi) + particleCloud.ddtVoidfraction()
);
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve(mesh.solver(p.select(piso.finalInnerIter())));
@ -55,4 +55,4 @@ else
U = HbyA - voidfraction*rAU*fvc::grad(p) + Ksl/rho*Us*rAU;
U.correctBoundaryConditions();
fvOptions.correct(U);
fvOptions.correct(U);

View File

@ -1,4 +1,4 @@
// get scalar source from DEM
// get scalar source from DEM
particleCloud.forceM(1).manipulateScalarField(Tsource);
Tsource.correctBoundaryConditions();
@ -12,4 +12,4 @@
Tsource
);
TEqn.relax();
TEqn.solve();
TEqn.solve();

View File

@ -81,23 +81,23 @@ int main(int argc, char *argv[])
{
particleCloud.smoothingM().smoothen(particleCloud.forceM(0).impParticleForces());
}
Info << "update Ksl.internalField()" << endl;
Ksl = particleCloud.momCoupleM(0).impMomSource();
Ksl.correctBoundaryConditions();
//Force Checks
vector fTotal(0,0,0);
vector fImpTotal = sum(mesh.V()*Ksl.internalField()*(Us.internalField()-U.internalField())).value();
reduce(fImpTotal, sumOp<vector>());
Info << "TotalForceExp: " << fTotal << endl;
Info << "TotalForceImp: " << fImpTotal << endl;
//Force Checks
vector fTotal(0,0,0);
vector fImpTotal = sum(mesh.V()*Ksl.internalField()*(Us.internalField()-U.internalField())).value();
reduce(fImpTotal, sumOp<vector>());
Info << "TotalForceExp: " << fTotal << endl;
Info << "TotalForceImp: " << fImpTotal << endl;
#include "solverDebugInfo.H"
particleCloud.clockM().stop("Coupling");
particleCloud.clockM().start(26,"Flow");
#include "TEqn.H"
if(particleCloud.solveFlow())

View File

@ -146,17 +146,17 @@
#define createPhi_H
Info<< "Reading/calculating face flux field phi\n" << endl;
surfaceScalarField phi
(
IOobject
(
(
IOobject
(
"phi",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
linearInterpolate(U*voidfraction) & mesh.Sf()
);
),
linearInterpolate(U*voidfraction) & mesh.Sf()
);
#endif
@ -173,4 +173,4 @@ surfaceScalarField phi
incompressible::turbulenceModel::New(U, phi, laminarTransport)
);
#include "createMRF.H"
#include "createMRF.H"

View File

@ -23,6 +23,9 @@
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
(
@ -51,6 +54,9 @@
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

@ -69,8 +69,8 @@ int main(int argc, char *argv[])
#include "checkModelType.H"
turbulence->validate();
// #include "compressibleCourantNo.H"
// #include "setInitialDeltaT.H"
//#include "compressibleCourantNo.H"
//#include "setInitialDeltaT.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -32,7 +32,7 @@ else
// + rhorAUf*fvc::ddtCorr(rho, U, phi)
)
);
// flux without pressure gradient contribution
phi = phiHbyA + phiUs;

View File

@ -14,4 +14,4 @@
fvOptions.correct(rho);
}
// ************************************************************************* //
// ************************************************************************* //

View File

@ -9,6 +9,10 @@ particleCloud.energyCoefficients(QCoeff);
thCond=particleCloud.thermCondM().thermCond();
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
(
fvm::ddt(rhoeps, he) + fvm::div(phi, he)
@ -45,7 +49,13 @@ fvScalarMatrix EEqn
thermo.correct();
Info<< "T max/min : " << max(T).value() << " " << min(T).value() << endl;
Info << "he min/max : " << max(he).value() << " " << min(he).value() << endl;
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;
Info << "he max/min : " << max(he).value() << " " << min(he).value() << endl;
particleCloud.clockM().start(31,"energySolve");
particleCloud.solve();
particleCloud.clockM().stop("energySolve");
}

View File

@ -52,7 +52,6 @@ Description
int main(int argc, char *argv[])
{
// #include "postProcess.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
@ -61,7 +60,6 @@ int main(int argc, char *argv[])
#include "createRDeltaT.H"
#include "createFields.H"
#include "createFieldRefs.H"
#include "createFvOptions.H"
#include "initContinuityErrs.H"

View File

@ -8,7 +8,6 @@
);
rhoReactionThermo& thermo = combustion->thermo();
thermo.validate(args.executable(), "h", "e");
basicSpecieMixture& composition = thermo.composition();
@ -34,6 +33,8 @@
}
volScalarField& p = thermo.p();
const volScalarField& T = thermo.T();
const volScalarField& psi = thermo.psi();
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
@ -57,9 +58,6 @@
);
// kinematic fields
Info<< "Reading field U\n" << endl;
volVectorField U
(
@ -88,18 +86,8 @@
mesh
);
volScalarField rhoeps
(
IOobject
(
"rhoeps",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
rho*voidfraction
);
volScalarField rhoeps ("rhoeps", rho*voidfraction);
Info<< "\nCreating fluid-particle heat flux field\n" << endl;
volScalarField Qsource
@ -282,9 +270,18 @@
mesh,
dimensionedScalar("zero",dimensionSet(0, -3, 0, 0, 1),0)
);
volScalarField dSauter
(
IOobject
(
"dSauter",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("zero",dimensionSet(0, 1, 0, 0, 0,0,0),0)
);
//===============================
// singlePhaseTransportModel laminarTransport(U, phi);

View File

@ -6,13 +6,13 @@
particleCloud.energyContributions(Qsource);
particleCloud.energyCoefficients(QCoeff);
//thDiff=particleCloud.thermCondM().thermDiff();
thCond=particleCloud.thermCondM().thermCond();
//thDiff=particleCloud.thermCondM().thermDiff();
thCond=particleCloud.thermCondM().thermCond();
addSource =
addSource =
(
he.name() == "e"
?
?
fvc::div(phi, K) +
fvc::div
(
@ -25,6 +25,9 @@
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
(

View File

@ -17,14 +17,12 @@ License
Copyright (C) 2015- Thomas Lichtenegger, JKU Linz, Austria
Application
cfdemSolverRhoPimple
cfdemSolverRhoSimple
Description
Transient solver for compressible flow using the flexible PIMPLE (PISO-SIMPLE)
algorithm.
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.
Steady-state solver for turbulent flow of compressible fluids based on
rhoSimpleFoam where functionality for CFD-DEM coupling has been added.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"

View File

@ -27,7 +27,7 @@ else
fvc::flux(rhoeps*HbyA)
)
);
// flux without pressure gradient contribution
phi = phiHbyA + phiUs;
@ -78,4 +78,4 @@ else
U.correctBoundaryConditions();
fvOptions.correct(U);
K = 0.5*magSqr(U);
K = 0.5*magSqr(U);

View File

@ -84,7 +84,7 @@ int main(int argc, char *argv[])
particleCloud.dataExchangeM().allocateArray(particleV_,0.,1);
particleCloud.get_cellIDs(cellIDs_); // get ref to cellIDs
//particleCloud.dataExchangeM().allocateArray(cellIDs_,0.,1);
while (runTime.loop())
{

View File

@ -28,7 +28,7 @@ Application
writeUfluidwriteUfluid
Description
Writes the the cell center fluid velocity to particles in the lagrangian
Writes the the cell center fluid velocity to particles in the lagrangian
time directory.
\*---------------------------------------------------------------------------*/
@ -76,13 +76,13 @@ int nParticle=0;
{
volVectorField U(UHeader,mesh);
passiveParticleCloud myCloud(mesh, cloudName);
myCloud.write();
myCloud.write();
nParticle = myCloud.size();
IOField<vector> Ufluid(myCloud.fieldIOobject("Ufluid",IOobject::NO_READ),nParticle);
IOField<vector> Ufluid(myCloud.fieldIOobject("Ufluid",IOobject::NO_READ),nParticle);
label i = 0;
forAllConstIter(passiveParticleCloud, myCloud, iter)
{
Ufluid[i]=U[iter().cell()];
Ufluid[i]=U[iter().cell()];
i++;
}
Ufluid.write();

View File

@ -189,7 +189,7 @@ cfdemCompLIG :pre
If the compilation fails with a message like
No rule to make target `/usr/lib/libpython2.7.so' :pre
No rule to make target '/usr/lib/libpython2.7.so' :pre
you probably need to create a symbolic link to the library in question.

View File

@ -38,7 +38,7 @@ models used for chemical reaction calculations.
"diffusionCoefficients"_chemistryModel_diffusionCoefficients.html,
"massTransferCoeff"_chemistryModel_massTransferCoeff.html,
"off"_chemistryModel_noChemistry.html,
reactantPerParticle,
"reactantPerParticle"_chemistryModel_reactantPerParticle.html,
"species"_chemistryModel_species.html :tb(c=2,ea=c)
@ -60,7 +60,8 @@ that performs the data exchange between the DEM code and the CFD code.
"oneWayVTK"_dataExchangeModel_oneWayVTK.html,
"twoWayFiles"_dataExchangeModel_twoWayFiles.html,
"twoWayMPI"_dataExchangeModel_twoWayMPI.html,
"twoWayMany2Many"_dataExchangeModel_twoWayMany2Many.html :tb(c=2,ea=c)
"twoWayMany2Many"_dataExchangeModel_twoWayMany2Many.html,
"twoWayOne2One"_dataExchangeModel_twoWayOne2One.html :tb(c=2,ea=c)
6.6 Energy models :h4
@ -94,11 +95,13 @@ Fines,
"fieldStore"_forceModel_fieldStore.html,
"fieldTimeAverage"_forceModel_fieldTimeAverage.html,
"gradPForce"_forceModel_gradPForce.html,
"gradPForceSmooth"_forceModel_gradPForceSmooth.html,
granKineticEnergy,
"interface"_forceModel_interface.html,
"noDrag"_forceModel_noDrag.html,
"particleCellVolume"_forceModel_particleCellVolume.html,
"pdCorrelation"_forceModel_pdCorrelation.html,
"surfaceTensionForce"_forceModel_surfaceTensionForce.html,
"virtualMassForce"_forceModel_virtualMassForce.html,
"viscForce"_forceModel_viscForce.html,
"volWeightedAverage"_forceModel_volWeightedAverage.html :tb(c=2,ea=c)
@ -188,7 +191,8 @@ The "smoothingModel"_smoothingModel.html keyword entry specifies the model for
smoothing the exchange fields.
"constDiffSmoothing"_smoothingModel_constDiffSmoothing.html,
"off"_smoothingModel_noSmoothing.html :tb(c=2,ea=c)
"off"_smoothingModel_noSmoothing.html,
"temporalSmoothing"_smoothingModel_temporalSmoothing.html :tb(c=2,ea=c)
6.16 Thermal conductivity models :h4

View File

@ -10,9 +10,10 @@
This section lists all CFDEMcoupling solvers alphabetically.
"cfdemSolverIB"_cfdemSolverIB.html,
"cfdemSolverMultiphase"_cfdemSolverMultiphase.html,
"cfdemSolverPiso"_cfdemSolverPiso.html,
"cfdemSolverPisoScalar"_cfdemSolverPisoScalar.html,
cfdemSolverRhoPimple,
cfdemSolverRhoPimpleChem,
cfdemSolverRhoSimple :tb(c=2,ea=c)
"cfdemSolverRhoPimple"_cfdemSolverRhoPimple.html,
"cfdemSolverRhoPimpleChem"_cfdemSolverRhoPimpleChem.html,
"cfdemSolverRhoSimple"_cfdemSolverRhoSimple.html :tb(c=2,ea=c)

View File

@ -0,0 +1,34 @@
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="{{ pathto(master_doc) }}">Docs</a> &raquo;</li>
{% for doc in parents %}
<li><a href="{{ doc.link|e }}">{{ doc.title }}</a> &raquo;</li>
{% endfor %}
<li>{{ title }}</li>
<li class="wy-breadcrumbs-aside">
{% if pagename != "search" %}
{% if display_github %}
<a href="https://{{ github_host|default("github.com") }}/{{ github_user }}/{{ github_repo }}/blob/{{ github_version }}{{ conf_py_path }}{{ pagename }}{{ source_suffix }}" class="fa fa-github"> Edit on GitHub</a>
{% elif display_bitbucket %}
<a href="https://bitbucket.org/{{ bitbucket_user }}/{{ bitbucket_repo }}/src/{{ bitbucket_version}}{{ conf_py_path }}{{ pagename }}{{ source_suffix }}" class="fa fa-bitbucket"> Edit on Bitbucket</a>
{% elif show_source and source_url_prefix %}
<a href="{{ source_url_prefix }}{{ pagename }}{{ source_suffix }}">View page source</a>
{% elif show_source and has_source and sourcename %}
<a href="{{ pathto('_sources/' + sourcename, true)|e }}" rel="nofollow"> View page source</a>
{% endif %}
<a href="https://www.cfdem.com">Website</a>
{% endif %}
</li>
</ul>
<hr/>
{% if next or prev %}
<div class="rst-footer-buttons" style="margin-bottom: 1em" role="navigation" aria-label="footer navigation">
{% if next %}
<a href="{{ next.link|e }}" class="btn btn-neutral float-right" title="{{ next.title|striptags|e }}" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a>
{% endif %}
{% if prev %}
<a href="{{ prev.link|e }}" class="btn btn-neutral" title="{{ prev.title|striptags|e }}" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</a>
{% endif %}
</div>
{% endif %}
</div>

36
doc/_themes/lammps_theme/footer.html vendored Normal file
View File

@ -0,0 +1,36 @@
<footer>
{% if next or prev %}
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
{% if next %}
<a href="{{ next.link|e }}" class="btn btn-neutral float-right" title="{{ next.title|striptags|e }}" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a>
{% endif %}
{% if prev %}
<a href="{{ prev.link|e }}" class="btn btn-neutral" title="{{ prev.title|striptags|e }}" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</a>
{% endif %}
</div>
{% endif %}
<hr/>
<div role="contentinfo">
<p>
{%- if show_copyright %}
{%- if hasdoc('copyright') %}
{% trans path=pathto('copyright'), copyright=copyright|e %}&copy; <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}
{%- else %}
{% trans copyright=copyright|e %}&copy; Copyright {{ copyright }}.{% endtrans %}
{%- endif %}
{%- endif %}
{%- if last_updated %}
{% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}
{%- endif %}
</p>
</div>
{%- if show_sphinx %}
{% trans %}Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>{% endtrans %}.
{%- endif %}
</footer>

195
doc/_themes/lammps_theme/layout.html vendored Normal file
View File

@ -0,0 +1,195 @@
{# TEMPLATE VAR SETTINGS #}
{%- set url_root = pathto('', 1) %}
{%- if url_root == '#' %}{% set url_root = '' %}{% endif %}
{%- if not embedded and docstitle %}
{%- set titlesuffix = " &mdash; "|safe + docstitle|e %}
{%- else %}
{%- set titlesuffix = "" %}
{%- endif %}
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
{{ metatags }}
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{% block htmltitle %}
<title>{{ title|striptags|e }}{{ titlesuffix }}</title>
{% endblock %}
{# FAVICON #}
{% if favicon %}
<link rel="shortcut icon" href="{{ pathto('_static/' + favicon, 1) }}"/>
{% endif %}
{# CSS #}
{# OPENSEARCH #}
{% if not embedded %}
{% if use_opensearch %}
<link rel="search" type="application/opensearchdescription+xml" title="{% trans docstitle=docstitle|e %}Search within {{ docstitle }}{% endtrans %}" href="{{ pathto('_static/opensearch.xml', 1) }}"/>
{% endif %}
{% endif %}
{# RTD hosts this file, so just load on non RTD builds #}
{% if not READTHEDOCS %}
<link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" />
{% endif %}
{% for cssfile in css_files %}
<link rel="stylesheet" href="{{ pathto(cssfile, 1) }}" type="text/css" />
{% endfor %}
{% for cssfile in extra_css_files %}
<link rel="stylesheet" href="{{ pathto(cssfile, 1) }}" type="text/css" />
{% endfor %}
{%- block linktags %}
{%- if hasdoc('about') %}
<link rel="author" title="{{ _('About these documents') }}"
href="{{ pathto('about') }}"/>
{%- endif %}
{%- if hasdoc('genindex') %}
<link rel="index" title="{{ _('Index') }}"
href="{{ pathto('genindex') }}"/>
{%- endif %}
{%- if hasdoc('search') %}
<link rel="search" title="{{ _('Search') }}" href="{{ pathto('search') }}"/>
{%- endif %}
{%- if hasdoc('copyright') %}
<link rel="copyright" title="{{ _('Copyright') }}" href="{{ pathto('copyright') }}"/>
{%- endif %}
<link rel="top" title="{{ docstitle|e }}" href="{{ pathto('index') }}"/>
{%- if parents %}
<link rel="up" title="{{ parents[-1].title|striptags|e }}" href="{{ parents[-1].link|e }}"/>
{%- endif %}
{%- if next %}
<link rel="next" title="{{ next.title|striptags|e }}" href="{{ next.link|e }}"/>
{%- endif %}
{%- if prev %}
<link rel="prev" title="{{ prev.title|striptags|e }}" href="{{ prev.link|e }}"/>
{%- endif %}
{%- endblock %}
{%- block extrahead %} {% endblock %}
{# Keep modernizr in head - http://modernizr.com/docs/#installing #}
<script src="{{ pathto('_static/js/modernizr.min.js', 1) }}"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
{# SIDE NAV, TOGGLES ON MOBILE #}
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
{% block sidebartitle %}
{% if logo and theme_logo_only %}
<a href="{{ pathto(master_doc) }}">
{% else %}
<a href="{{ pathto(master_doc) }}" class="icon icon-home"> {{ project }}
{% endif %}
{% if logo %}
{# Not strictly valid HTML, but it's the only way to display/scale it properly, without weird scripting or heaps of work #}
<img src="{{ pathto('_static/' + logo, 1) }}" class="logo" />
{% endif %}
</a>
{% if theme_display_version %}
{%- set nav_version = version %}
{% if READTHEDOCS and current_version %}
{%- set nav_version = current_version %}
{% endif %}
{% if nav_version %}
<div class="version">
{{ nav_version }}
</div>
{% endif %}
{% endif %}
{% include "searchbox.html" %}
{% endblock %}
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
{% block menu %}
{% set toctree = toctree(maxdepth=4, collapse=theme_collapse_navigation, includehidden=True) %}
{% if toctree %}
{{ toctree }}
{% else %}
<!-- Local TOC -->
<div class="local-toc">{{ toc }}</div>
{% endif %}
{% endblock %}
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
{# MOBILE NAV, TRIGGLES SIDE NAV ON TOGGLE #}
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="{{ pathto(master_doc) }}">{{ project }}</a>
</nav>
{# PAGE CONTENT #}
<div class="wy-nav-content">
<div class="rst-content">
{% include "breadcrumbs.html" %}
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
{% block body %}{% endblock %}
</div>
</div>
{% include "footer.html" %}
</div>
</div>
</section>
</div>
{% include "versions.html" %}
{% if not embedded %}
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'{{ url_root }}',
VERSION:'{{ release|e }}',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'{{ '' if no_search_suffix else file_suffix }}',
HAS_SOURCE: {{ has_source|lower }}
};
</script>
{%- for scriptfile in script_files %}
<script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script>
{%- endfor %}
{% endif %}
{# RTD hosts this file, so just load on non RTD builds #}
{% if not READTHEDOCS %}
<script type="text/javascript" src="{{ pathto('_static/js/theme.js', 1) }}"></script>
{% endif %}
{# STICKY NAVIGATION #}
{% if theme_sticky_navigation %}
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
{% endif %}
{%- block footer %} {% endblock %}
</body>
</html>

205
doc/_themes/lammps_theme/layout_old.html vendored Normal file
View File

@ -0,0 +1,205 @@
{#
basic/layout.html
~~~~~~~~~~~~~~~~~
Master layout template for Sphinx themes.
:copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
#}
{%- block doctype -%}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
{%- endblock %}
{%- set reldelim1 = reldelim1 is not defined and ' &raquo;' or reldelim1 %}
{%- set reldelim2 = reldelim2 is not defined and ' |' or reldelim2 %}
{%- set render_sidebar = (not embedded) and (not theme_nosidebar|tobool) and
(sidebars != []) %}
{%- set url_root = pathto('', 1) %}
{# XXX necessary? #}
{%- if url_root == '#' %}{% set url_root = '' %}{% endif %}
{%- if not embedded and docstitle %}
{%- set titlesuffix = " &mdash; "|safe + docstitle|e %}
{%- else %}
{%- set titlesuffix = "" %}
{%- endif %}
{%- macro relbar() %}
<div class="related">
<h3>{{ _('Navigation') }}</h3>
<ul>
{%- for rellink in rellinks %}
<li class="right" {% if loop.first %}style="margin-right: 10px"{% endif %}>
<a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags|e }}"
{{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a>
{%- if not loop.first %}{{ reldelim2 }}{% endif %}</li>
{%- endfor %}
{%- block rootrellink %}
<li><a href="{{ pathto(master_doc) }}">{{ shorttitle|e }}</a>{{ reldelim1 }}</li>
{%- endblock %}
{%- for parent in parents %}
<li><a href="{{ parent.link|e }}" {% if loop.last %}{{ accesskey("U") }}{% endif %}>{{ parent.title }}</a>{{ reldelim1 }}</li>
{%- endfor %}
{%- block relbaritems %} {% endblock %}
</ul>
</div>
{%- endmacro %}
{%- macro sidebar() %}
{%- if render_sidebar %}
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
{%- block sidebarlogo %}
{%- if logo %}
<p class="logo"><a href="{{ pathto(master_doc) }}">
<img class="logo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/>
</a></p>
{%- endif %}
{%- endblock %}
{%- if sidebars != None %}
{#- new style sidebar: explicitly include/exclude templates #}
{%- for sidebartemplate in sidebars %}
{%- include sidebartemplate %}
{%- endfor %}
{%- else %}
{#- old style sidebars: using blocks -- should be deprecated #}
{%- block sidebartoc %}
{%- include "localtoc.html" %}
{%- endblock %}
{%- block sidebarrel %}
{%- include "relations.html" %}
{%- endblock %}
{%- block sidebarsourcelink %}
{%- include "sourcelink.html" %}
{%- endblock %}
{%- if customsidebar %}
{%- include customsidebar %}
{%- endif %}
{%- block sidebarsearch %}
{%- include "searchbox.html" %}
{%- endblock %}
{%- endif %}
</div>
</div>
{%- endif %}
{%- endmacro %}
{%- macro script() %}
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '{{ url_root }}',
VERSION: '{{ release|e }}',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '{{ '' if no_search_suffix else file_suffix }}',
HAS_SOURCE: {{ has_source|lower }}
};
</script>
{%- for scriptfile in script_files %}
<script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script>
{%- endfor %}
{%- endmacro %}
{%- macro css() %}
<link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" />
<link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" />
{%- for cssfile in css_files %}
<link rel="stylesheet" href="{{ pathto(cssfile, 1) }}" type="text/css" />
{%- endfor %}
{%- endmacro %}
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={{ encoding }}" />
{{ metatags }}
{%- block htmltitle %}
<title>{{ title|striptags|e }}{{ titlesuffix }}</title>
{%- endblock %}
{{ css() }}
{%- if not embedded %}
{{ script() }}
{%- if use_opensearch %}
<link rel="search" type="application/opensearchdescription+xml"
title="{% trans docstitle=docstitle|e %}Search within {{ docstitle }}{% endtrans %}"
href="{{ pathto('_static/opensearch.xml', 1) }}"/>
{%- endif %}
{%- if favicon %}
<link rel="shortcut icon" href="{{ pathto('_static/' + favicon, 1) }}"/>
{%- endif %}
{%- endif %}
{%- block linktags %}
{%- if hasdoc('about') %}
<link rel="author" title="{{ _('About these documents') }}" href="{{ pathto('about') }}" />
{%- endif %}
{%- if hasdoc('genindex') %}
<link rel="index" title="{{ _('Index') }}" href="{{ pathto('genindex') }}" />
{%- endif %}
{%- if hasdoc('search') %}
<link rel="search" title="{{ _('Search') }}" href="{{ pathto('search') }}" />
{%- endif %}
{%- if hasdoc('copyright') %}
<link rel="copyright" title="{{ _('Copyright') }}" href="{{ pathto('copyright') }}" />
{%- endif %}
<link rel="top" title="{{ docstitle|e }}" href="{{ pathto('index') }}" />
{%- if parents %}
<link rel="up" title="{{ parents[-1].title|striptags|e }}" href="{{ parents[-1].link|e }}" />
{%- endif %}
{%- if next %}
<link rel="next" title="{{ next.title|striptags|e }}" href="{{ next.link|e }}" />
{%- endif %}
{%- if prev %}
<link rel="prev" title="{{ prev.title|striptags|e }}" href="{{ prev.link|e }}" />
{%- endif %}
{%- endblock %}
{%- block extrahead %} {% endblock %}
</head>
<body>
{%- block header %}{% endblock %}
{%- block relbar1 %}{{ relbar() }}{% endblock %}
{%- block content %}
{%- block sidebar1 %} {# possible location for sidebar #} {% endblock %}
<div class="document">
{%- block document %}
<div class="documentwrapper">
{%- if render_sidebar %}
<div class="bodywrapper">
{%- endif %}
<div class="body">
{% block body %} {% endblock %}
</div>
{%- if render_sidebar %}
</div>
{%- endif %}
</div>
{%- endblock %}
{%- block sidebar2 %}{{ sidebar() }}{% endblock %}
<div class="clearer"></div>
</div>
{%- endblock %}
{%- block relbar2 %}{{ relbar() }}{% endblock %}
{%- block footer %}
<div class="footer">
{%- if show_copyright %}
{%- if hasdoc('copyright') %}
{% trans path=pathto('copyright'), copyright=copyright|e %}&copy; <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}
{%- else %}
{% trans copyright=copyright|e %}&copy; Copyright {{ copyright }}.{% endtrans %}
{%- endif %}
{%- endif %}
{%- if last_updated %}
{% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}
{%- endif %}
{%- if show_sphinx %}
{% trans sphinx_version=sphinx_version|e %}Created using <a href="http://sphinx-doc.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %}
{%- endif %}
</div>
<p>asdf asdf asdf asdf 22</p>
{%- endblock %}
</body>
</html>

50
doc/_themes/lammps_theme/search.html vendored Normal file
View File

@ -0,0 +1,50 @@
{#
basic/search.html
~~~~~~~~~~~~~~~~~
Template for the search page.
:copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
#}
{%- extends "layout.html" %}
{% set title = _('Search') %}
{% set script_files = script_files + ['_static/searchtools.js'] %}
{% block footer %}
<script type="text/javascript">
jQuery(function() { Search.loadIndex("{{ pathto('searchindex.js', 1) }}"); });
</script>
{# this is used when loading the search index using $.ajax fails,
such as on Chrome for documents on localhost #}
<script type="text/javascript" id="searchindexloader"></script>
{{ super() }}
{% endblock %}
{% block body %}
<noscript>
<div id="fallback" class="admonition warning">
<p class="last">
{% trans %}Please activate JavaScript to enable the search
functionality.{% endtrans %}
</p>
</div>
</noscript>
{% if search_performed %}
<h2>{{ _('Search Results') }}</h2>
{% if not search_results %}
<p>{{ _('Your search did not match any documents. Please make sure that all words are spelled correctly and that you\'ve selected enough categories.') }}</p>
{% endif %}
{% endif %}
<div id="search-results">
{% if search_results %}
<ul>
{% for href, caption, context in search_results %}
<li>
<a href="{{ pathto(item.href) }}">{{ caption }}</a>
<p class="context">{{ context|e }}</p>
</li>
{% endfor %}
</ul>
{% endif %}
</div>
{% endblock %}

View File

@ -0,0 +1,9 @@
{%- if builder != 'singlehtml' %}
<div role="search">
<form id="rtd-search-form" class="wy-form" action="{{ pathto('search') }}" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
{%- endif %}

37
doc/_themes/lammps_theme/versions.html vendored Normal file
View File

@ -0,0 +1,37 @@
{% if READTHEDOCS %}
{# Add rst-badge after rst-versions for small badge style. #}
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions">
<span class="rst-current-version" data-toggle="rst-current-version">
<span class="fa fa-book"> Read the Docs</span>
v: {{ current_version }}
<span class="fa fa-caret-down"></span>
</span>
<div class="rst-other-versions">
<dl>
<dt>Versions</dt>
{% for slug, url in versions %}
<dd><a href="{{ url }}">{{ slug }}</a></dd>
{% endfor %}
</dl>
<dl>
<dt>Downloads</dt>
{% for type, url in downloads %}
<dd><a href="{{ url }}">{{ type }}</a></dd>
{% endfor %}
</dl>
<dl>
<dt>On Read the Docs</dt>
<dd>
<a href="//{{ PRODUCTION_DOMAIN }}/projects/{{ slug }}/?fromdocs={{ slug }}">Project Home</a>
</dd>
<dd>
<a href="//{{ PRODUCTION_DOMAIN }}/builds/{{ slug }}/?fromdocs={{ slug }}">Builds</a>
</dd>
</dl>
<hr/>
Free document hosting provided by <a href="http://www.readthedocs.org">Read the Docs</a>.
</div>
</div>
{% endif %}

View File

@ -0,0 +1,62 @@
<!-- HTML_ONLY -->
<HEAD>
<META CHARSET="utf-8">
</HEAD>
<!-- END_HTML_ONLY -->
"CFDEMproject Website"_lws - "Main Page"_main :c
:link(lws,http://www.cfdem.com)
:link(main,CFDEMcoupling_Manual.html)
:line
cfdemSolverMultiphase command :h3
[Description:]
<!-- HTML_ONLY -->
"cfdemSolverMultiphase" is a coupled CFD-DEM solver using the CFDEMcoupling framework. Based on the OpenFOAM solver multiphaseInterFoam&reg;(*) it has functionality to simulate several fluids using the Volume of Fluid approach, coupled with the DEM code LIGGGHTS for solid particles.
<!-- END_HTML_ONLY -->
<!-- RST
"cfdemSolverMultiphase" is a coupled CFD-DEM solver using the CFDEMcoupling framework. Based on the OpenFOAM solver multiphaseInterFoam\ |reg|\ (*) it has functionality to simulate several fluids using the Volume of Fluid approach, coupled with the DEM code LIGGGHTS for solid particles.
.. |reg| unicode:: U+000AE .. REGISTERED SIGN
END_RST -->
For more details, see "Vångö et al. (2018)"_#Vångö2018.
:line
:link(Vångö2018)
[(Vångö2018)] M. Vångö, S. Pirker, T. Lichtenegger. (2018):
"Unresolved CFD-DEM modeling of multiphase flow in densely packed particle beds",
Applied Mathematical Modelling
:line
<!-- HTML_ONLY -->
NOTE:
(*) This offering is not approved or endorsed by OpenCFD Limited, producer and
distributor of the OpenFOAM software via www.openfoam.com, and owner of the
OPENFOAM&reg; and OpenCFD&reg; trade marks.
OPENFOAM&reg; is a registered trade mark of OpenCFD Limited, producer and
distributor of the OpenFOAM software via www.openfoam.com.
<!-- END_HTML_ONLY -->
<!-- RST
.. note::
(*) This offering is not approved or endorsed by OpenCFD Limited, producer
and distributor of the OpenFOAM software via www.openfoam.com, and owner of
the OPENFOAM\ |reg| and OpenCFD\ |reg| trade marks.
OPENFOAM\ |reg| is a registered trade mark of OpenCFD Limited, producer and
distributor of the OpenFOAM software via www.openfoam.com.
.. |reg| unicode:: U+000AE .. REGISTERED SIGN
END_RST -->

View File

@ -0,0 +1,59 @@
<!-- HTML_ONLY -->
<HEAD>
<META CHARSET="utf-8">
</HEAD>
<!-- END_HTML_ONLY -->
"CFDEMproject Website"_lws - "Main Page"_main :c
:link(lws,http://www.cfdem.com)
:link(main,CFDEMcoupling_Manual.html)
:line
cfdemSolverRhoPimple command :h3
[Description:]
<!-- HTML_ONLY -->
"cfdemSolverRhoPimple" is a coupled CFD-DEM solver using the CFDEMcoupling
framework. Based on the OpenFOAM&reg;(*) solver rhoPimpleFoam, this is a
transient solver for compressible flow using the flexible PIMPLE (PISO-SIMPLE)
algorithm, coupled with the DEM code LIGGGHTS for solid particles.
<!-- END_HTML_ONLY -->
<!-- RST
"cfdemSolverRhoPimple" is a coupled CFD-DEM solver using the CFDEMcoupling
framework. Based on the OpenFOAM\ |reg|\ (*) solver rhoPimpleFoam, this is a
transient solver for compressible flow using the flexible PIMPLE (PISO-SIMPLE)
algorithm, coupled with the DEM code LIGGGHTS for solid particles.
.. |reg| unicode:: U+000AE .. REGISTERED SIGN
END_RST -->
:line
<!-- HTML_ONLY -->
NOTE:
(*) This offering is not approved or endorsed by OpenCFD Limited, producer and
distributor of the OpenFOAM software via www.openfoam.com, and owner of the
OPENFOAM&reg; and OpenCFD&reg; trade marks.
OPENFOAM&reg; is a registered trade mark of OpenCFD Limited, producer and
distributor of the OpenFOAM software via www.openfoam.com.
<!-- END_HTML_ONLY -->
<!-- RST
.. note::
(*) This offering is not approved or endorsed by OpenCFD Limited, producer
and distributor of the OpenFOAM software via www.openfoam.com, and owner of
the OPENFOAM\ |reg| and OpenCFD\ |reg| trade marks.
OPENFOAM\ |reg| is a registered trade mark of OpenCFD Limited, producer and
distributor of the OpenFOAM software via www.openfoam.com.
.. |reg| unicode:: U+000AE .. REGISTERED SIGN
END_RST -->

View File

@ -0,0 +1,63 @@
<!-- HTML_ONLY -->
<HEAD>
<META CHARSET="utf-8">
</HEAD>
<!-- END_HTML_ONLY -->
"CFDEMproject Website"_lws - "Main Page"_main :c
:link(lws,http://www.cfdem.com)
:link(main,CFDEMcoupling_Manual.html)
:line
cfdemSolverRhoPimpleChem command :h3
[Description:]
<!-- HTML_ONLY -->
"cfdemSolverRhoPimpleChem" is a coupled CFD-DEM solver using the CFDEMcoupling
framework. Based on the OpenFOAM&reg;(*) solver rhoPimpleFoam, this is a
transient solver for compressible flow using the flexible PIMPLE (PISO-SIMPLE)
algorithm, coupled with the DEM code LIGGGHTS for solid particles.
Compared to cfdemSolverRhoPimple this solver adds functionality for chemical
reactions.
<!-- END_HTML_ONLY -->
<!-- RST
"cfdemSolverRhoPimpleChem" is a coupled CFD-DEM solver using the CFDEMcoupling
framework. Based on the OpenFOAM\ |reg|\ (*) solver rhoPimpleFoam, this is a
transient solver for compressible flow using the flexible PIMPLE (PISO-SIMPLE)
algorithm, coupled with the DEM code LIGGGHTS for solid particles.
Compared to cfdemSolverRhoPimple this solver adds functionality for chemical
reactions.
.. |reg| unicode:: U+000AE .. REGISTERED SIGN
END_RST -->
:line
<!-- HTML_ONLY -->
NOTE:
(*) This offering is not approved or endorsed by OpenCFD Limited, producer and
distributor of the OpenFOAM software via www.openfoam.com, and owner of the
OPENFOAM&reg; and OpenCFD&reg; trade marks.
OPENFOAM&reg; is a registered trade mark of OpenCFD Limited, producer and
distributor of the OpenFOAM software via www.openfoam.com.
<!-- END_HTML_ONLY -->
<!-- RST
.. note::
(*) This offering is not approved or endorsed by OpenCFD Limited, producer
and distributor of the OpenFOAM software via www.openfoam.com, and owner of
the OPENFOAM\ |reg| and OpenCFD\ |reg| trade marks.
OPENFOAM\ |reg| is a registered trade mark of OpenCFD Limited, producer and
distributor of the OpenFOAM software via www.openfoam.com.
.. |reg| unicode:: U+000AE .. REGISTERED SIGN
END_RST -->

View File

@ -0,0 +1,59 @@
<!-- HTML_ONLY -->
<HEAD>
<META CHARSET="utf-8">
</HEAD>
<!-- END_HTML_ONLY -->
"CFDEMproject Website"_lws - "Main Page"_main :c
:link(lws,http://www.cfdem.com)
:link(main,CFDEMcoupling_Manual.html)
:line
cfdemSolverRhoSimple command :h3
[Description:]
<!-- HTML_ONLY -->
"cfdemSolverRhoSimple" is a coupled CFD-DEM solver using the CFDEMcoupling
framework. Based on the OpenFOAM&reg;(*) solver rhoSimpleFoam, this is a
steady-state solver for turbulent flow of compressible fluids coupled with the
DEM code LIGGGHTS for solid particles.
<!-- END_HTML_ONLY -->
<!-- RST
"cfdemSolverRhoSimple" is a coupled CFD-DEM solver using the CFDEMcoupling
framework. Based on the OpenFOAM\ |reg|\ (*) solver rhoSimpleFoam, this is a
steady-state solver for turbulent flow of compressible fluids coupled with the
DEM code LIGGGHTS for solid particles.
.. |reg| unicode:: U+000AE .. REGISTERED SIGN
END_RST -->
:line
<!-- HTML_ONLY -->
NOTE:
(*) This offering is not approved or endorsed by OpenCFD Limited, producer and
distributor of the OpenFOAM software via www.openfoam.com, and owner of the
OPENFOAM&reg; and OpenCFD&reg; trade marks.
OPENFOAM&reg; is a registered trade mark of OpenCFD Limited, producer and
distributor of the OpenFOAM software via www.openfoam.com.
<!-- END_HTML_ONLY -->
<!-- RST
.. note::
(*) This offering is not approved or endorsed by OpenCFD Limited, producer
and distributor of the OpenFOAM software via www.openfoam.com, and owner of
the OPENFOAM\ |reg| and OpenCFD\ |reg| trade marks.
OPENFOAM\ |reg| is a registered trade mark of OpenCFD Limited, producer and
distributor of the OpenFOAM software via www.openfoam.com.
.. |reg| unicode:: U+000AE .. REGISTERED SIGN
END_RST -->

View File

@ -23,7 +23,7 @@ diffusionCoefficientsProps
diffusantGasNames ( speciesNames );
\} :pre
{switch1} = (optional, normally off) flag to give information :ulb,l
{switch1} = (optional, default false) flag to output verbose information :ulb,l
{ChemistryFile} = path to file, where the reacting species are listed :l
{diffusantGasNames} = list of gas field names that are the reactant gases :l
:ule

View File

@ -21,7 +21,7 @@ massTransferCoeffProps
verbose switch1;
\} :pre
{switch1} = (optional, normally off) flag to give information :l
{switch1} = (optional, default false) flag to output verbose information :l
:ule
[Examples:]

View File

@ -0,0 +1,54 @@
"CFDEMproject Website"_lws - "Main Page"_main :c
:link(lws,http://www.cfdem.com)
:link(main,CFDEMcoupling_Manual.html)
:line
chemistryModel reactantPerParticle command :h3
[Syntax:]
Defined in "couplingProperties"_CFDEMcoupling_dicts.html#couplingProperties
dictionary.
chemistryModels
(
reactantPerParticle
);
reactantPerParticleProps
\{
voidfractionFieldName "voidfraction";
Nevery number1;
\} :pre
{voidfraction} = (optional, default "voidfraction") name of the finite volume void fraction field :l
{number1} = (optional, default 1) number to adjust execution interval :l
:ule
[Examples:]
chemistryModels
(
reactantPerParticle
);
reactantPerParticleProps
\{
voidfractionFieldName "voidfraction";
Nevery 1;
\} :pre
[Description:]
The chemistry model performs the calculation of chemical reactional effects
acting on each DEM particle. The reactantPerParticle model is the model to
communicate the available reactant per particle.
[Restrictions:]
none
[Related commands:]
"chemistryModel"_chemistryModel.html

View File

@ -26,16 +26,18 @@ speciesProps
partTempName "partTemp";
partRhoName "partRho";
verbose switch1;
Nevery number1;
\} :pre
{ChemistryFile} = path to file, where the reacting species are listed :ulb,l
{T} = name of the finite volume temperature field, it is already added in default and doesn't need to be specified if name is the same :l
{rho} = name of the finite volume density field, it is already added in default and doesn't need to be specified if name is the same :l
{voidfraction} = name of the finite volume void fraction field, it is already added in default and doesn't need to be specified if name is the same :l
{molarConc} = name of the finite volume molar concentration field, it is already added in default and doesn't need to be specified if name is the same :l
{partTemp} = name of the finite volume cell averaged particle temperature field, it is already added in default and doesn't need to be specified if name is the same :l
{partRho} = name of the finite volume cell averaged density temperature field, it is already added in default and doesn't need to be specified if name is the same :l
{switch1} = (optional, normally off) flag to give information :l
{T} = (optional, default "T") name of the finite volume temperature field :l
{rho} = (optional, default "rho") name of the finite volume density field :l
{voidfraction} = (optional, default "voidfraction") name of the finite volume void fraction field :l
{molarConc} = (optional, default "molarConc") name of the finite volume molar concentration field :l
{partTemp} = (optional, default "partTemp") name of the finite volume cell averaged particle temperature field :l
{partRho} = (optional, default "partRho") name of the finite volume cell averaged density temperature field :l
{switch1} = (optional, default false) flag to output verbose information :l
{number1} = (optional, default 1) number to adjust execution interval :l
:ule
[Examples:]

View File

@ -0,0 +1,47 @@
"CFDEMproject WWW Site"_lws - "CFDEM Commands"_lc :c
:link(lws,http://www.cfdem.com)
:link(lc,CFDEMcoupling_Manual.html#comm)
:line
dataExchangeModel_twoWayOne2One command :h3
[Syntax:]
Defined in couplingProperties dictionary.
dataExchangeModel twoWayOne2One;
twoWayOne2OneProps
\{
liggghtsPath "path";
useStaticProcMap switch1;
\}; :pre
{path} = path to the DEM simulation input file :ulb,l
{switch1} = (optional, default no) switch to determine if the map is built once (yes) or every coupling step (no) :l
:ule
[Examples:]
dataExchangeModel twoWayOne2One;
twoWayOne2OneProps
\{
liggghtsPath "../DEM/in.liggghts_init";
useStaticProcMap yes;
\} :pre
[Description:]
The data exchange model performs the data exchange between the DEM code and the CFD code. The twoWayOne2One model is a model that can exchange particle properties from DEM to CFD and from CFD to DEM. Data is exchanged via MPI technique using a more sophisticated mapping scheme than twoWayMPI / all2all and scales much better for large systems and many cores. The DEM run is executed by the coupling model, via a liggghtsCommandModel object. Only use staticProcMap yes if no load balancing is employed.
[Restrictions:]
Must be used in combination with the engineSearchMany2Many locate model! Use the "one2one" cfd datacoupling option in fix couple/cfd in LIGGGHTS!
Some warnings may be given for particles that have not been located - this is due to LIGGGHTS' treatment of domain crossers.
[Related commands:]
"dataExchangeModel"_dataExchangeModel.html

View File

@ -0,0 +1,77 @@
"CFDEMproject Website"_lws - "Main Page"_main :c
:link(lws,http://www.cfdem.com)
:link(main,CFDEMcoupling_Manual.html)
:line
forceModel gradPForceSmooth command :h3
[Syntax:]
Defined in "couplingProperties"_CFDEMcoupling_dicts.html#couplingProperties
dictionary.
forceModels
(
gradPForceSmooth;
);
gradPForceSmoothProps
\{
pFieldName "pressure";
velocityFieldName "U";
useAddedMass scalar1;
treatForceExplicit switch1;
treatForceDEM switch2;
interpolation switch3;
smoothingModel "smoothingModel";
\} :pre
{pressure} = name of the finite volume fluid pressure field :ulb,l
{U} = name of the finite volume fluid velocity field :l
{scalar1} = (optional, default 0) coefficient of added mass accounted for :l
{switch1} = (optional, default false) sub model switch, see "forceSubModel"_forceSubModel.html for details :l
{switch2} = (optional, default false) sub model switch, see "forceSubModel"_forceSubModel.html for details :l
{switch3} = (optional, default false) flag to use interpolated pressure values :l
{smoothingModel} = name of smoothing model :l
:ule
[Examples:]
forceModels
(
gradPForceSmooth;
);
gradPForceSmoothProps
\{
pFieldName "p_rgh";
velocityFieldName "U";
interpolation false;
smoothingModel "temporalSmoothing";
temporalSmoothingProps
\{
lowerLimit 0.1;
upperLimit 1e10;
refField "p_rgh";
gamma 1.0;
\} :pre
\} :pre
[Description:]
The {gradPForceSmooth} model calculates the particle based pressure gradient
force identically to the "gradPForce"_forceModel_gradPForce.html model but
allows smoothing of the pressure prior to the force calculation (without
altering the original pressure field).
Any smoothing model can be used and does not have to be the same as specified in
couplingProperties. Properties for the smoothing model have to be specified in a
sub-dictionary within {gradPForceSmoothProps}.
[Restrictions:]
A volScalarField "pSmooth" MUST be specified in the initial time directory!
[Related commands:]
"forceModel"_forceModel.html, "gradPForce"_forceModel_gradPForce.html

View File

@ -0,0 +1,55 @@
"CFDEMproject Website"_lws - "Main Page"_main :c
:link(lws,http://www.cfdem.com)
:link(main,CFDEMcoupling_Manual.html)
:line
forceModel surfaceTensionForce command :h3
[Syntax:]
Defined in "couplingProperties"_CFDEMcoupling_dicts.html#couplingProperties
dictionary.
forceModels
(
surfaceTensionForce;
);
surfaceTensionForceProps
\{
stfFieldName "surfaceTensionField";
\} :pre
{surfaceTensionField} = name of the surface tension force field :ulb,l
:ule
[Examples:]
forceModels
(
surfaceTensionForce;
);
surfaceTensionForceProps
\{
stfFieldName "surfaceTensionForce";
\} :pre
[Description:]
The force model calculates the surface tension force acting on each DEM particle
based on a pre-calculated surface tension force as V_particle * F^sigma. When
used in conjunction with the "cfdemSolverMultiphase"_cfdemSolverMultiphase.html
solver, the surface tension force is calculated with the CSF (continuum surface
force) model (see Brackbill et al. (1992): "A continuum method for modeling
surface tension", J. Comput. Phys.).
[Restrictions:]
Has to be used with a multiphase solver that calculates the surface tension
force, e.g. {cfdemSolverMultiphase}.
[Related commands:]
"forceModel"_forceModel.html, "cfdemSolverMultiphase"_cfdemSolverMultiphase.html

View File

@ -0,0 +1,62 @@
"CFDEMproject Website"_lws - "Main Page"_main :c
:link(lws,http://www.cfdem.com)
:link(main,CFDEMcoupling_Manual.html)
:line
smoothingModel temporalSmoothing command :h3
[Syntax:]
Defined in dictionary depending on the application.
smoothingModel temporalSmoothing;
temporalSmoothingProps
\{
lowerLimit number1;
upperLimit number2;
refField referenceField;
gamma smoothingStrength;
\} :pre
{number1} = scalar fields will be bound to this lower value :ulb,l
{number2} = scalar fields will be bound to this upper value :l
{referenceField} = reference to the un-smoothed field required for the relaxation operation :l
{smoothingStrength} = control parameter for the smoothing, lower value yields stronger smoothing (gamma = 1 results in an equal contribution from the un-smoothed and smoothed fields) :l
:ule
[Examples:]
temporalSmoothingProps
\{
lowerLimit 0.1;
upperLimit 1e10;
referenceField "p";
gamma 1.0;
\} :pre
[Description:]
The {temporalSmoothing} model is a smoothing model that utilizes temporal
relaxation of a desired quantity. This model can be used to filter out
high-frequency fluctuations (e.g. numerical noise) controlled via the control
parameter gamma.
Note that this model does NOT smooth the calculated fields, instead smoothing is
performed on a separate (smooth) field which uses the calculated (un-smooth)
field as a reference.
Thus its usage is limited and CANNOT be used to smooth the exchange fields
similar to other smoothing models.
For further information see Vångö et al., "Unresolved CFD-DEM modeling of
multiphase flow in densely packed particle beds", Appl. Math. Model. (2018).
[Restrictions:]
This model does NOT smooth the calculated fields and can therefore NOT be used
as a general smoothing model to smoothen the exchange fields.
Attempting this will generate an error.
[Related commands:]
"smoothingModel"_smoothingModel.html

View File

@ -17,7 +17,7 @@
#------------------------------------------------------------------------------
export CFDEM_PROJECT=CFDEM
export CFDEM_VERSION=18.10
export CFDEM_VERSION=19.09
################################################################################
# USER EDITABLE PART: Changes made here may be lost with the next upgrade

View File

@ -15,7 +15,7 @@
#------------------------------------------------------------------------------
setenv CFDEM_PROJECT CFDEM
setenv CFDEM_VERSION 18.10
setenv CFDEM_VERSION 19.09
################################################################################
# USER EDITABLE PART: Changes made here may be lost with the next upgrade

View File

@ -1,3 +1,4 @@
lagrangian/cfdemParticle/dir
lagrangian/cfdemParticleComp/dir
finiteVolume/dir
../applications/solvers/cfdemSolverMultiphase/multiphaseMixture/dir

View File

@ -5,3 +5,4 @@ cfdemSolverRhoSimple/dir
cfdemSolverIB/dir
cfdemSolverPisoScalar/dir
cfdemSolverRhoPimpleChem/dir
cfdemSolverMultiphase/dir

View File

@ -80,6 +80,8 @@ $(forceModels)/Fines/FanningDynFines.C
$(forceModels)/Fines/ErgunStatFines.C
$(forceModels)/granKineticEnergy/granKineticEnergy.C
$(forceModels)/pdCorrelation/pdCorrelation.C
$(forceModels)/surfaceTensionForce/surfaceTensionForce.C
$(forceModels)/gradPForceSmooth/gradPForceSmooth.C
$(forceModelsMS)/forceModelMS/forceModelMS.C
$(forceModelsMS)/forceModelMS/newForceModelMS.C
@ -147,6 +149,8 @@ $(dataExchangeModels)/oneWayVTK/oneWayVTK.C
$(dataExchangeModels)/twoWayFiles/twoWayFiles.C
$(dataExchangeModels)/noDataExchange/noDataExchange.C
$(dataExchangeModels)/twoWayMPI/twoWayMPI.C
$(dataExchangeModels)/twoWayOne2One/twoWayOne2One.C
$(dataExchangeModels)/twoWayOne2One/one2one.C
$(averagingModels)/averagingModel/averagingModel.C
$(averagingModels)/averagingModel/newAveragingModel.C
@ -169,5 +173,6 @@ $(smoothingModels)/smoothingModel/smoothingModel.C
$(smoothingModels)/smoothingModel/newSmoothingModel.C
$(smoothingModels)/noSmoothing/noSmoothing.C
$(smoothingModels)/constDiffSmoothing/constDiffSmoothing.C
$(smoothingModels)/temporalSmoothing/temporalSmoothing.C
LIB = $(CFDEM_LIB_DIR)/lib$(CFDEM_LIB_NAME)

View File

@ -34,6 +34,4 @@ LIB_LIBS = \
-lmpi_cxx \
-Wl,-rpath,$(CFDEM_LIGGGHTS_BIN_DIR) \
-L$(CFDEM_LIGGGHTS_BIN_DIR) \
-lliggghts \
-L$(CFDEM_Many2ManyLIB_PATH) \
-lcoupleMany2Many
-lliggghts

View File

@ -21,7 +21,7 @@
found=false;
forAll(particleCloud.forceModels(),i)
{
if(particleCloud.forceModels()[i]=="gradPForce")
if(particleCloud.forceModels()[i]=="gradPForce" || particleCloud.forceModels()[i]=="gradPForceSmooth")
found=true;
}
if(!found)
@ -56,7 +56,7 @@
found=false;
forAll(particleCloud.forceModels(),i)
{
if(particleCloud.forceModels()[i]=="gradPForce" || particleCloud.forceModels()[i]=="viscForce")
if(particleCloud.forceModels()[i]=="gradPForce" || particleCloud.forceModels()[i]=="gradPForceSmooth" || particleCloud.forceModels()[i]=="viscForce")
found=true;
}
if(found)
@ -80,7 +80,7 @@
found=false;
forAll(particleCloud.forceModels(),i)
{
if(particleCloud.forceModels()[i]=="gradPForce")
if(particleCloud.forceModels()[i]=="gradPForce" || particleCloud.forceModels()[i]=="gradPForceSmooth")
found=true;
}
if(!found)
@ -99,3 +99,6 @@
Warning << "You chose model type -none- you might get erroneous results!" << endl;
else
FatalError <<"no suitable model type specified:" << modelType << "\n" << abort(FatalError);
if (particleCloud.smoothingM().type() == "temporalSmoothing")
FatalError << "the temporalSmoothing model does not support smoothing of the exchange fields, please see documentation!" << endl;

View File

@ -34,12 +34,12 @@ Description
#ifndef versionInfo_H
#define versionInfo_H
word CFDEMversion="PFM 18.10";
word compatibleLIGGGHTSversion="PFM 18.10";
word CFDEMversion="PFM 19.09";
word compatibleLIGGGHTSversion="PFM 19.09";
word OFversion="4.x";
Info << "\nCFDEMcoupling version: " << CFDEMversion << endl;
Info << ", compatible to LIGGGHTS version: " << compatibleLIGGGHTSversion << endl;
Info << ", compatible to OpenFOAM version: " << OFversion << endl;
Info << "compatible to LIGGGHTS version: " << compatibleLIGGGHTSversion << endl;
Info << "compatible to OpenFOAM version: " << OFversion << endl;
#endif

View File

@ -45,6 +45,7 @@ Description
#include "smoothingModel.H"
#include "liggghtsCommandModel.H"
#include "otherForceModel.H"
#include "IOmanip.H"
namespace Foam
{
@ -665,16 +666,14 @@ bool cfdemCloud::evolve
}
//============================================
//CHECK JUST TIME-INTERPOATE ALREADY SMOOTHENED VOIDFRACTIONNEXT AND UsNEXT FIELD
//CHECK JUST TIME-INTERPOLATE ALREADY SMOOTHENED VOIDFRACTIONNEXT AND UsNEXT FIELD
// IMPLICIT FORCE CONTRIBUTION AND SOLVER USE EXACTLY THE SAME AVERAGED
// QUANTITIES AT THE GRID!
scalar timeStepFrac = dataExchangeM().timeStepFraction();
const scalar timeStepFrac = dataExchangeM().timeStepFraction();
int old_precision = Info().precision(10);
Info << "\n timeStepFraction() = " << timeStepFrac << endl;
if(timeStepFrac > 1.0000001)
{
// FatalError << "cfdemCloud::dataExchangeM().timeStepFraction()>1: Do not do this, since dangerous. This might be due to the fact that you used a adjustable CFD time step. Please use a fixed CFD time step." << abort(FatalError);
Warning << "cfdemCloud::dataExchangeM().timeStepFraction() = " << timeStepFrac << endl;
}
Info().precision(old_precision);
clockM().start(24,"interpolateEulerFields");
// update voidFractionField

View File

@ -72,24 +72,12 @@ diffusionCoefficient::diffusionCoefficient
P_(sm.mesh().lookupObject<volScalarField>(pressureFieldName_)),
partPressureName_(propsDict_.lookupOrDefault<word>("partPressureName","partP")),
partPressure_(NULL),
densityFieldName_(propsDict_.lookupOrDefault<word>("densityFieldName","rho")),
rho_(sm.mesh().lookupObject<volScalarField> (densityFieldName_)),
molarConcFieldName_(propsDict_.lookupOrDefault<word>("totalMoleFieldName","molarConc")),
molarConc_(sm.mesh().lookupObject<volScalarField>(molarConcFieldName_)),
X_(speciesNames_.size()),
diffusantGasNames_(propsDict_.lookup("diffusantGasNames")),
diffusionCoefficients_(diffusantGasNames_.size(),NULL),
Xdiffusant_(diffusantGasNames_.size()),
initialized_(false)
{
if(verbose_)
{
Info << " Reading diffusionCoefficient list: " << diffusantGasNames_ << endl;
for (int i = 0; i < diffusantGasNames_.size(); i++)
{
Info << "Diffusant names: " << diffusantGasNames_[i] << endl;
}
}
particleCloud_.checkCG(false);
allocateMyArrays();
createCoeffs();
@ -108,7 +96,8 @@ diffusionCoefficient::~diffusionCoefficient()
}
// * * * * * * * * * * * * * * * private Member Functions * * * * * * * * * * * * * //
void diffusionCoefficient::allocateMyArrays() const
void diffusionCoefficient::allocateMyArrays() const
{
double initVal=0.0;
if (particleCloud_.dataExchangeM().maxNumberOfParticles() > 0)
@ -123,14 +112,11 @@ diffusionCoefficient::~diffusionCoefficient()
void diffusionCoefficient::reAllocMyArrays() const
{
if (particleCloud_.numberOfParticlesChanged())
double initVal=0.0;
particleCloud_.dataExchangeM().allocateArray(partPressure_,initVal,1,"nparticles");
for (int i=0; i<diffusantGasNames_.size(); i++)
{
double initVal=0.0;
particleCloud_.dataExchangeM().allocateArray(partPressure_,initVal,1,"nparticles");
for (int i=0; i<diffusantGasNames_.size(); i++)
{
particleCloud_.dataExchangeM().allocateArray(diffusionCoefficients_[i],initVal,1);
}
particleCloud_.dataExchangeM().allocateArray(diffusionCoefficients_[i],initVal,1);
}
}
@ -142,15 +128,22 @@ void diffusionCoefficient::init()
volScalarField& X = const_cast<volScalarField&>
(mesh_.lookupObject<volScalarField>("X_"+speciesNames_[i]));
X_.set(i, &X);
if(verbose_)
{
Info << " Read species list from: " << specDict_.name() << endl;
Info << " Reading species list: " << speciesNames_ << endl;
Info << " Looking up species fields: " << "X_"+speciesNames_[i] << endl;
Info << "The molar fraction fields (X_i): " << X_[i].name() << nl << endl;
}
}
for (int j = 0; j < diffusantGasNames_.size(); j++)
{
volScalarField& Xdiffusant = const_cast<volScalarField&>
(mesh_.lookupObject<volScalarField>("X_"+diffusantGasNames_[j]));
Xdiffusant_.set(j, &Xdiffusant);
if (verbose_)
{
Info << " Reading diffusing gas species list: " << diffusantGasNames_ << endl;
Info << " Looking up diffusin gas species fields: " << "X_"+diffusantGasNames_[j] << endl;
Info << " The molar fraction fields (Xdiffusant_i): " << Xdiffusant_[j].name() << nl << endl;
}
}
initialized_ = true;
}
@ -168,196 +161,115 @@ void diffusionCoefficient::execute()
label cellI=0;
scalar Tfluid(0);
scalar rhofluid(0);
scalar Pfluid(0);
scalar molarConcfluid(0);
scalar Texp(0);
scalar dBinary_(0);
scalar Xnegative(0);
List<scalar> Xfluid_(0);
Xfluid_.setSize(speciesNames_.size());
List<scalar> XfluidDiffusant_(0);
XfluidDiffusant_.setSize(diffusantGasNames_.size());
List<scalar> MixtureBinaryDiffusion_;
MixtureBinaryDiffusion_.setSize(diffusantGasNames_.size());
List<scalar> TotalFraction_;
TotalFraction_.setSize(diffusantGasNames_.size());
List<scalar> TotalFraction_(diffusantGasNames_.size(),0);
// defining interpolators for T, rho, voidfraction, N
// defining interpolators for T and Pressure
interpolationCellPoint <scalar> TInterpolator_(tempField_);
interpolationCellPoint <scalar> rhoInterpolator_(rho_);
interpolationCellPoint <scalar> PInterpolator_(P_);
interpolationCellPoint <scalar> molarConcInterpolator_(molarConc_);
for (int index=0; index<particleCloud_.numberOfParticles(); ++index)
{
cellI=particleCloud_.cellIDs()[index][0];
cellI = particleCloud_.cellIDs()[index][0];
if (cellI >=0)
{
if(interpolation_)
{
vector position = particleCloud_.position(index);
Tfluid = TInterpolator_.interpolate(position,cellI);
rhofluid = rhoInterpolator_.interpolate(position,cellI);
Pfluid = PInterpolator_.interpolate(position,cellI);
molarConcfluid = molarConcInterpolator_.interpolate(position,cellI);
vector position = particleCloud_.position(index);
Tfluid = TInterpolator_.interpolate(position,cellI);
Pfluid = PInterpolator_.interpolate(position,cellI);
}
else
{
Tfluid = tempField_[cellI];
rhofluid = rho_[cellI];
Pfluid = P_[cellI];
molarConcfluid = molarConc_[cellI];
Tfluid = tempField_[cellI];
Pfluid = P_[cellI];
for (int i = 0; i<speciesNames_.size();i++)
for (int i = 0; i<speciesNames_.size(); i++)
{
Xfluid_[i] = X_[i][cellI];
for (int j=0; j<diffusantGasNames_.size();j++)
// total amount of negative molar fractions in the domain
// check it and then delete it
if (X_[i][cellI] < 0.0)
{
if (diffusantGasNames_[j] == speciesNames_[i])
{
XfluidDiffusant_[j] = X_[i][cellI];
}
// total amount of negative molar fractions in the domain
// check it and then delete it
scalar timestep = mesh_.time().deltaTValue();
if (Xfluid_[i] < 0.0)
{
Xnegative += Xfluid_[i]*timestep;
Info << "total negative molar fractions =" << Xnegative << endl;
}
/*if (Xfluid_[i] <= 0.) Xfluid_[i] = 0.0;
if (XfluidDiffusant_[j] <= 0.) XfluidDiffusant_[j] = 0.0;*/
if(verbose_)
{
Info << "X fluid for species " << speciesNames_[i] << " : " << Xfluid_[i] << nl << endl;
Info << "X fluid for diffusant species " << diffusantGasNames_[j] << " : " << XfluidDiffusant_[j] << nl << endl;
}
Xnegative += X_[i][cellI] * mesh_.time().deltaTValue();
Info << "total negative molar fractions = " << Xnegative << endl;
}
}
}
partPressure_[index][0] = Pfluid;
// change fluid pressure to 1 bar instead of Pa
Pfluid = Pfluid/100000.0;
Texp = Tfluid*sqrt(sqrt(Tfluid*Tfluid*Tfluid));
Pfluid = Pfluid / 100000.0;
Texp = Tfluid * sqrt(sqrt(Tfluid*Tfluid*Tfluid));
if(verbose_)
for (int j=0; j<diffusantGasNames_.size(); j++)
{
Info << "partPressure_[index][0] = " << partPressure_[index][0] << endl;
Info << "pressure field" << Pfluid << nl << endl;
Info << "T - exponent calculation" << Texp << nl << endl;
}
TotalFraction_[j] = 0.0;
dBinary_ = 0.0;
for (int i=0; i<diffusantGasNames_.size();i++)
{
MixtureBinaryDiffusion_[i] = 0.0;
TotalFraction_[i] = 0.0;
for (int j=0; j < speciesNames_.size();j++)
for (int i=0; i < speciesNames_.size(); i++)
{
// get molecular diffusion coefficients if diffusant gas and reactant gas are not equal
if (diffusantGasNames_[i] != speciesNames_[j])
if (diffusantGasNames_[j] != speciesNames_[i])
{
if(verbose_)
if (verbose_)
{
Info << "molar weights diffuser gases: " << molWeight(speciesNames_[j]) << nl << endl;
Info << "molarConc fluid: " << molarConcfluid << nl << endl;
Info << "rho fluid: " << rhofluid << nl << endl;
Info << "molar weights diffusant gases: " << molWeight(diffusantGasNames_[i]) << nl << endl;
Info << "molar weights diffuser gases: " << molWeight(speciesNames_[i]) << nl << endl;
Info << "molar weights diffusant gases: " << molWeight(diffusantGasNames_[j]) << nl << endl;
Info << "Pressure: " << Pfluid << nl << endl;
Info << "Temperature: " << Tfluid << nl << endl;
}
if(coeffs.found(diffusantGasNames_[i]) && coeffs.found(speciesNames_[j]))
if (coeffs.found(diffusantGasNames_[j]) && coeffs.found(speciesNames_[i]))
{
// Fuller-Schettler-Giddings Equation
// Unit of dBinary is [m^2/s]
// INFO:: Normally unit of dBinary is cm^2/s, but the 1st term in RHS is 10^-3 instead
// So here it is already converted
dBinary_ = 1e-7*Texp*calcMolNum(i,j)/(Pfluid*calcDiffVol(i,j));
dBinary_ = 1e-7 * Texp * calcMolNum(j,i) / (Pfluid * calcDiffVol(j,i));
if(verbose_)
if (verbose_)
{
Info << "Molecular diffusion for species " << diffusantGasNames_[i] << " in "
<< speciesNames_[j] << " is : " << dBinary_ << nl << endl;
Info << "Molar fraction of species (speciesNames)" << speciesNames_[j] << " : " << Xfluid_[j] << nl << endl;
Info << "Molar fraction of species (diffusantNames)" << diffusantGasNames_[i] << " : " << XfluidDiffusant_[i] << nl << endl;
Info << "Xfluid for " << speciesNames_[i] << " : " << X_[i][cellI] << nl << endl;
Info << "Xdiffusant for " << diffusantGasNames_[j] << " : " << Xdiffusant_[j][cellI] << nl << endl;
}
TotalFraction_[i] += Xfluid_[j]/dBinary_;
if (TotalFraction_[i] < VSMALL)
MixtureBinaryDiffusion_[i] = VSMALL;
else
MixtureBinaryDiffusion_[i] = (1.0-XfluidDiffusant_[i])/TotalFraction_[i];
TotalFraction_[j] += X_[i][cellI] / dBinary_;
if(verbose_)
{
Info << "Total fraction calculated (ratio of stag. gas to binary diffusion : " << TotalFraction_[i] << nl << endl;
Info << "Molar fraction of species diffusant gas " << diffusantGasNames_[i] << " : " << XfluidDiffusant_[i] << nl << endl;
Info << "Multicomp. mix diffusion for species " << diffusantGasNames_[i]
<< " is: " << MixtureBinaryDiffusion_[i] << nl << endl;
}
/*if (!(Xfluid_[j] <= 0.0))
{
// sum of all stagnant gases to sum of binary diffusion
TotalFraction_[i] += Xfluid_[j]/dBinary_;
// dCoeff -- diffusion component of diffusant gas
MixtureBinaryDiffusion_[i] = (1.0-XfluidDiffusant_[i])/TotalFraction_[i];
if(verbose_)
{
Info << "Total fraction calculated (ratio of stag. gas to binary diffusion : " << TotalFraction_[i] << nl << endl;
Info << "Molar fraction of species diffusant gas " << diffusantGasNames_[i] << " : " << XfluidDiffusant_[i] << nl << endl;
}
}
if(verbose_)
{
Info << "Multicomp. mix diffusion for species " << diffusantGasNames_[i]
<< " is: " << MixtureBinaryDiffusion_[i] << nl << endl;
}*/
if (verbose_)
Info << "Total Fraction = " << TotalFraction_[j] << nl << endl;
// pass on dCoeff values to array
diffusionCoefficients_[i][index][0]= MixtureBinaryDiffusion_[i];
}else
if (TotalFraction_[j] < VSMALL)
diffusionCoefficients_[j][index][0] = VSMALL;
else
diffusionCoefficients_[j][index][0] = (1.0 - Xdiffusant_[j][cellI]) / TotalFraction_[j];
}
else
{
FatalError
FatalError
<< "check tables for species diffusion volume"
<< endl
<< abort(FatalError);
}
}
}
}
}
if(verbose_)
{
for(int i =0; i<diffusantGasNames_.size();i++)
{
Info << "diffusionCoefficient of species " << diffusantGasNames_[i] << " = " << diffusionCoefficients_[i][index][0] << endl;
if(verbose_)
Info << "diffusionCoefficient of species " << diffusantGasNames_[j] << " = " << diffusionCoefficients_[j][index][0] << endl;
}
}
}
particleCloud_.dataExchangeM().giveData(partPressureName_, "scalar-atom",partPressure_);
particleCloud_.dataExchangeM().giveData(partPressureName_,"scalar-atom",partPressure_);
for (int i=0; i<diffusantGasNames_.size();i++)
for (int j=0; j<diffusantGasNames_.size(); j++)
{
word pushName = diffusantGasNames_[i] + "_diffCoeff";
particleCloud_.dataExchangeM().giveData(pushName,"scalar-atom",diffusionCoefficients_[i]);
};
word pushName = diffusantGasNames_[j] + "_diffCoeff";
particleCloud_.dataExchangeM().giveData(pushName,"scalar-atom",diffusionCoefficients_[j]);
}
Info << "give data done" << endl;
}
@ -385,10 +297,10 @@ void diffusionCoefficient::createCoeffs()
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
double diffusionCoefficient::calcDiffVol(int i, int j)
double diffusionCoefficient::calcDiffVol(int j, int i)
{
double sqrtvolDiff = coeffs(diffusantGasNames_[i])+coeffs(speciesNames_[j]);
return sqrtvolDiff*sqrtvolDiff;
double sqrtvolDiff = coeffs(diffusantGasNames_[j])+coeffs(speciesNames_[i]);
return sqrtvolDiff * sqrtvolDiff;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -408,15 +320,15 @@ void diffusionCoefficient::molWeightTable()
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// either calculate Molecular Weight addition (eq. D_ij) or consturct hashtable with diffusant and diffuser species
double diffusionCoefficient::calcMolNum(int i, int j)
double diffusionCoefficient::calcMolNum(int j, int i)
{
double molNum_ = 0.0;
double W1 = molWeight(diffusantGasNames_[i]);
double W2 = molWeight(speciesNames_[j]);
double W1 = molWeight(diffusantGasNames_[j]);
double W2 = molWeight(speciesNames_[i]);
molNum_ = (W1 + W2) / (W1 * W2);
molNum_ = sqrt(molNum_);
molNum_ = (W1 + W2) / (W1 * W2);
molNum_ = sqrt(molNum_);
return molNum_;
}

View File

@ -72,27 +72,20 @@ private:
// gas pressure at particle location
word pressureFieldName_;
const volScalarField& P_;
const volScalarField& P_;
word partPressureName_;
mutable double **partPressure_;
word densityFieldName_;
const volScalarField& rho_;
// total mole field
word molarConcFieldName_;
const volScalarField& molarConc_;
UPtrList<volScalarField> X_;
wordList diffusantGasNames_;
mutable List<double**> diffusionCoefficients_;
UPtrList<volScalarField> Xdiffusant_;
HashTable<scalar, word> coeffs;
HashTable<scalar, word> molWeight;

View File

@ -69,6 +69,7 @@ massTransferCoeff::massTransferCoeff
scaleDia_(1)
{
particleCloud_.checkCG(true);
allocateMyArrays();
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
@ -95,12 +96,9 @@ void massTransferCoeff::allocateMyArrays() const
void massTransferCoeff::reAllocMyArrays() const
{
if (particleCloud_.numberOfParticlesChanged())
{
double initVal=0.0;
particleCloud_.dataExchangeM().allocateArray(partNu_,initVal,1);
particleCloud_.dataExchangeM().allocateArray(partRe_,initVal,1);
}
double initVal=0.0;
particleCloud_.dataExchangeM().allocateArray(partNu_,initVal,1);
particleCloud_.dataExchangeM().allocateArray(partRe_,initVal,1);
}
// * * * * * * * * * * * * * * * * Member Fct * * * * * * * * * * * * * * * //
@ -188,10 +186,10 @@ void massTransferCoeff::execute()
partRe_[index][0] = Rep;
}
if (verbose_ && index >=0 && index < 2)
if (verbose_)
{
Info << "Nufield = " << nuf << endl;
Info << "Rep = " << Rep << endl;
Pout << "Nufield = " << nuf << endl;
Pout << "Rep = " << Rep << endl;
}
}

View File

@ -57,8 +57,64 @@ noChemistry::~noChemistry()
// * * * * * * * * * * * * * * * * Member Fct * * * * * * * * * * * * * * * //
tmp<volScalarField> noChemistry::Smi(label i) const
{
tmp<volScalarField> Smi_
(
new volScalarField
(
IOobject
(
"smi_",
particleCloud_.mesh().time().timeName(),
particleCloud_.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
particleCloud_.mesh(),
dimensionedScalar
(
"zero",
dimMass/(dimVol*dimTime),
0.0
)
)
);
return Smi_;
}
tmp<volScalarField> noChemistry::Sm() const
{
tmp<volScalarField> Sm_
(
new volScalarField
(
IOobject
(
"Sm_",
particleCloud_.mesh().time().timeName(),
particleCloud_.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
particleCloud_.mesh(),
dimensionedScalar
(
"zero",
dimMass/(dimVol*dimTime),
0.0
)
)
);
return Sm_;
}
void noChemistry::execute()
{}
{
//do nothing
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -66,6 +66,10 @@ public:
void execute();
tmp <volScalarField> Smi(const label i) const;
tmp <volScalarField> Sm() const;
};

View File

@ -56,6 +56,7 @@ reactantPerParticle::reactantPerParticle
chemistryModel(dict,sm),
propsDict_(dict.subDict(typeName + "Props")),
mesh_(sm.mesh()),
verbose_(propsDict_.lookupOrDefault<bool>("verbose",false)),
reactantPerParticle_(NULL),
voidfractionFieldName_(propsDict_.lookupOrDefault<word>("voidfractionFieldName","voidfraction")),
voidfraction_(sm.mesh().lookupObject<volScalarField>(voidfractionFieldName_)),
@ -98,19 +99,14 @@ void reactantPerParticle::allocateMyArrays() const
void reactantPerParticle::reAllocMyArrays() const
{
if (particleCloud_.numberOfParticlesChanged())
{
double initVal=0.0;
particleCloud_.dataExchangeM().allocateArray(reactantPerParticle_,initVal,1);
}
double initVal=0.0;
particleCloud_.dataExchangeM().allocateArray(reactantPerParticle_,initVal,1);
}
// * * * * * * * * * * * * * * * * Member Fct * * * * * * * * * * * * * * * //
void reactantPerParticle::execute()
{
loopCounter_++;
if (loopCounter_ % Nevery_ != 0)
{
@ -121,7 +117,7 @@ void reactantPerParticle::execute()
particlesPerCell_ *= 0.0;
label cellI=0;
label cellI=0;
scalar voidfraction(1);
scalar cellvolume(0.0);
scalar particlesPerCell(1.0);
@ -133,7 +129,7 @@ void reactantPerParticle::execute()
if (cellI >= 0)
{
particlesPerCell_[cellI] += 1.0;
}
}
}
// no fill array and communicate it
@ -147,11 +143,13 @@ void reactantPerParticle::execute()
particlesPerCell= particlesPerCell_[cellI];
reactantPerParticle_[index][0] = voidfraction * cellvolume / particlesPerCell;
}
if (verbose_) Info << "reactantPerParticle_" << reactantPerParticle_[index][0] << endl;
}
// give DEM data
particleCloud_.dataExchangeM().giveData("reactantPerParticle", "scalar-atom", reactantPerParticle_);
Info << "give data done" << endl;
}

View File

@ -54,6 +54,8 @@ private:
const fvMesh& mesh_;
bool verbose_;
mutable double **reactantPerParticle_;
word voidfractionFieldName_;

View File

@ -69,7 +69,7 @@ species::species
// create a list from the Species table in the specified species dictionary
speciesNames_(specDict_.lookup("species")),
mod_spec_names_(speciesNames_.size()),
X_(speciesNames_.size()), //volumeScalarFields
X_(speciesNames_.size()), //volumeScalarFields of molarFractions
molarFractions_(speciesNames_.size(),NULL), //the value of molar fractions for every species
changeOfSpeciesMass_(speciesNames_.size(),NULL), //the values that are received from DEM with the name of Modified_+species name
changeOfSpeciesMassFields_(speciesNames_.size()), //the scalar fields generated with the values from Modified_+species names
@ -125,6 +125,7 @@ species::~species()
}
// * * * * * * * * * * * * * * * private Member Functions * * * * * * * * * * * * * //
void species::allocateMyArrays() const
{
double initVal=0.0;
@ -139,25 +140,21 @@ void species::allocateMyArrays() const
{
particleCloud_.dataExchangeM().allocateArray(molarFractions_[i],initVal,1,"nparticles");
particleCloud_.dataExchangeM().allocateArray(changeOfSpeciesMass_[i],initVal,1,"nparticles");
}
}
}
void species::reAllocMyArrays() const
{
if (particleCloud_.numberOfParticlesChanged())
{
double initVal=0.0;
particleCloud_.dataExchangeM().allocateArray(partRho_,initVal,1);
particleCloud_.dataExchangeM().allocateArray(partTemp_,initVal,1);
particleCloud_.dataExchangeM().allocateArray(partMolarConc_,initVal,1);
double initVal=0.0;
particleCloud_.dataExchangeM().allocateArray(partRho_,initVal,1);
particleCloud_.dataExchangeM().allocateArray(partTemp_,initVal,1);
particleCloud_.dataExchangeM().allocateArray(partMolarConc_,initVal,1);
for (int i=0; i<speciesNames_.size(); i++)
{
particleCloud_.dataExchangeM().allocateArray(molarFractions_[i],initVal,1);
particleCloud_.dataExchangeM().allocateArray(changeOfSpeciesMass_[i],initVal,1);
}
for (int i=0; i<speciesNames_.size(); i++)
{
particleCloud_.dataExchangeM().allocateArray(molarFractions_[i],initVal,1);
particleCloud_.dataExchangeM().allocateArray(changeOfSpeciesMass_[i],initVal,1);
}
}
@ -169,7 +166,6 @@ void species::init()
Info << " Reading species list: " << speciesNames_ << endl;
}
for (int i=0; i<speciesNames_.size(); i++)
{
// Define the Species volume scalar fields
@ -182,13 +178,12 @@ void species::init()
if(verbose_)
{
Info << " Looking up species fields \n " << "X_"+speciesNames_[i] << endl;
Info << "The molar fraction fields (X_i): \n" << X_[i].name() << endl;
// Check if mod species are correct
Info << "Modified species names are: \n" << mod_spec_names_[i] << endl;
}
// Create new volScalarFields for the changed values of the species mass fields
// Create new volScalarFields for the changed values of the species mass fields -- gas species source term
changeOfSpeciesMassFields_.set
(
i,
@ -196,7 +191,7 @@ void species::init()
(
IOobject
(
"ModSpeciesMassField_"+X_[i].name(),
"TotalChangeOfMassField_"+speciesNames_[i],
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
@ -205,7 +200,7 @@ void species::init()
mesh_,
dimensionedScalar("zero",dimMass/(dimVol*dimTime), 0.0)
)
);
);
}
initialized_ = true;
}
@ -228,12 +223,10 @@ void species::execute()
reAllocMyArrays();
// get X_i, T, rho at particle positions
label cellI=0;
label cellI = 0;
scalar Tfluid(0);
scalar rhofluid(0);
List<scalar> Xfluid_;
scalar voidfraction(1);
Xfluid_.setSize(speciesNames_.size());
scalar molarConcfluid(0);
// defining interpolators for T, rho, voidfraction, molarConc
@ -250,53 +243,49 @@ void species::execute()
{
if(interpolation_)
{
vector position = particleCloud_.position(index);
Tfluid = TInterpolator_.interpolate(position,cellI);
rhofluid = rhoInterpolator_.interpolate(position,cellI);
voidfraction = voidfractionInterpolator_.interpolate(position,cellI);
molarConcfluid = molarConcInterpolator_.interpolate(position,cellI);
vector position = particleCloud_.position(index);
Tfluid = TInterpolator_.interpolate(position,cellI);
rhofluid = rhoInterpolator_.interpolate(position,cellI);
voidfraction = voidfractionInterpolator_.interpolate(position,cellI);
molarConcfluid = molarConcInterpolator_.interpolate(position,cellI);
}
else
{
Tfluid = tempField_[cellI];
rhofluid = rho_[cellI];
voidfraction = voidfraction_[cellI];
molarConcfluid = molarConc_[cellI];
for (int i = 0; i<speciesNames_.size();i++)
{
Xfluid_[i] = X_[i][cellI];
// if(Xfluid_[i] < 0.0) Xfluid_[i] = 0.0;
}
Tfluid = tempField_[cellI];
rhofluid = rho_[cellI];
voidfraction = voidfraction_[cellI];
molarConcfluid = molarConc_[cellI];
}
partTemp_[index][0] = Tfluid;
partRho_[index][0] = rhofluid;
partMolarConc_[index][0] = molarConcfluid;
partTemp_[index][0] = Tfluid;
partRho_[index][0] = rhofluid;
partMolarConc_[index][0] = molarConcfluid;
for (int i=0; i<speciesNames_.size();i++)
{
// attention for indices when not communicating all species
molarFractions_[i][index][0]=Xfluid_[i];
molarFractions_[i][index][0] = X_[i][cellI];
}
}
}
if(verbose_)
{
for(int i =0; i<speciesNames_.size();i++)
for(int i =0; i<speciesNames_.size(); i++)
{
Info << "X_i = " << X_[i].name() << endl;
Info << "molarFractions_= " << molarFractions_[i][0][0] << endl;
Info << "partRho_[index][0] = " << partRho_[0][0] << endl;
Info << "rhofluid =" << rhofluid << endl;
Info << "Xfluid = " << Xfluid_[i] << endl;
Info << "rhofluid = " << rhofluid << endl;
Info << "partTemp_[index][0] = " << partTemp_[0][0] << endl;
Info << "Tfluid = " << Tfluid << endl ;
Info << "voidfraction =" << voidfraction << endl;
Info << "Tfluid = " << Tfluid << endl;
Info << "voidfraction = " << voidfraction << endl;
}
}
// give DEM data
// give DEM data
{
particleCloud_.dataExchangeM().giveData(partTempName_, "scalar-atom", partTemp_);
particleCloud_.dataExchangeM().giveData(partRhoName_, "scalar-atom", partRho_);
particleCloud_.dataExchangeM().giveData(partMolarConcName_, "scalar-atom", partMolarConc_);
@ -304,19 +293,25 @@ void species::execute()
for (int i=0; i<speciesNames_.size();i++)
{
particleCloud_.dataExchangeM().giveData("X_"+speciesNames_[i],"scalar-atom",molarFractions_[i]);
};
}
Info << "give data done" << endl;
if (verbose_) Info << "give data done" << endl;
}
// pull changeOfSpeciesMass_, transform onto fields changeOfSpeciesMassFields_, add them up on changeOfGasMassField_
// pull changeOfSpeciesMass_, transform onto fields changeOfSpeciesMassFields_, add them up on changeOfGasMassField_
{
scalar timestep = mesh_.time().deltaTValue();
changeOfGasMassField_.primitiveFieldRef() = 0.0;
changeOfGasMassField_.boundaryFieldRef() = 0.0;
for (int i=0; i<speciesNames_.size();i++)
{
particleCloud_.dataExchangeM().getData(mod_spec_names_[i],"scalar-atom",changeOfSpeciesMass_[i]);
changeOfSpeciesMassFields_[i].primitiveFieldRef() = 0.0;
changeOfSpeciesMassFields_[i].boundaryFieldRef() = 0.0;
particleCloud_.dataExchangeM().getData(mod_spec_names_[i],"scalar-atom",changeOfSpeciesMass_[i],particleCloud_.dataExchangeM().couplingInterval());
if (verbose_) Info << "changeOfSpeciesMass received from DEM = " << changeOfSpeciesMass_[i][0][0] << endl;
particleCloud_.averagingM().setScalarSumCentre
(
changeOfSpeciesMassFields_[i],
@ -330,18 +325,22 @@ void species::execute()
changeOfSpeciesMassFields_[i].primitiveFieldRef() /= (changeOfSpeciesMassFields_[i].mesh().V() * Nevery_ * timestep);
changeOfSpeciesMassFields_[i].correctBoundaryConditions();
changeOfGasMassField_ += changeOfSpeciesMassFields_[i];
if (verbose_)
{
Info << "total conversion of species" << speciesNames_[i] << " = " << gSum(changeOfSpeciesMassFields_[i]*1.0*changeOfSpeciesMassFields_[i].mesh().V() * Nevery_ * timestep) << endl;
Info << "total conversion of species" << speciesNames_[i] << " = "
<< gSum(changeOfSpeciesMassFields_[i]*1.0*changeOfSpeciesMassFields_[i].mesh().V() * Nevery_ * timestep) << endl;
}
}
massSourceCurr_ = gSum(changeOfGasMassField_*1.0*changeOfGasMassField_.mesh().V() * Nevery_ * timestep);
massSourceTot_ += massSourceCurr_;
if (verbose_)
{
Info << "total conversion of mass:\n\tcurrent source = " << massSourceCurr_ << "\n\ttotal source = " << massSourceTot_ << "\n" << endl;
Info << "get data done" << endl;
}
}
}
tmp<volScalarField> species::Smi (const label i) const

View File

@ -209,7 +209,7 @@ bool dataExchangeModel::couple(int i)
scalar dataExchangeModel::timeStepFraction() const
{
//return fraction between previous coupling TS and actual TS
return ( particleCloud_.mesh().time().value()-particleCloud_.mesh().time().startTime().value() - (couplingStep_-1) * couplingTime() ) / couplingTime();
return clamp( (particleCloud_.mesh().time().timeIndex() - timeIndexOffset_) * particleCloud_.mesh().time().deltaTValue() / couplingTime() - (couplingStep_ - 1) );
}
int dataExchangeModel::getNumberOfParticles() const
@ -249,7 +249,8 @@ dataExchangeModel::dataExchangeModel
maxNumberOfParticles_(0),
couplingStep_(0),
DEMts_(-1.),
couplingInterval_(readScalar(dict_.lookup("couplingInterval")))
couplingInterval_(readScalar(dict_.lookup("couplingInterval"))),
timeIndexOffset_(particleCloud_.mesh().time().timeIndex())
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //

View File

@ -68,8 +68,16 @@ protected:
int couplingInterval_;
const label timeIndexOffset_;
// Protected member functions
// note: C++17 has std::clamp
scalar clamp(scalar v, scalar lo=0.0, scalar hi=1.0) const
{
return ((v < lo) ? lo : (hi < v) ? hi : v);
}
public:
//- Runtime type information
@ -186,38 +194,40 @@ public:
inline int couplingInterval() const { return couplingInterval_; }
inline scalar couplingTime() const { return couplingInterval_*DEMts_; }
inline scalar couplingTime() const { return couplingInterval_ * DEMts_; }
inline scalar TSstart() const { return particleCloud_.mesh().time().startTime().value()
+ (couplingStep_-1) * couplingTime(); }
inline scalar TSend() const { return particleCloud_.mesh().time().startTime().value()
+ (couplingStep_) * couplingTime(); }
inline scalar TSend() const { return particleCloud_.mesh().time().startTime().value()
+ (couplingStep_ ) * couplingTime(); }
inline int DEMstepsTillT(scalar t) const { return (t - (particleCloud_.mesh().time().value() - couplingTime()) + SMALL) / DEMts_; }
inline int DEMstepsTillT(scalar t) const { return (t - (particleCloud_.mesh().time().value() - couplingTime()) + SMALL) / DEMts_; }
inline void checkTSsize() const
{
if (particleCloud_.mesh().time().deltaT().value() > couplingInterval_ * DEMts_ + SMALL)
if (particleCloud_.mesh().time().deltaTValue() > couplingInterval_ * DEMts_ + SMALL)
{
Info << "particleCloud_.mesh().time().deltaT().value() = " << particleCloud_.mesh().time().deltaT().value() << endl;
Info << "particleCloud_.mesh().time().deltaTValue() = " << particleCloud_.mesh().time().deltaTValue() << endl;
Info << "couplingInterval_ = " << couplingInterval_ << endl;
Info << "DEMts_ = " << DEMts_ << endl;
FatalError << "\nError - CFD time-step bigger than coupling time (= DEM time step * coupling interval)!\n" << abort(FatalError);
}
if (std::fabs((round(couplingTime()/particleCloud_.mesh().time().deltaT().value())*particleCloud_.mesh().time().deltaT().value())-couplingTime()) > SMALL)
if (std::fabs((round(couplingTime()/particleCloud_.mesh().time().deltaTValue()) * particleCloud_.mesh().time().deltaTValue()) - couplingTime()) > SMALL)
{
Info << "particleCloud_.mesh().time().deltaT().value() = " << particleCloud_.mesh().time().deltaT().value() << endl;
Info << "particleCloud_.mesh().time().deltaTValue() = " << particleCloud_.mesh().time().deltaTValue() << endl;
Info << "couplingInterval_ = " << couplingInterval_ << endl;
Info << "DEMts_ = " << DEMts_ << endl;
Warning << "\nWarning - Coupling time (= DEM time step * coupling interval) is not a multiple of CFD time-step!\n" << endl;
Warning << "\nWarning - Coupling time (= DEM time step * coupling interval) is not a multiple of CFD time-step!\n" << endl;
}
if (!particleCloud_.allowCFDsubTimestep())
if (particleCloud_.mesh().time().deltaT().value() < couplingInterval_ * DEMts_ + SMALL)
if (particleCloud_.mesh().time().deltaTValue() < couplingInterval_ * DEMts_ + SMALL)
FatalError << "\nYour models require: CFD time-step = coupling interval (= DEM time step * coupling interval)! \n" << abort(FatalError);
// warn if sub-TS
if (particleCloud_.mesh().time().deltaT().value() < couplingTime() - SMALL)
if (particleCloud_.mesh().time().deltaTValue() < couplingTime() - SMALL)
Warning << "You are using sub-time-steps (i.e. CFD TS < coupling time)! Check your settings properly." << endl;
}
@ -229,15 +239,10 @@ public:
inline bool doCoupleNow() const
{
if (particleCloud_.mesh().time().value()-particleCloud_.mesh().time().startTime().value()-SMALL
> couplingStep_*DEMts_*couplingInterval_)
{
return true;
}
else
{
return false;
}
return ( (particleCloud_.mesh().time().timeIndex() - timeIndexOffset_) * particleCloud_.mesh().time().deltaTValue() - SMALL
>
couplingStep_ * DEMts_ * couplingInterval_
);
}
virtual int getNumberOfParticles() const;
@ -245,17 +250,25 @@ public:
virtual int getNumberOfTypes() const;
virtual double* getTypeVol() const;
inline void setPositions(label n,double* pos) const
inline void setPositions(label n,double* pos)
{
for (int i=0;i<n;i++)
for (int j=0;j<3;j++)
particleCloud_.positions_[i][j]=pos[i*3+j];
}
inline void setCellIDs(label n,int* ID) const
inline void setCellIDs(label n,int* ID)
{
for (int i=0;i<n;i++)
particleCloud_.cellIDs_[i][0]=ID[i];
}
inline void setCellIDs(labelList const& ids)
{
for (int i = 0; i < ids.size(); i++)
{
particleCloud_.cellIDs_[i][0] = ids[i];
}
}
virtual scalar getCG() const { Warning << "getCG() not executed correctly!" << endl; return 1.; }

View File

@ -66,7 +66,7 @@ twoWayMPI::twoWayMPI
propsDict_(dict.subDict(typeName + "Props")),
lmp(NULL)
{
Info<<"Starting up LIGGGHTS for first time execution"<<endl;
Info << "Starting up LIGGGHTS for first time execution" << endl;
MPI_Comm_dup(MPI_COMM_WORLD, &comm_liggghts);
@ -74,8 +74,8 @@ twoWayMPI::twoWayMPI
const fileName liggghtsPath(propsDict_.lookup("liggghtsPath"));
// open LIGGGHTS input script
Info<<"Executing input script '"<< liggghtsPath.c_str() <<"'"<<endl;
lmp = new LAMMPS_NS::LAMMPS(0,NULL,comm_liggghts);
Info << "Executing input script '" << liggghtsPath.c_str() << "'" << endl;
lmp = new LAMMPS_NS::LAMMPS(0, NULL, comm_liggghts);
lmp->input->file(liggghtsPath.c_str());
// get DEM time step size

View File

@ -0,0 +1,286 @@
/*---------------------------------------------------------------------------*\
License
This 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.
This code 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 this code. If not, see <http://www.gnu.org/licenses/>.
Copyright 2018- Paul Kieckhefen, TUHH
\*---------------------------------------------------------------------------*/
//#define O2ODEBUG
#ifdef O2ODEBUG
#include <iostream>
#endif
#include <mpi.h>
#include "one2one.H"
template <typename T>
struct mpi_type_wrapper {
MPI_Datatype mpi_type;
mpi_type_wrapper();
};
template <> mpi_type_wrapper<float>::mpi_type_wrapper()
: mpi_type(MPI_FLOAT) {}
template <> mpi_type_wrapper<double>::mpi_type_wrapper()
: mpi_type(MPI_DOUBLE) {}
template <> mpi_type_wrapper<int>::mpi_type_wrapper()
: mpi_type(MPI_INT) {}
/* ---------------------------------------------------------------------- */
One2One::One2One(MPI_Comm caller)
:
ncollected_(-1),
comm_(caller),
nsrc_procs_(-1),
src_procs_(nullptr),
ndst_procs_(-1),
dst_procs_(nullptr),
nlocal_(-1),
natoms_(nullptr),
request_(nullptr),
status_(nullptr)
{
MPI_Comm_rank(comm_,&me_);
MPI_Comm_size(comm_,&nprocs_);
}
/* ---------------------------------------------------------------------- */
One2One::~One2One()
{
deallocate();
}
/* ----------------------------------------------------------------------
communicate particle ids based on processor communication pattern
------------------------------------------------------------------------- */
void One2One::setup
(
int nsrc_procs,
int *src_procs,
int ndst_procs,
int *dst_procs,
int nlocal
)
{
// free any previous one2one info
deallocate();
src_procs_ = src_procs;
nsrc_procs_ = nsrc_procs;
dst_procs_ = dst_procs;
ndst_procs_ = ndst_procs;
nlocal_ = nlocal;
// gather number of ids for reserving memory
natoms_ = new int[nprocs_];
MPI_Allgather // may be replaced by send/irecv
(
&nlocal_,
1,
MPI_INT,
natoms_,
1,
MPI_INT,
comm_
);
ncollected_ = 0;
int nrequests = 0;
for (int i = 0; i < nsrc_procs_; i++)
{
if (natoms_[src_procs_[i]] > 0)
{
ncollected_ += natoms_[src_procs_[i]];
if (src_procs_[i] != me_) // no receive for on-proc info
{
nrequests++;
}
}
}
if (nrequests > 0)
{
request_ = new MPI_Request[nrequests];
status_ = new MPI_Status[nrequests];
}
}
/* ----------------------------------------------------------------------
src: what is present on this proc
dst: what is received from other procs
all comm according to map set up in setup(...)
------------------------------------------------------------------------- */
template <typename T>
void One2One::exchange(T *&src, T *&dst, int data_length)
{
mpi_type_wrapper<T> wrap;
// post receives
int offset_local = -1;
int offset = 0;
int requesti = 0;
for (int i = 0; i < nsrc_procs_; i++)
{
// do post a receives for procs who own particles
if (natoms_[src_procs_[i]] > 0)
{
if (src_procs_[i] != me_)
{
#ifdef O2ODEBUG
std::cout<< "[" << me_ << "]"
<< " RCV " << i
<< " of " << nsrc_procs_
<< " from: " << src_procs_[i]
<< " natoms_[src_procs_[i]] " << natoms_[src_procs_[i]]
<< " datalength " << data_length
<< " offset " << offset
<< std::endl;
#endif
MPI_Irecv
(
&dst[offset],
natoms_[src_procs_[i]]*data_length,
wrap.mpi_type,
src_procs_[i],
MPI_ANY_TAG,
comm_,
&request_[requesti]
);
requesti++;
}
else // data is available on-proc
{
offset_local = offset;
}
}
offset += natoms_[src_procs_[i]]*data_length;
}
// make sure all receives are posted
MPI_Barrier(comm_);
// blocking sends - do nonblocking instead
// since doing many-2-many here?
// only do sends if I have particles
if (nlocal_ > 0)
{
for (int i = 0; i < ndst_procs_; i++)
{
if (dst_procs_[i] != me_)
{
#ifdef O2ODEBUG
std::cout<< "[" << me_ << "]"
<< " SEND to: " << dst_procs_[i]
<< " nlocal_ " << nlocal_
<< " data_length " << data_length
<< std::endl;
#endif
MPI_Send
(
src,
nlocal_*data_length,
wrap.mpi_type,
dst_procs_[i],
0,
comm_
);
}
}
}
// only wait if requests were actually posted
if (requesti > 0)
MPI_Waitall(requesti, request_, status_);
// copy on-proc data
if (offset_local > -1)
{
const int max_locali = nlocal_ * data_length;
for
(
int locali = 0;
locali < max_locali;
locali++
)
{
dst[locali+offset_local] = src[locali];
}
}
}
template void One2One::exchange<int>(int*&, int*&, int);
template void One2One::exchange<double>(double*&, double*&, int);
// there should be a way to do this without copying data
template <typename T>
void One2One::exchange(T **&src, T **&dst, int data_length)
{
mpi_type_wrapper<T> wrap;
T* tmp_dst = new T[ncollected_*data_length];
T* tmp_src = new T[nlocal_*data_length];
for (int i = 0; i < nlocal_; i++)
for (int j = 0; j < data_length; j++)
tmp_src[data_length*i+j] = src[i][j];
exchange<T>(tmp_src, tmp_dst, data_length);
for (int i = 0; i < ncollected_; i++)
for (int j = 0; j < data_length; j++)
dst[i][j] = tmp_dst[data_length*i+j];
delete [] tmp_src;
delete [] tmp_dst;
}
template void One2One::exchange<int>(int**&, int**&, int);
template void One2One::exchange<double>(double**&, double**&, int);
template <typename T>
void One2One::exchange(T **&src, T *&dst, int data_length)
{
mpi_type_wrapper<T> wrap;
T* tmp_src = new T[nlocal_*data_length];
for (int i = 0; i < nlocal_; i++)
for (int j = 0; j < data_length; j++)
tmp_src[data_length*i+j] = src[i][j];
exchange<T>(tmp_src, dst, data_length);
delete [] tmp_src;
}
template void One2One::exchange<int>(int**&, int*&, int);
template void One2One::exchange<double>(double**&, double*&, int);
/* ---------------------------------------------------------------------- */
void One2One::deallocate()
{
delete [] src_procs_;
delete [] dst_procs_;
delete [] natoms_;
delete [] request_;
delete [] status_;
}

View File

@ -0,0 +1,70 @@
/*---------------------------------------------------------------------------*\
License
This 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.
This code 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 this code. If not, see <http://www.gnu.org/licenses/>.
Copyright 2018- Paul Kieckhefen, TUHH
\*---------------------------------------------------------------------------*/
#ifndef ONE2ONE_H
#define ONE2ONE_H
#include <mpi.h>
class One2One
{
public:
One2One(MPI_Comm);
~One2One();
void setup
(
int nsrc_procs,
int *src_procs,
int ndst_procs,
int* dst_procs,
int nlocal
);
template <typename T>
void exchange(T *&, T *&, int data_length=1);
template <typename T>
void exchange(T **&, T **&, int data_length=1);
template <typename T>
void exchange(T **&, T *&, int data_length=1);
int ncollected_; // # of ids in from group
protected:
MPI_Comm comm_;
int me_, nprocs_; // rank and size
// communication partners
int nsrc_procs_; // # of off-processor IDs
int* src_procs_; // procs I receive data from
int ndst_procs_; // # of off-processor IDs
int* dst_procs_; // procs I receive data from
int nlocal_; // # particle ids I own
int* natoms_;
MPI_Request* request_;
MPI_Status* status_;
void deallocate();
};
#endif

View File

@ -0,0 +1,941 @@
/*---------------------------------------------------------------------------*\
CFDEMcoupling - Open Source CFD-DEM coupling
CFDEMcoupling is part of the CFDEMproject
www.cfdem.com
Christoph Goniva, christoph.goniva@cfdem.com
Copyright 2009-2012 JKU Linz
Copyright 2012- DCS Computing GmbH, Linz
-------------------------------------------------------------------------------
License
This file is part of CFDEMcoupling.
CFDEMcoupling 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 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; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
This code is designed to realize coupled CFD-DEM simulations using LIGGGHTS
and OpenFOAM(R). Note: this code is not part of OpenFOAM(R) (see DISCLAIMER).
Contributing authors
Paul Kieckhefen (TUHH) 2018-
\*---------------------------------------------------------------------------*/
#include "twoWayOne2One.H"
#include "addToRunTimeSelectionTable.H"
#include "clockModel.H"
#include "pair.h"
#include "force.h"
#include "forceModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(twoWayOne2One, 0);
addToRunTimeSelectionTable
(
dataExchangeModel,
twoWayOne2One,
dictionary
);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
twoWayOne2One::twoWayOne2One
(
const dictionary& dict,
cfdemCloud& sm
)
:
dataExchangeModel(dict,sm),
propsDict_(dict.subDict(typeName + "Props")),
thisLigPartner_(0),
thisFoamPartner_(0),
lig2foam_(nullptr),
foam2lig_(nullptr),
lig2foam_mask_(nullptr),
lig2foam_ids_(nullptr),
foam2lig_ids_(nullptr),
lig2foam_vec_tmp_(nullptr),
lig2foam_scl_tmp_(nullptr),
foam2lig_vec_tmp_(nullptr),
foam2lig_scl_tmp_(nullptr),
staticProcMap_(propsDict_.lookupOrDefault<Switch>("useStaticProcMap", false)),
cellIdComm_(propsDict_.lookupOrDefault<Switch>("useCellIdComm", false)),
my_prev_cell_ids_fix_(nullptr),
verbose_(propsDict_.lookupOrDefault("verbose", false)),
lmp(nullptr)
{
Info<<"Starting up LIGGGHTS for first time execution"<<endl;
comm_liggghts_ = MPI_COMM_WORLD;
// read path from dictionary
const fileName liggghtsPath(propsDict_.lookup("liggghtsPath"));
// open LIGGGHTS input script
Info<<"Executing input script '"<< liggghtsPath.c_str() <<"'"<<endl;
lmp = new LAMMPS_NS::LAMMPS(0,nullptr,comm_liggghts_);
lmp->input->file(liggghtsPath.c_str());
// get DEM time step size
DEMts_ = lmp->update->dt;
checkTSsize();
// calculate boundingBox of FOAM subdomain
primitivePatch tmpBoundaryFaces
(
SubList<face>
(
sm.mesh().faces(),
sm.mesh().nFaces() - sm.mesh().nInternalFaces(),
sm.mesh().nInternalFaces()
),
sm.mesh().points()
);
typedef PrimitivePatch<face, List, const pointField> bPatch;
bPatch boundaryFaces
(
tmpBoundaryFaces.localFaces(),
tmpBoundaryFaces.localPoints()
);
thisFoamBox_ = treeBoundBox(boundaryFaces.localPoints());
if (staticProcMap_)
{
createProcMap();
}
if (cellIdComm_)
{
my_prev_cell_ids_fix_ = static_cast<LAMMPS_NS::FixPropertyAtom*>
( lmp->modify->find_fix_property
(
"prev_cell_ids",
"property/atom",
"scalar",
0,
0,
"cfd coupling",
true
)
);
}
}
void twoWayOne2One::createProcMap()
{
List<treeBoundBox> foamBoxes(Pstream::nProcs());
foamBoxes[Pstream::myProcNo()] = thisFoamBox_;
Pstream::gatherList(foamBoxes);
Pstream::scatterList(foamBoxes);
// calculate bounding box of LIG subdomain
// this may have to move to couple when dynamic LB occurs
List<boundBox> ligBoxes(Pstream::nProcs());
double** ligbb = o2o_liggghts_get_boundingbox(lmp);
boundBox thisLigBox
(
point(ligbb[0][0], ligbb[0][1], ligbb[0][2]),
point(ligbb[1][0], ligbb[1][1], ligbb[1][2])
);
ligBoxes[Pstream::myProcNo()] = thisLigBox;
Pstream::gatherList(ligBoxes);
Pstream::scatterList(ligBoxes);
thisLigPartner_.clear();
thisFoamPartner_.clear();
// detect LIG subdomains which this FOAM has to interact with
forAll(ligBoxes, ligproci)
{
if (thisFoamBox_.overlaps(ligBoxes[ligproci]))
{
thisLigPartner_.append(ligproci);
}
}
// detect FOAM subdomains this LIG has to interact with
// TODO: refactor to invert this list here
forAll(foamBoxes, foamproci)
{
if (thisLigBox.overlaps(foamBoxes[foamproci]))
{
thisFoamPartner_.append(foamproci);
}
}
if (verbose_)
{
Pout<< "FOAM bounding box: " << thisFoamBox_
<< " LIG bounding box: " << thisLigBox
<< nl
<< "FOAM comm partners: " << thisFoamPartner_
<< " LIG comm partners: " << thisLigPartner_
<< endl;
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
twoWayOne2One::~twoWayOne2One()
{
delete foam2lig_;
delete lig2foam_;
destroy(lig2foam_ids_);
destroy(foam2lig_ids_);
destroy(lig2foam_vec_tmp_);
destroy(lig2foam_scl_tmp_);
destroy(foam2lig_vec_tmp_);
destroy(foam2lig_scl_tmp_);
delete lmp;
}
// * * * * * * * * * * * * * * * public Member Functions * * * * * * * * * * * * * //
void twoWayOne2One::getData
(
word name,
word type,
double ** const& field,
label /*step*/
) const
{
if (name == "x") // the location is transferred by couple()
{
return;
}
if (type == "vector-atom")
{
double **tmp_= static_cast<double **>(lammps_extract_atom(lmp,name.c_str()));
if (!tmp_)
{
LAMMPS_NS::Fix *fix = nullptr;
fix = lmp->modify->find_fix_property
(
name.c_str(),
"property/atom",
"vector",
0,
0,
"cfd coupling",
false
);
if (fix)
{
tmp_ = static_cast<LAMMPS_NS::FixPropertyAtom*>(fix)->array_atom;
}
else
{
Warning<< "coupling fix not found!" << endl;
}
if (!tmp_)
{
FatalError<< "find_fix_property " << name
<< " array_atom not found."
<< abort(FatalError);
}
}
lig2foam_->exchange<double>
(
tmp_,
lig2foam_vec_tmp_,
3
);
extractCollected<double>
(
lig2foam_vec_tmp_,
const_cast<double**&>(field),
3
);
}
else if (type == "scalar-atom")
{
double *tmp_ = static_cast<double *>(lammps_extract_atom(lmp,name.c_str()));
if (!tmp_)
{
LAMMPS_NS::Fix *fix = nullptr;
fix = lmp->modify->find_fix_property
(
name.c_str(),
"property/atom",
"scalar",
0,
0,
"cfd coupling",
true
);
if (fix)
{
tmp_ = static_cast<LAMMPS_NS::FixPropertyAtom*>(fix)->vector_atom;
}
else
{
FatalError<< "coupling fix not found!" << abort(FatalError);
}
if (!tmp_)
{
FatalError<< "find_fix_property " << name
<< " vector_atom not found."
<< abort(FatalError);
}
}
lig2foam_->exchange<double>
(
tmp_,
lig2foam_scl_tmp_
);
extractCollected<double>
(
lig2foam_scl_tmp_,
const_cast<double**&>(field)
);
}
else
{
FatalError << "requesting type " << type << " and name " << name << abort(FatalError);
}
}
void twoWayOne2One::getData
(
word name,
word type,
int ** const& field,
label /*step*/
) const
{
FatalError << "do not use this getData!!!" << abort(FatalError);
/*
o2o_data_liggghts_to_of
(
name.c_str(),
type.c_str(),
lmp,
(void*&) field,
"int",
comm_liggghts_
);
*/
}
void twoWayOne2One::giveData
(
word name,
word type,
double ** const& field,
const char* datatype
) const
{
if (type == "vector-atom")
{
foam2lig_->exchange
(
const_cast<double**&>(field),
foam2lig_vec_tmp_,
3
);
o2o_data_of_to_liggghts
(
name.c_str(),
type.c_str(),
lmp,
foam2lig_vec_tmp_,
datatype,
foam2lig_ids_,
foam2lig_->ncollected_
);
}
else if (type == "scalar-atom")
{
foam2lig_->exchange
(
const_cast<double**&>(field),
foam2lig_scl_tmp_,
1
);
o2o_data_of_to_liggghts
(
name.c_str(),
type.c_str(),
lmp,
foam2lig_scl_tmp_,
datatype,
foam2lig_ids_,
foam2lig_->ncollected_
);
}
else
{
FatalError<< "twoWayMany2Many::giveData requested type " << type
<< " not implemented!"
<< abort(FatalError);
}
}
//============
// double **
void twoWayOne2One::allocateArray
(
double**& array,
double initVal,
int width,
int length
) const
{
int len = max(length,1);
lmp->memory->grow(array, len, width, "o2o:dbl**");
for (int i = 0; i < len; i++)
for (int j = 0; j < width; j++)
array[i][j] = initVal;
}
void twoWayOne2One::allocateArray
(
double**& array,
double initVal,
int width,
const char* length
) const
{
int len = max(particleCloud_.numberOfParticles(),1);
lmp->memory->grow(array, len, width, "o2o:dbl**:autolen");
for (int i = 0; i < len; i++)
for (int j = 0; j < width; j++)
array[i][j] = initVal;
}
void inline twoWayOne2One::destroy(double** array,int len) const
{
lmp->memory->destroy(array);
}
//============
// int **
void twoWayOne2One::allocateArray
(
int**& array,
int initVal,
int width,
int length
) const
{
int len = max(length,1);
lmp->memory->grow(array, len, width, "o2o:int**");
for (int i = 0; i < len; i++)
for (int j = 0; j < width; j++)
array[i][j] = initVal;
}
void twoWayOne2One::allocateArray
(
int**& array,
int initVal,
int width,
const char* length
) const
{
int len = max(particleCloud_.numberOfParticles(),1);
lmp->memory->grow(array, len, width, "o2o:int**:autolen");
for (int i = 0; i < len; i++)
for (int j = 0; j < width; j++)
array[i][j] = initVal;
}
void inline twoWayOne2One::destroy(int** array,int len) const
{
lmp->memory->destroy(array);
}
//============
// double *
void twoWayOne2One::allocateArray(double*& array, double initVal, int length) const
{
int len = max(length,1);
lmp->memory->grow(array, len, "o2o:dbl*");
for (int i = 0; i < len; i++)
array[i] = initVal;
}
void inline twoWayOne2One::destroy(double* array) const
{
lmp->memory->destroy(array);
}
//==============
// int *
void twoWayOne2One::allocateArray(int*& array, int initVal, int length) const
{
int len = max(length,1);
lmp->memory->grow(array, len, "o2o:int*");
for (int i = 0; i < len; i++)
array[i] = initVal;
}
void inline twoWayOne2One::destroy(int* array) const
{
lmp->memory->destroy(array);
}
//==============
bool twoWayOne2One::couple(int i)
{
bool coupleNow = false;
if (i==0)
{
couplingStep_++;
coupleNow = true;
// run commands from liggghtsCommands dict
Info<< "Starting up LIGGGHTS" << endl;
particleCloud_.clockM().start(3,"LIGGGHTS");
// check if liggghtsCommandModels with exaxt timing are being run
bool exactTiming(false);
int runComNr = -10;
DynamicList<scalar> interruptTimes(0);
DynamicList<int> DEMstepsToInterrupt(0);
DynamicList<int> lcModel(0);
forAll(particleCloud_.liggghtsCommandModelList(),i)
{
// Check if exact timing is needed
// get time for execution
// store time for execution in list
if(particleCloud_.liggghtsCommand(i).exactTiming())
{
exactTiming = true;
DynamicList<scalar> h
= particleCloud_.liggghtsCommand(i).executionsWithinPeriod
(
TSstart(),
TSend()
);
forAll(h,j)
{
// save interrupt times (is this necessary)
interruptTimes.append(h[j]);
// calc stepsToInterrupt
DEMstepsToInterrupt.append(DEMstepsTillT(h[j]));
// remember which liggghtsCommandModel to run
lcModel.append(i);
}
// make cumulative
label len = DEMstepsToInterrupt.size();
label ind(0);
forAll(DEMstepsToInterrupt,i)
{
ind = len - i - 1;
if(ind > 0)
{
DEMstepsToInterrupt[ind] -= DEMstepsToInterrupt[ind-1];
}
}
Info<< "Foam::twoWayOne2One::couple(i): interruptTimes=" << interruptTimes << nl
<< "Foam::twoWayOne2One::couple(i): DEMstepsToInterrupt=" << DEMstepsToInterrupt << nl
<< "Foam::twoWayOne2One::couple(i): lcModel=" << lcModel
<< endl;
}
if(particleCloud_.liggghtsCommand(i).type() == "runLiggghts")
{
runComNr = i;
}
}
// models with exact timing exists
label commandLines(0);
if(exactTiming)
{
// extension for more liggghtsCommands active the same time:
// sort interrupt list within this run period
// keep track of corresponding liggghtsCommand
int DEMstepsRun(0);
forAll(interruptTimes,j)
{
// set run command till interrupt
DEMstepsRun += DEMstepsToInterrupt[j];
particleCloud_.liggghtsCommand(runComNr).set(DEMstepsToInterrupt[j]);
const char* command = particleCloud_.liggghtsCommand(runComNr).command(0);
Info<< "Executing run command: '"<< command <<"'"<< endl;
lmp->input->one(command);
// run liggghts command with exact timing
command = particleCloud_.liggghtsCommand(lcModel[j]).command(0);
Info << "Executing command: '"<< command <<"'"<< endl;
lmp->input->one(command);
}
// do the run
if(particleCloud_.liggghtsCommand(runComNr).runCommand(couplingStep()))
{
particleCloud_.liggghtsCommand(runComNr).set(couplingInterval() - DEMstepsRun);
const char* command = particleCloud_.liggghtsCommand(runComNr).command(0);
Info<< "Executing run command: '"<< command <<"'"<< endl;
lmp->input->one(command);
}
// do the other non exact timing models
forAll(particleCloud_.liggghtsCommandModelList(),i)
{
if
(
! particleCloud_.liggghtsCommand(i).exactTiming() &&
particleCloud_.liggghtsCommand(i).runCommand(couplingStep())
)
{
commandLines=particleCloud_.liggghtsCommand(i).commandLines();
for(int j=0;j<commandLines;j++)
{
const char* command = particleCloud_.liggghtsCommand(i).command(j);
Info << "Executing command: '"<< command <<"'"<< endl;
lmp->input->one(command);
}
}
}
}
// no model with exact timing exists
else
{
forAll(particleCloud_.liggghtsCommandModelList(),i)
{
if(particleCloud_.liggghtsCommand(i).runCommand(couplingStep()))
{
commandLines=particleCloud_.liggghtsCommand(i).commandLines();
for(int j=0;j<commandLines;j++)
{
const char* command = particleCloud_.liggghtsCommand(i).command(j);
Info << "Executing command: '"<< command <<"'"<< endl;
lmp->input->one(command);
}
}
}
}
particleCloud_.clockM().stop("LIGGGHTS");
Info<< "LIGGGHTS finished" << endl;
if (!staticProcMap_)
{
createProcMap();
}
setupLig2FoamCommunication();
locateParticles();
setupFoam2LigCommunication();
if (verbose_)
{
Pout<< "FOAM owns " << getNumberOfParticles()
<< " LIG owns " << lmp->atom->nlocal
<< nl
<< "FOAM collects " << lig2foam_->ncollected_
<< " LIG collects " << foam2lig_->ncollected_
<< endl;
}
}
return coupleNow;
}
void twoWayOne2One::setupLig2FoamCommunication()
{
int* src_procs = new int[thisLigPartner_.size()];
for (int proci = 0; proci < thisLigPartner_.size(); proci++)
{
src_procs[proci] = thisLigPartner_[proci];
}
int* dst_procs = new int[thisFoamPartner_.size()];
for (int proci = 0; proci < thisFoamPartner_.size(); proci++)
{
dst_procs[proci] = thisFoamPartner_[proci];
}
delete lig2foam_;
lig2foam_ = new One2One(comm_liggghts_);
lig2foam_->setup
(
thisLigPartner_.size(),
src_procs,
thisFoamPartner_.size(),
dst_procs,
lmp->atom->nlocal
);
allocateArray
(
lig2foam_vec_tmp_,
0.,
3 * lig2foam_->ncollected_
);
allocateArray
(
lig2foam_scl_tmp_,
0.,
lig2foam_->ncollected_
);
}
void twoWayOne2One::locateParticles()
{
// get positions for locate
double** my_positions = static_cast<double**>(lmp->atom->x);
double* my_flattened_positions = nullptr;
allocateArray(my_flattened_positions, 0., 3*lmp->atom->nlocal);
for (int atomi = 0; atomi < lmp->atom->nlocal; atomi++)
{
for (int coordi = 0; coordi < 3; coordi++)
{
my_flattened_positions[atomi*3+coordi] = my_positions[atomi][coordi];
}
}
double* collected_flattened_positions = nullptr;
allocateArray(collected_flattened_positions, 0., 3*lig2foam_->ncollected_);
lig2foam_->exchange(my_flattened_positions, collected_flattened_positions, 3);
destroy(my_flattened_positions);
double* my_prev_cell_ids = nullptr;
double* prev_cell_ids = nullptr;
if (cellIdComm_)
{
my_prev_cell_ids = my_prev_cell_ids_fix_->vector_atom;
allocateArray(prev_cell_ids, -1, lig2foam_->ncollected_);
lig2foam_->exchange(my_prev_cell_ids, prev_cell_ids);
}
if (lig2foam_mask_)
{
delete [] lig2foam_mask_;
}
lig2foam_mask_ = new bool[lig2foam_->ncollected_];
DynamicList<label> cellIds;
cellIds.setCapacity(lig2foam_->ncollected_);
label n_located(0);
label roundedCelli(-1);
const label nCells(particleCloud_.mesh().cells().size());
for (int atomi = 0; atomi < lig2foam_->ncollected_; atomi++)
{
const vector position = vector
(
collected_flattened_positions[3*atomi+0],
collected_flattened_positions[3*atomi+1],
collected_flattened_positions[3*atomi+2]
);
if (!thisFoamBox_.contains(position))
{
lig2foam_mask_[atomi] = false;
continue;
}
const label cellI = particleCloud_.locateM().findSingleCell
(
position,
cellIdComm_
? // don't know whether using round is efficient
(roundedCelli = round(prev_cell_ids[atomi])) < nCells
?
roundedCelli
:
-1
:
-1
);
lig2foam_mask_[atomi] = false;
if (cellI >= 0) // in domain
{
lig2foam_mask_[atomi] = true;
n_located++;
cellIds.append(cellI);
}
}
if (cellIdComm_)
{
destroy(prev_cell_ids);
}
setNumberOfParticles(n_located);
particleCloud_.reAllocArrays();
reduce(n_located, sumOp<label>());
if (verbose_ || n_located != returnReduce(lmp->atom->nlocal, sumOp<label>()))
{
Warning << "Have located " << n_located
<< " ouf of " << returnReduce(lmp->atom->nlocal, sumOp<label>())
<< " particles in FOAM. "
<< endl;
}
// copy positions/cellids/ids of located particles into arrays
allocateArray(lig2foam_ids_, 0, getNumberOfParticles());
int* collected_ids = nullptr;
allocateArray(collected_ids, 0, lig2foam_->ncollected_);
lig2foam_->exchange<int>(lmp->atom->tag, collected_ids);
extractCollected<int>(collected_ids, lig2foam_ids_);
destroy(collected_ids);
double* extracted_flattened_positions = new double[getNumberOfParticles()*3];
extractCollected<double>
(
collected_flattened_positions,
extracted_flattened_positions,
3
);
setPositions(getNumberOfParticles(), extracted_flattened_positions);
destroy(extracted_flattened_positions);
destroy(collected_flattened_positions);
setCellIDs(cellIds);
}
void twoWayOne2One::setupFoam2LigCommunication()
{
int* src_procs = new int[thisFoamPartner_.size()];
for (int proci = 0; proci < thisFoamPartner_.size(); proci++)
{
src_procs[proci] = thisFoamPartner_[proci];
}
int* dst_procs = new int[thisLigPartner_.size()];
for (int proci = 0; proci < thisLigPartner_.size(); proci++)
{
dst_procs[proci] = thisLigPartner_[proci];
}
delete foam2lig_;
foam2lig_ = new One2One(comm_liggghts_);
foam2lig_->setup
(
thisFoamPartner_.size(),
src_procs,
thisLigPartner_.size(),
dst_procs,
getNumberOfParticles()
);
allocateArray
(
foam2lig_ids_,
0,
foam2lig_->ncollected_
);
foam2lig_->exchange<int>(lig2foam_ids_, foam2lig_ids_);
allocateArray
(
foam2lig_vec_tmp_,
0.,
3 * foam2lig_->ncollected_
);
allocateArray
(
foam2lig_scl_tmp_,
0.,
foam2lig_->ncollected_
);
if (cellIdComm_)
{
double** dbl_cell_ids = new double*[getNumberOfParticles()];
for (int atomi = 0; atomi < getNumberOfParticles(); atomi++)
{ // TEMPORARY: if this persists after 19.07.2018, call me.
dbl_cell_ids[atomi] = new double[1];
dbl_cell_ids[atomi][0] = particleCloud_.cellIDs()[atomi][0];
}
giveData("prev_cell_ids", "scalar-atom", dbl_cell_ids, "double");
delete [] dbl_cell_ids;
}
}
template <typename T>
void twoWayOne2One::extractCollected(T**& src, T**& dst, int width) const
{
int locali = 0;
for (int atomi = 0; atomi < lig2foam_->ncollected_; atomi++)
{
if (!lig2foam_mask_[atomi]) continue;
for (int coordi = 0; coordi < width; coordi++)
{
dst[locali][coordi] = src[atomi][coordi];
}
locali++;
}
}
template <typename T>
void twoWayOne2One::extractCollected(T*& src, T*& dst, int width) const
{
int locali = 0;
for (int atomi = 0; atomi < lig2foam_->ncollected_; atomi++)
{
if (!lig2foam_mask_[atomi]) continue;
for (int coordi = 0; coordi < width; coordi++)
{
dst[locali] = src[atomi*width+coordi];
locali++;
}
}
}
template <typename T>
void twoWayOne2One::extractCollected(T*& src, T**& dst, int width) const
{
int locali = 0;
for (int atomi = 0; atomi < lig2foam_->ncollected_; atomi++)
{
if (!lig2foam_mask_[atomi]) continue;
for (int coordi = 0; coordi < width; coordi++)
{
dst[locali][coordi] = src[atomi*width+coordi];
}
locali++;
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,233 @@
/*---------------------------------------------------------------------------*\
CFDEMcoupling - Open Source CFD-DEM coupling
CFDEMcoupling is part of the CFDEMproject
www.cfdem.com
Christoph Goniva, christoph.goniva@cfdem.com
Copyright 2009-2012 JKU Linz
Copyright 2012- DCS Computing GmbH, Linz
-------------------------------------------------------------------------------
License
This file is part of CFDEMcoupling.
CFDEMcoupling 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 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; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
enhanced two way DEM-CFD coupling via MPI.
Compared to twoWayMPI, no Allreduces are used for communication.
Instead, a geometric map between FOAM and LIG domains is created and
subsequently used for communication.
Class
twoWayOne2One
SourceFiles
twoWayOne2One.C
Contributing authors
Paul Kieckhefen (TUHH) 2018
\*---------------------------------------------------------------------------*/
#ifndef twoWayOne2One_H
#define twoWayOne2One_H
#include "dataExchangeModel.H"
#include "liggghtsCommandModel.H"
#include "OFstream.H"
#include <sys/stat.h>
#include "pair.h"
#include "force.h"
#include "forceModel.H"
#include "one2one.H"
#include "meshSearch.H"
//=================================//
//LAMMPS/LIGGGHTS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <mpi.h>
#include <lammps.h> // these are LAMMPS include files
#include <input.h>
#include <atom.h>
#include <memory.h>
#include <library.h>
#include <library_cfd_coupling.h>
#include <update.h>
#include <comm.h>
#include <fix.h>
#include <fix_property_atom.h>
//=================================//
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class noDrag Declaration
\*---------------------------------------------------------------------------*/
class twoWayOne2One
:
public dataExchangeModel
{
private:
// private data
dictionary propsDict_;
MPI_Comm comm_liggghts_;
// LIG ranks from which to retrieve particle data
labelList thisLigPartner_;
labelList thisFoamPartner_;
One2One* lig2foam_;
One2One* foam2lig_;
bool* lig2foam_mask_;
int* lig2foam_ids_;
int* foam2lig_ids_;
mutable double* lig2foam_vec_tmp_;
mutable double* lig2foam_scl_tmp_;
mutable double* foam2lig_vec_tmp_;
mutable double* foam2lig_scl_tmp_;
Switch staticProcMap_;
Switch cellIdComm_;
LAMMPS_NS::FixPropertyAtom* my_prev_cell_ids_fix_;
treeBoundBox thisFoamBox_;
Switch verbose_;
// private member functions
//- creates a geometric mapping between FOAM and LIG domains
void createProcMap();
//- create a One2One communicator which transfers from LIG to FOAM
void setupLig2FoamCommunication();
//- locates particles received from Lig
void locateParticles();
//- create a One2One communicator which transfers from FOAM to LIG
void setupFoam2LigCommunication();
protected:
LAMMPS_NS::LAMMPS *lmp;
public:
//- Runtime type information
TypeName("twoWayOne2One");
// Constructors
//- Construct from components
twoWayOne2One
(
const dictionary& dict,
cfdemCloud& sm
);
// Destructor
~twoWayOne2One();
// Member Functions
void getData
(
word name,
word type,
double ** const& field,
label step
) const;
void getData
(
word name,
word type,
int ** const& field,
label step
) const;
void giveData
(
word name,
word type,
double ** const& field,
const char* datatype
) const;
//============
// double **
void allocateArray(double**&, double, int, int) const;
void allocateArray(double**&, double, int,const char* = "nparticles") const;
void inline destroy(double**,int=0) const;
//============
// int **
void allocateArray(int**&, int, int, int) const;
void allocateArray(int**&, int, int,const char* = "nparticles") const;
void inline destroy(int**,int=0) const;
//==============
//==============
// double *
void allocateArray(double*&, double, int) const;
void inline destroy(double*) const;
//==============
// int *
void allocateArray(int*&, int, int) const;
void inline destroy(int*) const;
//==============
bool couple(int);
//- extractCollected takes the collected data from Lig
// present in this Foam domain and applies the mask.
// the width parameter can be used for reshaping.
template <typename T>
void extractCollected(T**&, T**&, int width=1) const;
template <typename T>
void extractCollected(T*&, T*&, int width=1) const;
template <typename T>
void extractCollected(T*&, T**&, int width=1) const;
scalar getCG() const { return lmp->force->cg(); }
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -74,7 +74,7 @@ energyModel::~energyModel()
scalar energyModel::Cp() const
{
return Cp_;
return Cp_;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -43,13 +43,13 @@ protected:
const dictionary& dict_;
cfdemCloudEnergy& particleCloud_;
IOdictionary transportProperties_;
scalar kf0_; // fluid thermal conductivity [W/(m*K)]
scalar Cp_; // specific heat capacity [W*s/(kg*K)]
IOdictionary transportProperties_;
scalar kf0_; // fluid thermal conductivity [W/(m*K)]
scalar Cp_; // specific heat capacity [W*s/(kg*K)]
public:
//- Runtime type information
@ -76,7 +76,7 @@ public:
energyModel
(
const dictionary& dict,
cfdemCloudEnergy& sm
cfdemCloudEnergy& sm
);
@ -98,16 +98,16 @@ public:
// Member Functions
virtual void addEnergyContribution(volScalarField&) const = 0;
virtual void addEnergyCoefficient(volScalarField&) const = 0;
virtual void calcEnergyContribution() = 0;
virtual void postFlow() {}
virtual void solve() {}
scalar Cp() const;
virtual void addEnergyCoefficient(volScalarField&) const = 0;
virtual void calcEnergyContribution() = 0;
virtual void postFlow() {}
virtual void solve() {}
scalar Cp() const;
};

View File

@ -21,6 +21,7 @@ License
#include "error.H"
#include "heatTransferGunn.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
@ -43,6 +44,7 @@ heatTransferGunn::heatTransferGunn
:
energyModel(dict,sm),
propsDict_(dict.subDict(typeName + "Props")),
multiTypes_(false),
expNusselt_(propsDict_.lookupOrDefault<bool>("expNusselt",false)),
interpolation_(propsDict_.lookupOrDefault<bool>("interpolation",false)),
verbose_(propsDict_.lookupOrDefault<bool>("verbose",false)),
@ -141,7 +143,9 @@ heatTransferGunn::heatTransferGunn
partHeatFlux_(NULL),
partHeatFluxCoeff_(NULL),
partRe_(NULL),
partNu_(NULL)
partNu_(NULL),
scaleDia_(1.),
typeCG_(propsDict_.lookupOrDefault<scalarList>("coarseGrainingFactors",scalarList(1,1.0)))
{
allocateMyArrays();
@ -181,6 +185,14 @@ heatTransferGunn::heatTransferGunn
FatalError <<"Cannot read and create NuField at the same time!\n" << abort(FatalError);
}
}
if (propsDict_.found("scale") && typeCG_.size()==1)
{
// if "scale" is specified and there's only one single type, use "scale"
scaleDia_=scalar(readScalar(propsDict_.lookup("scale")));
typeCG_[0] = scaleDia_;
}
else if (typeCG_.size()>1) multiTypes_ = true;
}
@ -230,6 +242,12 @@ void heatTransferGunn::calcEnergyContribution()
// get DEM data
particleCloud_.dataExchangeM().getData(partTempName_,"scalar-atom",partTemp_);
if(particleCloud_.cg() > 1.)
{
scaleDia_ = particleCloud_.cg();
Info << "Heat Transfer Gunn is using scale from liggghts cg = " << scaleDia_ << endl;
}
if(calcPartTempField_)
{
partTempField_.primitiveFieldRef() = 0.0;
@ -255,6 +273,15 @@ void heatTransferGunn::calcEnergyContribution()
const volScalarField mufField = particleCloud_.turbulence().nu()*rho_;
#endif
if (typeCG_.size()>1 || typeCG_[0] > 1)
{
Info << "heatTransferGunn using scale = " << typeCG_ << endl;
}
else if (particleCloud_.cg() > 1)
{
scaleDia_=particleCloud_.cg();
Info << "heatTransferGunn using scale from liggghts cg = " << scaleDia_ << endl;
}
// calc La based heat flux
scalar voidfraction(1);
@ -263,6 +290,8 @@ void heatTransferGunn::calcEnergyContribution()
label cellI=0;
vector Us(0,0,0);
scalar ds(0);
scalar ds_scaled(0);
scalar scaleDia3 = typeCG_[0]*typeCG_[0]*typeCG_[0];
scalar muf(0);
scalar magUr(0);
scalar Rep(0);
@ -270,6 +299,8 @@ void heatTransferGunn::calcEnergyContribution()
scalar Nup(0);
scalar Tsum(0.0);
scalar cg = typeCG_[0];
label partType = 1;
interpolationCellPoint<scalar> voidfractionInterpolator_(voidfraction_);
interpolationCellPoint<vector> UInterpolator_(U_);
@ -297,22 +328,30 @@ void heatTransferGunn::calcEnergyContribution()
if (voidfraction < 0.01)
voidfraction = 0.01;
if (multiTypes_)
{
partType = particleCloud_.particleType(index);
cg = typeCG_[partType - 1];
scaleDia3 = cg*cg*cg;
}
// calc relative velocity
Us = particleCloud_.velocity(index);
magUr = mag(Ufluid - Us);
ds = 2.*particleCloud_.radius(index);
ds_scaled = ds/cg;
muf = mufField[cellI];
Rep = ds * magUr * voidfraction * rho_[cellI]/ muf;
Rep = ds_scaled * magUr * voidfraction * rho_[cellI]/ muf;
Pr = max(SMALL, Cp_ * muf / kf0_);
Nup = Nusselt(voidfraction, Rep, Pr);
Tsum += partTemp_[index][0];
scalar h = kf0_ * Nup / ds;
scalar As = ds * ds * M_PI; // surface area of sphere
scalar h = kf0_ * Nup / ds_scaled;
scalar As = ds_scaled * ds_scaled * M_PI; // surface area of sphere
// calc convective heat flux [W]
heatFlux(index, h, As, Tfluid);
heatFlux(index, h, As, Tfluid, scaleDia3);
if(verbose_)
{
@ -320,18 +359,24 @@ void heatTransferGunn::calcEnergyContribution()
partNu_[index][0] = Nup;
}
if(particleCloud_.verbose() && index >=0 && index <2)
if(verbose_ && index >=0 && index <2)
{
Info << "partHeatFlux = " << partHeatFlux_[index][0] << endl;
Info << "magUr = " << magUr << endl;
Info << "As = " << As << endl;
Info << "muf = " << muf << endl;
Info << "Rep = " << Rep << endl;
Info << "Pr = " << Pr << endl;
Info << "Nup = " << Nup << endl;
Info << "voidfraction = " << voidfraction << endl;
Info << "partTemp_[index][0] = " << partTemp_[index][0] << endl;
Info << "Tfluid = " << Tfluid << endl ;
Pout << "partHeatFlux = " << partHeatFlux_[index][0] << endl;
Pout << "magUr = " << magUr << endl;
Pout << "kf0 = " << kf0_ << endl;
Pout << "Cp = " << Cp_ << endl;
Pout << "rho = " << rho_[cellI] << endl;
Pout << "h = " << h << endl;
Pout << "ds = " << ds << endl;
Pout << "ds_scaled = " << ds_scaled << endl;
Pout << "As = " << As << endl;
Pout << "muf = " << muf << endl;
Pout << "Rep = " << Rep << endl;
Pout << "Pr = " << Pr << endl;
Pout << "Nup = " << Nup << endl;
Pout << "voidfraction = " << voidfraction << endl;
Pout << "partTemp_[index][0] = " << partTemp_[index][0] << endl;
Pout << "Tfluid = " << Tfluid << endl ;
}
}
}
@ -411,6 +456,13 @@ void heatTransferGunn::calcEnergyContribution()
}
QPartFluid_.correctBoundaryConditions();
volScalarField minParticleWeights = particleCloud_.averagingM().UsWeightField();
Info << "Minimum Particle Weight " << gMin(minParticleWeights) << endl;
Info << "Minimum Particle Temperature: " << gMin(partTempField_) << endl;
Info << "Maximum Particle Temperature: " << gMax(partTempField_) << endl;
Info << "Minimum Fluid Temperature: " << gMin(tempField_) << endl;
Info << "Maximum Fluid Temperature: " << gMax(tempField_) << endl;
}
void heatTransferGunn::addEnergyContribution(volScalarField& Qsource) const
@ -418,11 +470,11 @@ void heatTransferGunn::addEnergyContribution(volScalarField& Qsource) const
Qsource += QPartFluid_;
}
void heatTransferGunn::addEnergyCoefficient(volScalarField& Qsource) const
void heatTransferGunn::addEnergyCoefficient(volScalarField& Qcoeff) const
{
if(implicit_)
{
Qsource += QPartFluidCoeff_;
Qcoeff += QPartFluidCoeff_;
}
}
@ -434,9 +486,16 @@ scalar heatTransferGunn::Nusselt(scalar voidfraction, scalar Rep, scalar Pr) con
Foam::pow(Rep,0.7) * Foam::pow(Pr,0.33);
}
void heatTransferGunn::heatFlux(label index, scalar h, scalar As, scalar Tfluid)
void heatTransferGunn::heatFlux(label index, scalar h, scalar As, scalar Tfluid, scalar cg3)
{
scalar hAs = h * As;
scalar hAs = h * As * cg3;
if (particleCloud_.getParticleEffVolFactors())
{
scalar effVolFac = particleCloud_.particleEffVolFactor(index);
hAs *= effVolFac;
}
partHeatFlux_[index][0] = - hAs * partTemp_[index][0];
if(!implicit_)
{

View File

@ -28,6 +28,7 @@ License
#include "fvCFD.H"
#include "cfdemCloudEnergy.H"
#include "energyModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
@ -45,6 +46,8 @@ protected:
dictionary propsDict_;
bool multiTypes_;
bool expNusselt_;
bool interpolation_;
@ -79,13 +82,13 @@ protected:
word tempFieldName_;
const volScalarField& tempField_; // ref to temperature field
const volScalarField& tempField_; // ref to temperature field
word voidfractionFieldName_;
const volScalarField& voidfraction_; // ref to voidfraction field
const volScalarField& voidfraction_; // ref to voidfraction field
scalar maxSource_; // max (limited) value of src field
scalar maxSource_; // max (limited) value of src field
word velFieldName_;
@ -109,6 +112,10 @@ protected:
mutable double **partNu_;
mutable scalar scaleDia_;
scalarList typeCG_;
void allocateMyArrays() const;
void partTempField();
@ -117,7 +124,7 @@ protected:
virtual void giveData();
virtual void heatFlux(label, scalar, scalar, scalar);
virtual void heatFlux(label, scalar, scalar, scalar, scalar cg3 = 1.0);
public:
@ -143,11 +150,11 @@ public:
void addEnergyContribution(volScalarField&) const;
void addEnergyCoefficient(volScalarField&) const;
void addEnergyCoefficient(volScalarField&) const;
void calcEnergyContribution();
void calcEnergyContribution();
void postFlow();
void postFlow();
scalar aveTpart() const;
};

View File

@ -45,7 +45,7 @@ heatTransferGunnPartField::heatTransferGunnPartField
:
heatTransferGunn(dict,sm),
partCpField_
(
(
IOobject
(
"partCp",
@ -82,15 +82,15 @@ heatTransferGunnPartField::heatTransferGunnPartField
{
FatalError << "heatTransferGunnPartField: provide list of specific heat capacities." << abort(FatalError);
}
if (propsDict_.found("pTMax"))
{
pTMax_.value()=scalar(readScalar(propsDict_.lookup("pTMax")));
pTMax_.value()=scalar(readScalar(propsDict_.lookup("pTMax")));
}
if (propsDict_.found("pTMin"))
{
pTMin_.value()=scalar(readScalar(propsDict_.lookup("pTMin")));
pTMin_.value()=scalar(readScalar(propsDict_.lookup("pTMin")));
}
partTempField_.writeOpt() = IOobject::AUTO_WRITE;

View File

@ -15,7 +15,7 @@ License
along with this code. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2015- Thomas Lichtenegger, JKU Linz, Austria
Description
Correlation for Nusselt number according to
Gunn, D. J. International Journal of Heat and Mass Transfer 21.4 (1978)
@ -30,6 +30,7 @@ License
#include "heatTransferGunn.H"
#include "fvOptions.H"
#include "scalarList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
@ -88,9 +89,9 @@ public:
// Member Functions
void addEnergyContribution(volScalarField&) const;
void calcEnergyContribution();
void calcEnergyContribution();
void postFlow();
void postFlow();
void solve();

View File

@ -22,6 +22,7 @@ License
#include "reactionHeat.H"
#include "addToRunTimeSelectionTable.H"
#include "dataExchangeModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
@ -45,6 +46,7 @@ reactionHeat::reactionHeat
energyModel(dict,sm),
propsDict_(dict.subDict(typeName + "Props")),
interpolation_(propsDict_.lookupOrDefault<bool>("interpolation",false)),
verbose_(propsDict_.lookupOrDefault<bool>("verbose",false)),
mesh_(sm.mesh()),
maxSource_(1e30),
reactionHeatName_(propsDict_.lookupOrDefault<word>("reactionHeatName","reactionHeat")),
@ -97,6 +99,14 @@ void reactionHeat::calcEnergyContribution()
particleCloud_.dataExchangeM().getData(reactionHeatName_,"scalar-atom",reactionHeat_);
for(int index = 0;index < particleCloud_.numberOfParticles(); ++index)
{
if (verbose_ && index>=0 && index < 2)
{
Pout << "reactionHeat = " << reactionHeat_[index][0] << endl;
}
}
reactionHeatField_.primitiveFieldRef() = 0.0;
reactionHeatField_.boundaryFieldRef() = 0.0;

View File

@ -24,6 +24,7 @@ License
#include "fvCFD.H"
#include "cfdemCloudEnergy.H"
#include "energyModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
@ -47,6 +48,8 @@ protected:
bool interpolation_;
bool verbose_;
const fvMesh& mesh_;
scalar maxSource_;
@ -66,24 +69,24 @@ public:
// Constructors
//- Construct from components
reactionHeat
(
const dictionary& dict,
cfdemCloudEnergy& sm
);
//- Construct from components
reactionHeat
(
const dictionary& dict,
cfdemCloudEnergy& sm
);
// Destructor
virtual ~reactionHeat();
virtual ~reactionHeat();
// Member Functions
void addEnergyContribution(volScalarField&) const;
void addEnergyContribution(volScalarField&) const;
void addEnergyCoefficient(volScalarField&) const {}
void addEnergyCoefficient(volScalarField&) const {}
void calcEnergyContribution();
void calcEnergyContribution();
};

View File

@ -148,6 +148,7 @@ void BeetstraDrag::setForce() const
else if (particleCloud_.cg() > 1)
{
scaleDia_=particleCloud_.cg();
typeCG_[0] = scaleDia_;
Info << "Beetstra using scale from liggghts cg = " << scaleDia_ << endl;
}

View File

@ -17,6 +17,11 @@ Description
drag law for monodisperse systems according to
Beetstra et al. AIChE J 53.2 (2007)
Reference
R. Beetstra, M.A. van der Hoef, J.A.M. Kuipers
"Drag force of intermediate Reynolds number flow past mono- and bidisperse arrays of spheres"
AIChE Journal, 53 (2007)
SourceFiles
BeetstraDrag.C
\*---------------------------------------------------------------------------*/
@ -61,7 +66,7 @@ protected:
mutable scalar scaleDia_;
scalarList typeCG_;
mutable scalarList typeCG_;
mutable scalar scaleDrag_;
@ -86,12 +91,12 @@ protected:
virtual void adaptVoidfraction(double&, label) const {}
virtual scalar effDiameter(double d, label cellI, label index) const {return d;}
virtual scalar meanSauterDiameter(double d, label cellI) const {return d;}
double F(double, double) const;
double terminalVelocity(double, double, double, double, double, double) const;
double terminalVelocity(double, double, double, double, double, double) const;
double a(double) const;

View File

@ -34,6 +34,11 @@ Description
- splits off explicit drag component due to fluctuation in fluid and particle
velocity (optional via forceSubModel "ImExCorr")
Reference
D. Gidaspow
"Multiphase flow and fluidization: Continuum and kinetic theory description",
1994
Class
GidaspowDrag

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