Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
0b625c20
Commit
0b625c20
authored
Jan 25, 2011
by
andy
Browse files
ENH: Re-worked cloud i-o for inactive cloud
parent
121a3776
Changes
18
Hide whitespace changes
Inline
Side-by-side
src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C
View file @
0b625c20
...
...
@@ -74,7 +74,7 @@ Foam::KinematicCloud<ParcelType>::cloudSolution::cloudSolution
coupled_
(
false
),
cellValueSourceCorrection_
(
false
),
maxTrackTime_
(
0
.
0
),
resetSourcesOnStartup_
(
fals
e
)
resetSourcesOnStartup_
(
tru
e
)
{
if
(
active_
)
{
...
...
@@ -188,6 +188,84 @@ bool Foam::KinematicCloud<ParcelType>::cloudSolution::output() const
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
template
<
class
ParcelType
>
void
Foam
::
KinematicCloud
<
ParcelType
>::
setModels
()
{
collisionModel_
.
reset
(
CollisionModel
<
KinematicCloud
<
ParcelType
>
>::
New
(
subModelProperties_
,
*
this
).
ptr
()
);
dispersionModel_
.
reset
(
DispersionModel
<
KinematicCloud
<
ParcelType
>
>::
New
(
subModelProperties_
,
*
this
).
ptr
()
);
dragModel_
.
reset
(
DragModel
<
KinematicCloud
<
ParcelType
>
>::
New
(
subModelProperties_
,
*
this
).
ptr
()
);
injectionModel_
.
reset
(
InjectionModel
<
KinematicCloud
<
ParcelType
>
>::
New
(
subModelProperties_
,
*
this
).
ptr
()
);
patchInteractionModel_
.
reset
(
PatchInteractionModel
<
KinematicCloud
<
ParcelType
>
>::
New
(
subModelProperties_
,
*
this
).
ptr
()
);
postProcessingModel_
.
reset
(
PostProcessingModel
<
KinematicCloud
<
ParcelType
>
>::
New
(
subModelProperties_
,
*
this
).
ptr
()
);
surfaceFilmModel_
.
reset
(
SurfaceFilmModel
<
KinematicCloud
<
ParcelType
>
>::
New
(
subModelProperties_
,
*
this
,
g_
).
ptr
()
);
UIntegrator_
.
reset
(
vectorIntegrationScheme
::
New
(
"U"
,
solution_
.
integrationSchemes
()
).
ptr
()
);
}
template
<
class
ParcelType
>
void
Foam
::
KinematicCloud
<
ParcelType
>::
solve
(
...
...
@@ -450,8 +528,8 @@ Foam::KinematicCloud<ParcelType>::KinematicCloud
)
),
solution_
(
mesh_
,
particleProperties_
.
subDict
(
"solution"
)),
constProps_
(
particleProperties_
),
subModelProperties_
(
particleProperties_
.
subDict
(
"subModels"
)),
constProps_
(
particleProperties_
,
solution_
.
active
()
),
subModelProperties_
(
particleProperties_
.
sub
OrEmpty
Dict
(
"subModels"
)),
rndGen_
(
label
(
0
),
...
...
@@ -462,72 +540,15 @@ Foam::KinematicCloud<ParcelType>::KinematicCloud
U_
(
U
),
mu_
(
mu
),
g_
(
g
),
forces_
(
mesh_
,
particleProperties_
,
g_
.
value
()),
collisionModel_
(
CollisionModel
<
KinematicCloud
<
ParcelType
>
>::
New
(
subModelProperties_
,
*
this
)
),
dispersionModel_
(
DispersionModel
<
KinematicCloud
<
ParcelType
>
>::
New
(
subModelProperties_
,
*
this
)
),
dragModel_
(
DragModel
<
KinematicCloud
<
ParcelType
>
>::
New
(
subModelProperties_
,
*
this
)
),
injectionModel_
(
InjectionModel
<
KinematicCloud
<
ParcelType
>
>::
New
(
subModelProperties_
,
*
this
)
),
patchInteractionModel_
(
PatchInteractionModel
<
KinematicCloud
<
ParcelType
>
>::
New
(
subModelProperties_
,
*
this
)
),
postProcessingModel_
(
PostProcessingModel
<
KinematicCloud
<
ParcelType
>
>::
New
(
subModelProperties_
,
*
this
)
),
surfaceFilmModel_
(
SurfaceFilmModel
<
KinematicCloud
<
ParcelType
>
>::
New
(
subModelProperties_
,
*
this
,
g
)
),
UIntegrator_
(
vectorIntegrationScheme
::
New
(
"U"
,
solution_
.
integrationSchemes
()
)
),
forces_
(
mesh_
,
particleProperties_
,
g_
.
value
(),
solution_
.
active
()),
collisionModel_
(
NULL
),
dispersionModel_
(
NULL
),
dragModel_
(
NULL
),
injectionModel_
(
NULL
),
patchInteractionModel_
(
NULL
),
postProcessingModel_
(
NULL
),
surfaceFilmModel_
(
NULL
),
UIntegrator_
(
NULL
),
UTrans_
(
new
DimensionedField
<
vector
,
volMesh
>
...
...
@@ -561,6 +582,11 @@ Foam::KinematicCloud<ParcelType>::KinematicCloud
)
)
{
if
(
solution_
.
active
())
{
setModels
();
}
if
(
readFields
)
{
ParcelType
::
readFields
(
*
this
);
...
...
src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H
View file @
0b625c20
...
...
@@ -364,6 +364,12 @@ protected:
autoPtr
<
DimensionedField
<
scalar
,
volMesh
>
>
UCoeff_
;
// Initialisation
//- Set cloud sub-models
void
setModels
();
// Cloud evolution functions
//- Solve the cloud - calls all evolution functions
...
...
src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.C
View file @
0b625c20
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-201
0
OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-201
1
OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -30,6 +30,29 @@ License
// * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * //
template
<
class
ParcelType
>
void
Foam
::
ReactingCloud
<
ParcelType
>::
setModels
()
{
compositionModel_
.
reset
(
CompositionModel
<
ReactingCloud
<
ParcelType
>
>::
New
(
this
->
subModelProperties
(),
*
this
).
ptr
()
);
phaseChangeModel_
.
reset
(
PhaseChangeModel
<
ReactingCloud
<
ParcelType
>
>::
New
(
this
->
subModelProperties
(),
*
this
).
ptr
()
);
}
template
<
class
ParcelType
>
void
Foam
::
ReactingCloud
<
ParcelType
>::
checkSuppliedComposition
(
...
...
@@ -85,26 +108,17 @@ Foam::ReactingCloud<ParcelType>::ReactingCloud
ThermoCloud
<
ParcelType
>
(
cloudName
,
rho
,
U
,
g
,
thermo
,
false
),
reactingCloud
(),
cloudCopyPtr_
(
NULL
),
constProps_
(
this
->
particleProperties
()),
compositionModel_
(
CompositionModel
<
ReactingCloud
<
ParcelType
>
>::
New
(
this
->
subModelProperties
(),
*
this
)
),
phaseChangeModel_
(
PhaseChangeModel
<
ReactingCloud
<
ParcelType
>
>::
New
(
this
->
subModelProperties
(),
*
this
)
),
constProps_
(
this
->
particleProperties
(),
this
->
solution
().
active
()),
compositionModel_
(
NULL
),
phaseChangeModel_
(
NULL
),
rhoTrans_
(
thermo
.
carrier
().
species
().
size
()),
dMassPhaseChange_
(
0
.
0
)
{
if
(
this
->
solution
().
active
())
{
setModels
();
}
// Set storage for mass source fields and initialise to zero
forAll
(
rhoTrans_
,
i
)
{
...
...
src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.H
View file @
0b625c20
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-201
0
OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-201
1
OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -128,6 +128,12 @@ protected:
);
// Initialisation
//- Set cloud sub-models
void
setModels
();
// Cloud evolution functions
//- Reset state of cloud
...
...
src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.C
View file @
0b625c20
...
...
@@ -30,6 +30,29 @@ License
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
template
<
class
ParcelType
>
void
Foam
::
ReactingMultiphaseCloud
<
ParcelType
>::
setModels
()
{
devolatilisationModel_
.
reset
(
DevolatilisationModel
<
ReactingMultiphaseCloud
<
ParcelType
>
>::
New
(
this
->
subModelProperties
(),
*
this
).
ptr
()
);
surfaceReactionModel_
.
reset
(
SurfaceReactionModel
<
ReactingMultiphaseCloud
<
ParcelType
>
>::
New
(
this
->
subModelProperties
(),
*
this
).
ptr
()
);
}
template
<
class
ParcelType
>
void
Foam
::
ReactingMultiphaseCloud
<
ParcelType
>::
cloudReset
(
...
...
@@ -62,26 +85,17 @@ Foam::ReactingMultiphaseCloud<ParcelType>::ReactingMultiphaseCloud
ReactingCloud
<
ParcelType
>
(
cloudName
,
rho
,
U
,
g
,
thermo
,
false
),
reactingMultiphaseCloud
(),
cloudCopyPtr_
(
NULL
),
constProps_
(
this
->
particleProperties
()),
devolatilisationModel_
(
DevolatilisationModel
<
ReactingMultiphaseCloud
<
ParcelType
>
>::
New
(
this
->
subModelProperties
(),
*
this
)
),
surfaceReactionModel_
(
SurfaceReactionModel
<
ReactingMultiphaseCloud
<
ParcelType
>
>::
New
(
this
->
subModelProperties
(),
*
this
)
),
constProps_
(
this
->
particleProperties
(),
this
->
solution
().
active
()),
devolatilisationModel_
(
NULL
),
surfaceReactionModel_
(
NULL
),
dMassDevolatilisation_
(
0
.
0
),
dMassSurfaceReaction_
(
0
.
0
)
{
if
(
this
->
solution
().
active
())
{
setModels
();
}
if
(
readFields
)
{
ParcelType
::
readFields
(
*
this
);
...
...
src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.H
View file @
0b625c20
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-201
0
OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-201
1
OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -119,6 +119,12 @@ protected:
// Protected Member Functions
// Initialisation
//- Set cloud sub-models
void
setModels
();
// Cloud evolution functions
//- Reset state of cloud
...
...
src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C
View file @
0b625c20
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-201
0
OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-201
1
OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -30,6 +30,31 @@ License
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
template
<
class
ParcelType
>
void
Foam
::
ThermoCloud
<
ParcelType
>::
setModels
()
{
heatTransferModel_
.
reset
(
HeatTransferModel
<
ThermoCloud
<
ParcelType
>
>::
New
(
this
->
subModelProperties
(),
*
this
).
ptr
()
);
TIntegrator_
.
reset
(
scalarIntegrationScheme
::
New
(
"T"
,
this
->
solution
().
integrationSchemes
()
).
ptr
()
);
this
->
subModelProperties
().
lookup
(
"radiation"
)
>>
radiation_
;
}
template
<
class
ParcelType
>
void
Foam
::
ThermoCloud
<
ParcelType
>::
cloudReset
(
ThermoCloud
<
ParcelType
>&
c
)
{
...
...
@@ -66,27 +91,13 @@ Foam::ThermoCloud<ParcelType>::ThermoCloud
),
thermoCloud
(),
cloudCopyPtr_
(
NULL
),
constProps_
(
this
->
particleProperties
()),
constProps_
(
this
->
particleProperties
()
,
this
->
solution
().
active
()
),
thermo_
(
thermo
),
T_
(
thermo
.
thermo
().
T
()),
p_
(
thermo
.
thermo
().
p
()),
heatTransferModel_
(
HeatTransferModel
<
ThermoCloud
<
ParcelType
>
>::
New
(
this
->
subModelProperties
(),
*
this
)
),
TIntegrator_
(
scalarIntegrationScheme
::
New
(
"T"
,
this
->
solution
().
integrationSchemes
()
)
),
radiation_
(
this
->
subModelProperties
().
lookup
(
"radiation"
)),
heatTransferModel_
(
NULL
),
TIntegrator_
(
NULL
),
radiation_
(
false
),
hsTrans_
(
new
DimensionedField
<
scalar
,
volMesh
>
...
...
@@ -121,6 +132,11 @@ Foam::ThermoCloud<ParcelType>::ThermoCloud
)
{
if
(
this
->
solution
().
active
())
{
setModels
();
}
if
(
readFields
)
{
ParcelType
::
readFields
(
*
this
);
...
...
@@ -143,7 +159,7 @@ Foam::ThermoCloud<ParcelType>::ThermoCloud
KinematicCloud
<
ParcelType
>
(
c
,
name
),
thermoCloud
(),
cloudCopyPtr_
(
NULL
),
constProps_
(
c
.
particlePropertie
s_
),
constProps_
(
c
.
constProp
s_
),
thermo_
(
c
.
thermo_
),
T_
(
c
.
T
()),
p_
(
c
.
p
()),
...
...
src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H
View file @
0b625c20
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-201
0
OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-201
1
OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -128,6 +128,12 @@ protected:
// Protected Member Functions
// Initialisation
//- Set cloud sub-models
void
setModels
();
// Cloud evolution functions
//- Reset state of cloud
...
...
src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H
View file @
0b625c20
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-201
0
OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-201
1
OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -98,22 +98,22 @@ public:
//- Parcel type id - used for post-processing to flag the type
// of parcels issued by this cloud
const
label
parcelTypeId_
;
label
parcelTypeId_
;
//- Minimum density [kg/m3]
const
scalar
rhoMin_
;
scalar
rhoMin_
;
//- Particle density [kg/m3] (constant)
const
scalar
rho0_
;
scalar
rho0_
;
//- Minimum particle mass [kg]
const
scalar
minParticleMass_
;
scalar
minParticleMass_
;
//- Young's modulus [N/m2]
const
scalar
youngsModulus_
;
scalar
youngsModulus_
;
//- Poisson's ratio
const
scalar
poissonsRatio_
;
scalar
poissonsRatio_
;
public:
...
...
@@ -127,7 +127,11 @@ public:
constantProperties
(
const
constantProperties
&
cp
);
//- Constructor from dictionary
constantProperties
(
const
dictionary
&
parentDict
);
constantProperties
(
const
dictionary
&
parentDict
,
const
bool
readFields
=
true
);
// Member functions
...
...
src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelI.H
View file @
0b625c20
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-201
0
OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-201
1
OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -62,17 +62,28 @@ inline Foam::KinematicParcel<ParcelType>::constantProperties::constantProperties
template
<
class
ParcelType
>
inline
Foam
::
KinematicParcel
<
ParcelType
>::
constantProperties
::
constantProperties
(
const
dictionary
&
parentDict
const
dictionary
&
parentDict
,
const
bool
readFields
)
:
dict_
(
parentDict
.
subDict
(
"constantProperties"
)),
parcelTypeId_
(
readLabel
(
dict_
.
lookup
(
"parcelTypeId"
))),
rhoMin_
(
readScalar
(
dict_
.
lookup
(
"rhoMin"
))),
rho0_
(
readScalar
(
dict_
.
lookup
(
"rho0"
))),
minParticleMass_
(
readScalar
(
dict_
.
lookup
(
"minParticleMass"
))),
youngsModulus_
(
readScalar
(
dict_
.
lookup
(
"youngsModulus"
))),
poissonsRatio_
(
readScalar
(
dict_
.
lookup
(
"poissonsRatio"
)))
{}
dict_
(
parentDict
.
subOrEmptyDict
(
"constantProperties"
)),
parcelTypeId_
(
-
1
),
rhoMin_
(
0.0
),
rho0_
(
0.0
),
minParticleMass_
(
0.0
),
youngsModulus_
(
0.0
),
poissonsRatio_
(
0.0
)
{
if
(
readFields
)
{