Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
490f1ca5
Commit
490f1ca5
authored
May 27, 2011
by
andy
Browse files
ENH: Split parcel initialisation into 2 parts around injection
parent
556ae647
Changes
11
Hide whitespace changes
Inline
Side-by-side
src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C
View file @
490f1ca5
...
...
@@ -499,7 +499,7 @@ bool Foam::KinematicCloud<CloudType>::hasWallImpactDistance() const
template
<
class
CloudType
>
void
Foam
::
KinematicCloud
<
CloudType
>::
check
ParcelProperties
void
Foam
::
KinematicCloud
<
CloudType
>::
set
Parcel
Thermo
Properties
(
parcelType
&
parcel
,
const
scalar
lagrangianDt
,
...
...
@@ -510,7 +510,17 @@ void Foam::KinematicCloud<CloudType>::checkParcelProperties
{
parcel
.
rho
()
=
constProps_
.
rho0
();
}
}
template
<
class
CloudType
>
void
Foam
::
KinematicCloud
<
CloudType
>::
checkParcelProperties
(
parcelType
&
parcel
,
const
scalar
lagrangianDt
,
const
bool
fullyDescribed
)
{
const
scalar
carrierDt
=
mesh_
.
time
().
deltaTValue
();
parcel
.
stepFraction
()
=
(
carrierDt
-
lagrangianDt
)
/
carrierDt
;
parcel
.
typeId
()
=
constProps_
.
parcelTypeId
();
...
...
src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H
View file @
490f1ca5
...
...
@@ -486,6 +486,14 @@ public:
// Cloud evolution functions
//- Set parcel thermo properties
void
setParcelThermoProperties
(
parcelType
&
parcel
,
const
scalar
lagrangianDt
,
const
bool
fullyDescribed
);
//- Check parcel properties
void
checkParcelProperties
(
...
...
src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.C
View file @
490f1ca5
...
...
@@ -224,22 +224,18 @@ Foam::ReactingCloud<CloudType>::~ReactingCloud()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template
<
class
CloudType
>
void
Foam
::
ReactingCloud
<
CloudType
>::
check
ParcelProperties
void
Foam
::
ReactingCloud
<
CloudType
>::
set
Parcel
Thermo
Properties
(
parcelType
&
parcel
,
const
scalar
lagrangianDt
,
const
bool
fullyDescribed
)
{
CloudType
::
checkParcelProperties
(
parcel
,
lagrangianDt
,
fullyDescribed
);
CloudType
::
setParcelThermoProperties
(
parcel
,
lagrangianDt
,
fullyDescribed
);
if
(
!
fullyDescribed
)
{
parcel
.
pc
()
=
this
->
thermo
().
thermo
().
p
()[
parcel
.
cell
()];
parcel
.
Y
()
=
composition
().
YMixture0
();
}
else
...
...
@@ -257,6 +253,18 @@ void Foam::ReactingCloud<CloudType>::checkParcelProperties
}
template
<
class
CloudType
>
void
Foam
::
ReactingCloud
<
CloudType
>::
checkParcelProperties
(
parcelType
&
parcel
,
const
scalar
lagrangianDt
,
const
bool
fullyDescribed
)
{
CloudType
::
checkParcelProperties
(
parcel
,
lagrangianDt
,
fullyDescribed
);
}
template
<
class
CloudType
>
void
Foam
::
ReactingCloud
<
CloudType
>::
storeState
()
{
...
...
src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.H
View file @
490f1ca5
...
...
@@ -267,6 +267,14 @@ public:
// Cloud evolution functions
//- Set parcel thermo properties
void
setParcelThermoProperties
(
parcelType
&
parcel
,
const
scalar
lagrangianDt
,
const
bool
fullyDescribed
);
//- Check parcel properties
void
checkParcelProperties
(
...
...
src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.C
View file @
490f1ca5
...
...
@@ -155,19 +155,14 @@ Foam::ReactingMultiphaseCloud<CloudType>::~ReactingMultiphaseCloud()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template
<
class
CloudType
>
void
Foam
::
ReactingMultiphaseCloud
<
CloudType
>::
check
ParcelProperties
void
Foam
::
ReactingMultiphaseCloud
<
CloudType
>::
set
Parcel
Thermo
Properties
(
parcelType
&
parcel
,
const
scalar
lagrangianDt
,
const
bool
fullyDescribed
)
{
CloudType
::
checkParcelProperties
(
parcel
,
lagrangianDt
,
fullyDescribed
);
CloudType
::
setParcelThermoProperties
(
parcel
,
lagrangianDt
,
fullyDescribed
);
label
idGas
=
this
->
composition
().
idGas
();
label
idLiquid
=
this
->
composition
().
idLiquid
();
...
...
@@ -203,6 +198,18 @@ void Foam::ReactingMultiphaseCloud<CloudType>::checkParcelProperties
}
template
<
class
CloudType
>
void
Foam
::
ReactingMultiphaseCloud
<
CloudType
>::
checkParcelProperties
(
parcelType
&
parcel
,
const
scalar
lagrangianDt
,
const
bool
fullyDescribed
)
{
CloudType
::
checkParcelProperties
(
parcel
,
lagrangianDt
,
fullyDescribed
);
}
template
<
class
CloudType
>
void
Foam
::
ReactingMultiphaseCloud
<
CloudType
>::
storeState
()
{
...
...
src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.H
View file @
490f1ca5
...
...
@@ -240,6 +240,14 @@ public:
// Cloud evolution functions
//- Set parcel thermo properties
void
setParcelThermoProperties
(
parcelType
&
parcel
,
const
scalar
lagrangianDt
,
const
bool
fullyDescribed
);
//- Check parcel properties
void
checkParcelProperties
(
...
...
src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C
View file @
490f1ca5
...
...
@@ -234,14 +234,14 @@ Foam::ThermoCloud<CloudType>::~ThermoCloud()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template
<
class
CloudType
>
void
Foam
::
ThermoCloud
<
CloudType
>::
check
ParcelProperties
void
Foam
::
ThermoCloud
<
CloudType
>::
set
Parcel
Thermo
Properties
(
parcelType
&
parcel
,
const
scalar
lagrangianDt
,
const
bool
fullyDescribed
)
{
CloudType
::
check
ParcelProperties
(
parcel
,
lagrangianDt
,
fullyDescribed
);
CloudType
::
set
Parcel
Thermo
Properties
(
parcel
,
lagrangianDt
,
fullyDescribed
);
if
(
!
fullyDescribed
)
{
...
...
@@ -251,6 +251,18 @@ void Foam::ThermoCloud<CloudType>::checkParcelProperties
}
template
<
class
CloudType
>
void
Foam
::
ThermoCloud
<
CloudType
>::
checkParcelProperties
(
parcelType
&
parcel
,
const
scalar
lagrangianDt
,
const
bool
fullyDescribed
)
{
CloudType
::
checkParcelProperties
(
parcel
,
lagrangianDt
,
fullyDescribed
);
}
template
<
class
CloudType
>
void
Foam
::
ThermoCloud
<
CloudType
>::
storeState
()
{
...
...
src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H
View file @
490f1ca5
...
...
@@ -281,6 +281,14 @@ public:
// Cloud evolution functions
//- Set parcel thermo properties
void
setParcelThermoProperties
(
parcelType
&
parcel
,
const
scalar
lagrangianDt
,
const
bool
fullyDescribed
);
//- Check parcel properties
void
checkParcelProperties
(
...
...
src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C
View file @
490f1ca5
...
...
@@ -530,6 +530,7 @@ void Foam::InjectionModel<CloudType>::inject(TrackData& td)
const
scalar
time
=
this
->
owner
().
db
().
time
().
value
();
const
scalar
trackTime
=
this
->
owner
().
solution
().
trackTime
();
const
polyMesh
&
mesh
=
this
->
owner
().
mesh
();
typename
TrackData
::
cloudType
&
cloud
=
td
.
cloud
();
// Prepare for next time step
label
parcelsAdded
=
0
;
...
...
@@ -592,11 +593,14 @@ void Foam::InjectionModel<CloudType>::inject(TrackData& td)
);
// Check/set new parcel properties
td
.
cloud
().
checkParcel
Properties
(
*
pPtr
,
dt
,
fullyDescribed
());
cloud
.
setParcelThermo
Properties
(
*
pPtr
,
dt
,
fullyDescribed
());
// Assign new parcel properties in injection model
setProperties
(
parcelI
,
newParcels
,
timeInj
,
*
pPtr
);
// Check/set new parcel properties
cloud
.
checkParcelProperties
(
*
pPtr
,
dt
,
fullyDescribed
());
// Apply correction to velocity for 2-D cases
meshTools
::
constrainDirection
(
...
...
@@ -647,6 +651,7 @@ void Foam::InjectionModel<CloudType>::injectSteadyState
}
const
polyMesh
&
mesh
=
this
->
owner
().
mesh
();
typename
TrackData
::
cloudType
&
cloud
=
td
.
cloud
();
// Reset counters
time0_
=
0
.
0
;
...
...
@@ -696,12 +701,15 @@ void Foam::InjectionModel<CloudType>::injectSteadyState
tetPtI
);
// Check new parcel properties
td
.
cloud
().
checkParcel
Properties
(
*
pPtr
,
0
.
0
,
fullyDescribed
());
// Check
/set
new parcel properties
cloud
.
setParcelThermo
Properties
(
*
pPtr
,
0
.
0
,
fullyDescribed
());
// Assign new parcel properties in injection model
setProperties
(
parcelI
,
newParcels
,
0
.
0
,
*
pPtr
);
// Check/set new parcel properties
cloud
.
checkParcelProperties
(
*
pPtr
,
0
.
0
,
fullyDescribed
());
// Apply correction to velocity for 2-D cases
meshTools
::
constrainDirection
(
...
...
src/lagrangian/spray/clouds/Templates/SprayCloud/SprayCloud.C
View file @
490f1ca5
...
...
@@ -158,28 +158,38 @@ Foam::SprayCloud<CloudType>::~SprayCloud()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template
<
class
CloudType
>
void
Foam
::
SprayCloud
<
CloudType
>::
check
ParcelProperties
void
Foam
::
SprayCloud
<
CloudType
>::
set
Parcel
Thermo
Properties
(
parcelType
&
parcel
,
const
scalar
lagrangianDt
,
const
bool
fullyDescribed
)
{
CloudType
::
checkParcelProperties
(
parcel
,
lagrangianDt
,
fullyDescribed
);
CloudType
::
setParcelThermoProperties
(
parcel
,
lagrangianDt
,
fullyDescribed
);
const
liquidMixtureProperties
&
liqMix
=
this
->
composition
().
liquids
();
if
(
!
fullyDescribed
)
{
const
liquidMixtureProperties
&
liqMix
=
this
->
composition
().
liquids
();
const
scalarField
&
Y
(
parcel
.
Y
());
scalarField
X
(
liqMix
.
X
(
Y
));
// override rho and Cp from constantProperties
parcel
.
Cp
()
=
liqMix
.
Cp
(
parcel
.
pc
(),
parcel
.
T
(),
X
);
parcel
.
rho
()
=
liqMix
.
rho
(
parcel
.
pc
(),
parcel
.
T
(),
X
);
}
}
const
scalarField
&
Y
(
parcel
.
Y
());
scalarField
X
(
liqMix
.
X
(
Y
));
// override rho and Cp from constantProperties
parcel
.
Cp
()
=
liqMix
.
Cp
(
parcel
.
pc
(),
parcel
.
T
(),
X
);
parcel
.
rho
()
=
liqMix
.
rho
(
parcel
.
pc
(),
parcel
.
T
(),
X
);
template
<
class
CloudType
>
void
Foam
::
SprayCloud
<
CloudType
>::
checkParcelProperties
(
parcelType
&
parcel
,
const
scalar
lagrangianDt
,
const
bool
fullyDescribed
)
{
CloudType
::
checkParcelProperties
(
parcel
,
lagrangianDt
,
fullyDescribed
);
// store the injection position and initial drop size
parcel
.
position0
()
=
parcel
.
position
();
...
...
src/lagrangian/spray/clouds/Templates/SprayCloud/SprayCloud.H
View file @
490f1ca5
...
...
@@ -209,6 +209,14 @@ public:
// Cloud evolution functions
//- Set parcel thermo properties
void
setParcelThermoProperties
(
parcelType
&
parcel
,
const
scalar
lagrangianDt
,
const
bool
fullyDescribed
);
//- Check parcel properties
void
checkParcelProperties
(
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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