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
03445584
Commit
03445584
authored
Jan 10, 2011
by
Andrew Heather
Browse files
ENH: Updated enthalpy transfer terms for reacting parcels
parent
2b06a002
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C
View file @
03445584
...
...
@@ -205,6 +205,9 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
const
label
cellI
)
{
typedef
typename
ReactingParcel
<
ParcelType
>::
trackData
::
cloudType
cloudType
;
const
CompositionModel
<
cloudType
>&
composition
=
td
.
cloud
().
composition
();
// Define local properties at beginning of timestep
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const
scalar
np0
=
this
->
nParticle_
;
...
...
@@ -218,9 +221,9 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
const
scalar
pc
=
this
->
pc_
;
const
scalarField
&
YMix
=
this
->
Y_
;
const
label
idG
=
td
.
cloud
().
composition
()
.
idGas
();
const
label
idL
=
td
.
cloud
().
composition
()
.
idLiquid
();
const
label
idS
=
td
.
cloud
().
composition
()
.
idSolid
();
const
label
idG
=
composition
.
idGas
();
const
label
idL
=
composition
.
idLiquid
();
const
label
idS
=
composition
.
idSolid
();
// Calc surface values
...
...
@@ -262,7 +265,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
scalar
NCpW
=
0
.
0
;
// Surface concentrations of emitted species
scalarField
Cs
(
td
.
cloud
().
composition
()
.
carrier
().
species
().
size
(),
0
.
0
);
scalarField
Cs
(
composition
.
carrier
().
species
().
size
(),
0
.
0
);
// Calc mass and enthalpy transfer due to phase change
this
->
calcPhaseChange
...
...
@@ -323,12 +326,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
scalarField
dMassSRGas
(
YGas_
.
size
(),
0
.
0
);
scalarField
dMassSRLiquid
(
YLiquid_
.
size
(),
0
.
0
);
scalarField
dMassSRSolid
(
YSolid_
.
size
(),
0
.
0
);
scalarField
dMassSRCarrier
(
td
.
cloud
().
composition
().
carrier
().
species
().
size
(),
0
.
0
);
scalarField
dMassSRCarrier
(
composition
.
carrier
().
species
().
size
(),
0
.
0
);
// Clac mass and enthalpy transfer due to surface reactions
calcSurfaceReactions
...
...
@@ -423,25 +421,33 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
// Transfer mass lost from particle to carrier mass source
forAll
(
YGas_
,
i
)
{
label
gid
=
td
.
cloud
().
composition
()
.
localToGlobalCarrierId
(
GAS
,
i
);
label
gid
=
composition
.
localToGlobalCarrierId
(
GAS
,
i
);
td
.
cloud
().
rhoTrans
(
gid
)[
cellI
]
+=
np0
*
dMassGas
[
i
];
td
.
cloud
().
hsTrans
()[
cellI
]
+=
np0
*
dMassGas
[
i
]
*
composition
.
carrier
().
Hs
(
gid
,
T0
);
}
forAll
(
YLiquid_
,
i
)
{
label
gid
=
td
.
cloud
().
composition
()
.
localToGlobalCarrierId
(
LIQ
,
i
);
label
gid
=
composition
.
localToGlobalCarrierId
(
LIQ
,
i
);
td
.
cloud
().
rhoTrans
(
gid
)[
cellI
]
+=
np0
*
dMassLiquid
[
i
];
td
.
cloud
().
hsTrans
()[
cellI
]
+=
np0
*
dMassLiquid
[
i
]
*
composition
.
carrier
().
Hs
(
gid
,
T0
);
}
/*
// No mapping between solid components and carrier phase
forAll(YSolid_, i)
{
label gid =
td.cloud().
composition
()
.localToGlobalCarrierId(SLD, i);
label gid = composition.localToGlobalCarrierId(SLD, i);
td.cloud().rhoTrans(gid)[cellI] += np0*dMassSolid[i];
td.cloud().hsTrans()[cellI] +=
np0*dMassSolid[i]*composition.carrier().Hs(gid, T0);
}
*/
forAll
(
dMassSRCarrier
,
i
)
{
td
.
cloud
().
rhoTrans
(
i
)[
cellI
]
+=
np0
*
dMassSRCarrier
[
i
];
td
.
cloud
().
hsTrans
()[
cellI
]
+=
np0
*
dMassSRCarrier
[
i
]
*
composition
.
carrier
().
Hs
(
i
,
T0
);
}
// Update momentum transfer
...
...
@@ -470,14 +476,12 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
// Absorb parcel into carrier phase
forAll
(
YGas_
,
i
)
{
label
gid
=
td
.
cloud
().
composition
().
localToGlobalCarrierId
(
GAS
,
i
);
label
gid
=
composition
.
localToGlobalCarrierId
(
GAS
,
i
);
td
.
cloud
().
rhoTrans
(
gid
)[
cellI
]
+=
np0
*
mass1
*
YMix
[
GAS
]
*
YGas_
[
i
];
}
forAll
(
YLiquid_
,
i
)
{
label
gid
=
td
.
cloud
().
composition
().
localToGlobalCarrierId
(
LIQ
,
i
);
label
gid
=
composition
.
localToGlobalCarrierId
(
LIQ
,
i
);
td
.
cloud
().
rhoTrans
(
gid
)[
cellI
]
+=
np0
*
mass1
*
YMix
[
LIQ
]
*
YLiquid_
[
i
];
}
...
...
@@ -485,8 +489,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
// No mapping between solid components and carrier phase
forAll(YSolid_, i)
{
label gid =
td.cloud().composition().localToGlobalCarrierId(SLD, i);
label gid = composition.localToGlobalCarrierId(SLD, i);
td.cloud().rhoTrans(gid)[cellI] +=
np0*mass1*YMix[SLD]*YSolid_[i];
}
...
...
@@ -551,6 +554,9 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calcDevolatilisation
return
;
}
typedef
typename
ReactingParcel
<
ParcelType
>::
trackData
::
cloudType
cloudType
;
const
CompositionModel
<
cloudType
>&
composition
=
td
.
cloud
().
composition
();
// Total mass of volatiles evolved
td
.
cloud
().
devolatilisation
().
calculate
(
...
...
@@ -578,10 +584,9 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calcDevolatilisation
// Note: hardcoded gaseous diffusivities for now
// TODO: add to carrier thermo
const
scalar
beta
=
sqr
(
cbrt
(
15
.
0
)
+
cbrt
(
15
.
0
));
const
label
id
=
td
.
cloud
().
composition
().
localToGlobalCarrierId
(
GAS
,
i
);
const
scalar
Cp
=
td
.
cloud
().
thermo
().
carrier
().
Cp
(
id
,
Ts
);
const
scalar
W
=
td
.
cloud
().
thermo
().
carrier
().
W
(
id
);
const
label
id
=
composition
.
localToGlobalCarrierId
(
GAS
,
i
);
const
scalar
Cp
=
composition
.
carrier
().
Cp
(
id
,
Ts
);
const
scalar
W
=
composition
.
carrier
().
W
(
id
);
const
scalar
Ni
=
dMassDV
[
i
]
/
(
this
->
areaS
(
d
)
*
dt
*
W
);
// Dab calc'd using API vapour mass diffusivity function
...
...
src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C
View file @
03445584
...
...
@@ -236,6 +236,9 @@ void Foam::ReactingParcel<ParcelType>::calc
const
label
cellI
)
{
typedef
typename
ReactingParcel
<
ParcelType
>::
trackData
::
cloudType
cloudType
;
const
CompositionModel
<
cloudType
>&
composition
=
td
.
cloud
().
composition
();
// Define local properties at beginning of time step
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const
scalar
np0
=
this
->
nParticle_
;
...
...
@@ -285,7 +288,7 @@ void Foam::ReactingParcel<ParcelType>::calc
scalar
NCpW
=
0
.
0
;
// Surface concentrations of emitted species
scalarField
Cs
(
td
.
cloud
().
composition
()
.
carrier
().
species
().
size
(),
0
.
0
);
scalarField
Cs
(
composition
.
carrier
().
species
().
size
(),
0
.
0
);
// Calc mass and enthalpy transfer due to phase change
calcPhaseChange
...
...
@@ -372,8 +375,10 @@ void Foam::ReactingParcel<ParcelType>::calc
// Transfer mass lost from particle to carrier mass source
forAll
(
dMassPC
,
i
)
{
label
gid
=
td
.
cloud
().
composition
()
.
localToGlobalCarrierId
(
0
,
i
);
label
gid
=
composition
.
localToGlobalCarrierId
(
0
,
i
);
td
.
cloud
().
rhoTrans
(
gid
)[
cellI
]
+=
np0
*
dMassPC
[
i
];
td
.
cloud
().
hsTrans
()[
cellI
]
+=
np0
*
dMassPC
[
i
]
*
composition
.
carrier
().
Hs
(
gid
,
T0
);
}
// Update momentum transfer
...
...
@@ -401,13 +406,12 @@ void Foam::ReactingParcel<ParcelType>::calc
// Absorb parcel into carrier phase
forAll
(
Y_
,
i
)
{
label
gid
=
td
.
cloud
().
composition
().
localToGlobalCarrierId
(
0
,
i
);
label
gid
=
composition
.
localToGlobalCarrierId
(
0
,
i
);
td
.
cloud
().
rhoTrans
(
gid
)[
cellI
]
+=
np0
*
mass1
*
Y_
[
i
];
}
td
.
cloud
().
UTrans
()[
cellI
]
+=
np0
*
mass1
*
U1
;
td
.
cloud
().
hsTrans
()[
cellI
]
+=
np0
*
mass1
*
td
.
cloud
().
composition
()
.
H
(
0
,
Y_
,
pc_
,
T1
);
np0
*
mass1
*
composition
.
H
(
0
,
Y_
,
pc_
,
T1
);
}
}
...
...
@@ -417,7 +421,7 @@ void Foam::ReactingParcel<ParcelType>::calc
else
{
this
->
Cp_
=
td
.
cloud
().
composition
()
.
Cp
(
0
,
Y_
,
pc_
,
T1
);
this
->
Cp_
=
composition
.
Cp
(
0
,
Y_
,
pc_
,
T1
);
this
->
T_
=
T1
;
this
->
U_
=
U1
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment