Merge branch 'feature-lagrangian' into 'develop'

Feature lagrangian

Minor adjustments to static information attached to lagrangian parcels/particles.
Fixes #108 (duplicate of http://www.openfoam.org/mantisbt/view.php?id=1990), #109, #110, #111.

Future reworking would require a better mechanism to also deal with dynamic information such as particle collisions etc.


See merge request !34
This commit is contained in:
Andrew Heather 2016-06-03 16:14:49 +01:00
commit 1a6e8c569e
27 changed files with 259 additions and 137 deletions

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -69,14 +69,12 @@ class DSMCParcel
:
public ParcelType
{
// Private member data
//- Size in bytes of the fields
static const std::size_t sizeofFields_;
public:
//- Size in bytes of the fields
static const std::size_t sizeofFields;
//- Class to hold DSMC particle constant properties
class constantProperties
{

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -31,7 +31,7 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template<class ParcelType>
const std::size_t Foam::DSMCParcel<ParcelType>::sizeofFields_
const std::size_t Foam::DSMCParcel<ParcelType>::sizeofFields
(
sizeof(DSMCParcel<ParcelType>) - sizeof(ParcelType)
);
@ -62,7 +62,7 @@ Foam::DSMCParcel<ParcelType>::DSMCParcel
}
else
{
is.read(reinterpret_cast<char*>(&U_), sizeofFields_);
is.read(reinterpret_cast<char*>(&U_), sizeofFields);
}
}
@ -160,7 +160,7 @@ Foam::Ostream& Foam::operator<<
os.write
(
reinterpret_cast<const char*>(&p.U_),
DSMCParcel<ParcelType>::sizeofFields_
DSMCParcel<ParcelType>::sizeofFields
);
}

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -85,12 +85,12 @@ class particle
//- Size in bytes of the position data
static const std::size_t sizeofPosition_;
//- Size in bytes of the fields
static const std::size_t sizeofFields_;
public:
//- Size in bytes of the fields
static const std::size_t sizeofFields;
template<class CloudType>
class TrackingData
{
@ -319,6 +319,12 @@ public:
"tetFaceI tetPtI origProc origId"
);
//- String representation of property types
DefinePropertyTypes
(
"vector label label scalar label label label label"
);
//- Cumulative particle counter - used to provode unique ID
static label particleCount_;

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -28,14 +28,15 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
Foam::string Foam::particle::propertyList_ = Foam::particle::propertyList();
Foam::string Foam::particle::propertyList_ = Foam::particle::propertyList();
Foam::string Foam::particle::propertyTypes_ = Foam::particle::propertyTypes();
const std::size_t Foam::particle::sizeofPosition_
(
offsetof(particle, faceI_) - offsetof(particle, position_)
);
const std::size_t Foam::particle::sizeofFields_
const std::size_t Foam::particle::sizeofFields
(
sizeof(particle) - offsetof(particle, position_)
);
@ -73,7 +74,7 @@ Foam::particle::particle(const polyMesh& mesh, Istream& is, bool readFields)
{
if (readFields)
{
is.read(reinterpret_cast<char*>(&position_), sizeofFields_);
is.read(reinterpret_cast<char*>(&position_), sizeofFields);
}
else
{
@ -120,7 +121,7 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const particle& p)
os.write
(
reinterpret_cast<const char*>(&p.position_),
particle::sizeofFields_
particle::sizeofFields
);
}

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -39,6 +39,9 @@ namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//- Define a static 'propertyList' for particle properties
// The property list is space-delimited with brackets for vector groupings
// \sa AddToPropertyList
#define DefinePropertyList(str) \
\
static string propertyList_; \
@ -49,6 +52,9 @@ namespace Foam
}
//- Add to existing static 'propertyList' for particle properties
// The property list is space-delimited with brackets for vector groupings
// \sa DefinePropertyList
#define AddToPropertyList(ParcelType, str) \
\
static string propertyList_; \
@ -59,6 +65,30 @@ namespace Foam
}
//- Define a static 'propertyTypes' for the types of particle properties
// \sa AddToPropertyTypes
#define DefinePropertyTypes(str) \
\
static string propertyTypes_; \
\
static string propertyTypes() \
{ \
return str; \
}
//- Add to existing static 'propertyTypes' for the types of particle properties
// \sa AddToPropertyTypes
#define AddToPropertyTypes(ParcelType, str) \
\
static string propertyTypes_; \
\
static string propertyTypes() \
{ \
return ParcelType::propertyTypes() + str; \
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -72,14 +72,12 @@ class CollidingParcel
:
public ParcelType
{
// Private member data
//- Size in bytes of the fields
static const std::size_t sizeofFields_;
public:
//- Size in bytes of the fields
static const std::size_t sizeofFields;
//- Class to hold thermo particle constant properties
class constantProperties
:
@ -160,6 +158,14 @@ public:
+ " (collisionRecordsWallData)"
);
//- String representation of property types
static string propertyTypes()
{
// TODO: collision information types
NotImplemented;
return string::null;
}
// Constructors

View File

@ -34,7 +34,7 @@ Foam::string Foam::CollidingParcel<ParcelType>::propertyList_ =
Foam::CollidingParcel<ParcelType>::propertyList();
template<class ParcelType>
const std::size_t Foam::CollidingParcel<ParcelType>::sizeofFields_
const std::size_t Foam::CollidingParcel<ParcelType>::sizeofFields
(
offsetof(CollidingParcel<ParcelType>, collisionRecords_)
- offsetof(CollidingParcel<ParcelType>, f_)
@ -67,7 +67,7 @@ Foam::CollidingParcel<ParcelType>::CollidingParcel
}
else
{
is.read(reinterpret_cast<char*>(&f_), sizeofFields_);
is.read(reinterpret_cast<char*>(&f_), sizeofFields);
}
is >> collisionRecords_;
@ -297,7 +297,7 @@ Foam::Ostream& Foam::operator<<
os.write
(
reinterpret_cast<const char*>(&p.f_),
CollidingParcel<ParcelType>::sizeofFields_
CollidingParcel<ParcelType>::sizeofFields
);
os << p.collisionRecords();
}

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -80,15 +80,15 @@ class KinematicParcel
{
// Private data
//- Size in bytes of the fields
static const std::size_t sizeofFields_;
//- Number of particle tracking attempts before we assume that it stalls
static label maxTrackAttempts;
public:
//- Size in bytes of the fields
static const std::size_t sizeofFields;
//- Class to hold kinematic particle constant properties
class constantProperties
{
@ -234,7 +234,8 @@ protected:
// Parcel properties
//- Active flag - tracking inactive when active = false
bool active_;
// Store as label for data alignment, but only has bool states
label active_;
//- Parcel type id
label typeId_;
@ -309,7 +310,7 @@ public:
+ " typeId"
+ " nParticle"
+ " d"
+ " dTarget "
+ " dTarget"
+ " (Ux Uy Uz)"
+ " rho"
+ " age"
@ -317,6 +318,22 @@ public:
+ " (UTurbx UTurby UTurbz)"
);
//- String representation of property types
AddToPropertyTypes
(
ParcelType,
" label"
+ " label"
+ " scalar"
+ " scalar"
+ " scalar"
+ " vector"
+ " scalar"
+ " scalar"
+ " scalar"
+ " vector"
);
// Constructors
@ -442,8 +459,8 @@ public:
// Edit
//- Return const access to active flag
inline bool& active();
//- Set active flag to the specified state
inline void active(const bool state);
//- Return access to type id
inline label& typeId();

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -265,9 +265,9 @@ inline Foam::scalar Foam::KinematicParcel<ParcelType>::muc() const
template<class ParcelType>
inline bool& Foam::KinematicParcel<ParcelType>::active()
inline void Foam::KinematicParcel<ParcelType>::active(const bool state)
{
return active_;
active_ = state;
}

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -35,7 +35,11 @@ Foam::string Foam::KinematicParcel<ParcelType>::propertyList_ =
Foam::KinematicParcel<ParcelType>::propertyList();
template<class ParcelType>
const std::size_t Foam::KinematicParcel<ParcelType>::sizeofFields_
Foam::string Foam::KinematicParcel<ParcelType>::propertyTypes_ =
Foam::KinematicParcel<ParcelType>::propertyTypes();
template<class ParcelType>
const std::size_t Foam::KinematicParcel<ParcelType>::sizeofFields
(
offsetof(KinematicParcel<ParcelType>, rhoc_)
- offsetof(KinematicParcel<ParcelType>, active_)
@ -84,7 +88,7 @@ Foam::KinematicParcel<ParcelType>::KinematicParcel
}
else
{
is.read(reinterpret_cast<char*>(&active_), sizeofFields_);
is.read(reinterpret_cast<char*>(&active_), sizeofFields);
}
}
@ -229,7 +233,7 @@ Foam::Ostream& Foam::operator<<
if (os.format() == IOstream::ASCII)
{
os << static_cast<const ParcelType&>(p)
<< token::SPACE << p.active()
<< token::SPACE << bool(p.active())
<< token::SPACE << p.typeId()
<< token::SPACE << p.nParticle()
<< token::SPACE << p.d()
@ -246,7 +250,7 @@ Foam::Ostream& Foam::operator<<
os.write
(
reinterpret_cast<const char*>(&p.active_),
KinematicParcel<ParcelType>::sizeofFields_
KinematicParcel<ParcelType>::sizeofFields
);
}

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -73,14 +73,13 @@ class MPPICParcel
:
public ParcelType
{
// Private data
//- Size in bytes of the fields
static const std::size_t sizeofFields_;
public:
//- Size in bytes of the fields
static const std::size_t sizeofFields;
//- Tracking data
template<class CloudType>
class TrackingData
:
@ -175,7 +174,14 @@ public:
AddToPropertyList
(
ParcelType,
"(UCorrectx UCorrecty UCorrectz)"
" (UCorrectx UCorrecty UCorrectz)"
);
//- String representation of property types
AddToPropertyTypes
(
ParcelType,
" vector"
);

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -34,7 +34,11 @@ Foam::string Foam::MPPICParcel<ParcelType>::propertyList_ =
Foam::MPPICParcel<ParcelType>::propertyList();
template<class ParcelType>
const std::size_t Foam::MPPICParcel<ParcelType>::sizeofFields_
Foam::string Foam::MPPICParcel<ParcelType>::propertyTypes_ =
Foam::MPPICParcel<ParcelType>::propertyTypes();
template<class ParcelType>
const std::size_t Foam::MPPICParcel<ParcelType>::sizeofFields
(
sizeof(MPPICParcel<ParcelType>) - sizeof(ParcelType)
);
@ -61,7 +65,7 @@ Foam::MPPICParcel<ParcelType>::MPPICParcel
}
else
{
is.read(reinterpret_cast<char*>(&UCorrect_), sizeofFields_);
is.read(reinterpret_cast<char*>(&UCorrect_), sizeofFields);
}
}
@ -146,7 +150,7 @@ Foam::Ostream& Foam::operator<<
os.write
(
reinterpret_cast<const char*>(&p.UCorrect_),
MPPICParcel<ParcelType>::sizeofFields_
MPPICParcel<ParcelType>::sizeofFields
);
}

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -66,14 +66,12 @@ class ReactingMultiphaseParcel
:
public ParcelType
{
// Private data
//- Size in bytes of the fields
static const std::size_t sizeofFields_;
public:
//- Size in bytes of the fields
static const std::size_t sizeofFields;
// IDs of phases in ReacingParcel phase list (Y)
static const label GAS;
@ -267,6 +265,15 @@ public:
+ " nSolid(Y1..YN)"
);
//- String representation of property types
AddToPropertyTypes
(
ParcelType,
" List<scalar>"
+ " List<scalar>"
+ " List<Scalar>"
);
// Constructors

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -33,7 +33,11 @@ Foam::string Foam::ReactingMultiphaseParcel<ParcelType>::propertyList_ =
Foam::ReactingMultiphaseParcel<ParcelType>::propertyList();
template<class ParcelType>
const std::size_t Foam::ReactingMultiphaseParcel<ParcelType>::sizeofFields_
Foam::string Foam::ReactingMultiphaseParcel<ParcelType>::propertyTypes_ =
Foam::ReactingMultiphaseParcel<ParcelType>::propertyTypes();
template<class ParcelType>
const std::size_t Foam::ReactingMultiphaseParcel<ParcelType>::sizeofFields
(
0
);

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -67,14 +67,12 @@ class ReactingParcel
:
public ParcelType
{
// Private data
//- Size in bytes of the fields
static const std::size_t sizeofFields_;
public:
//- Size in bytes of the fields
static const std::size_t sizeofFields;
//- Class to hold reacting parcel constant properties
class constantProperties
:
@ -221,6 +219,14 @@ public:
+ " nPhases(Y1..YN)"
);
//- String representation of property types
AddToPropertyTypes
(
ParcelType,
" scalar"
+ " List<scalar>"
);
// Constructors

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -33,7 +33,11 @@ Foam::string Foam::ReactingParcel<ParcelType>::propertyList_ =
Foam::ReactingParcel<ParcelType>::propertyList();
template<class ParcelType>
const std::size_t Foam::ReactingParcel<ParcelType>::sizeofFields_
Foam::string Foam::ReactingParcel<ParcelType>::propertyTypes_ =
Foam::ReactingParcel<ParcelType>::propertyTypes();
template<class ParcelType>
const std::size_t Foam::ReactingParcel<ParcelType>::sizeofFields
(
sizeof(scalar)
);
@ -64,7 +68,7 @@ Foam::ReactingParcel<ParcelType>::ReactingParcel
}
else
{
is.read(reinterpret_cast<char*>(&mass0_), sizeofFields_);
is.read(reinterpret_cast<char*>(&mass0_), sizeofFields);
is >> Ymix;
}
@ -251,7 +255,7 @@ Foam::Ostream& Foam::operator<<
os.write
(
reinterpret_cast<const char*>(&p.mass0_),
ReactingParcel<ParcelType>::sizeofFields_
ReactingParcel<ParcelType>::sizeofFields
);
os << p.Y();
}

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -67,14 +67,12 @@ class ThermoParcel
:
public ParcelType
{
// Private data
//- Size in bytes of the fields
static const std::size_t sizeofFields_;
public:
//- Size in bytes of the fields
static const std::size_t sizeofFields;
//- Class to hold thermo particle constant properties
class constantProperties
:
@ -277,6 +275,14 @@ public:
+ " Cp"
);
//- String representation of property types
AddToPropertyTypes
(
ParcelType,
" scalar"
+ " scalar"
);
// Constructors

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -33,7 +33,11 @@ Foam::string Foam::ThermoParcel<ParcelType>::propertyList_ =
Foam::ThermoParcel<ParcelType>::propertyList();
template<class ParcelType>
const std::size_t Foam::ThermoParcel<ParcelType>::sizeofFields_
Foam::string Foam::ThermoParcel<ParcelType>::propertyTypes_ =
Foam::ThermoParcel<ParcelType>::propertyTypes();
template<class ParcelType>
const std::size_t Foam::ThermoParcel<ParcelType>::sizeofFields
(
offsetof(ThermoParcel<ParcelType>, Tc_)
- offsetof(ThermoParcel<ParcelType>, T_)
@ -65,7 +69,7 @@ Foam::ThermoParcel<ParcelType>::ThermoParcel
}
else
{
is.read(reinterpret_cast<char*>(&T_), sizeofFields_);
is.read(reinterpret_cast<char*>(&T_), sizeofFields);
}
}
@ -154,7 +158,7 @@ Foam::Ostream& Foam::operator<<
os.write
(
reinterpret_cast<const char*>(&p.T_),
ThermoParcel<ParcelType>::sizeofFields_
ThermoParcel<ParcelType>::sizeofFields
);
}

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -181,7 +181,6 @@ bool Foam::LocalInteraction<CloudType>::correct
if (patchI >= 0)
{
vector& U = p.U();
bool& active = p.active();
typename PatchInteractionModel<CloudType>::interactionType it =
this->wordToInteractionType
@ -196,7 +195,7 @@ bool Foam::LocalInteraction<CloudType>::correct
scalar dm = p.mass()*p.nParticle();
keepParticle = false;
active = false;
p.active(false);
U = Zero;
nEscape_[patchI]++;
massEscape_[patchI] += dm;
@ -213,7 +212,7 @@ bool Foam::LocalInteraction<CloudType>::correct
scalar dm = p.mass()*p.nParticle();
keepParticle = true;
active = false;
p.active(false);
U = Zero;
nStick_[patchI]++;
massStick_[patchI] += dm;
@ -228,7 +227,7 @@ bool Foam::LocalInteraction<CloudType>::correct
case PatchInteractionModel<CloudType>::itRebound:
{
keepParticle = true;
active = true;
p.active(true);
vector nw;
vector Up;

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -69,7 +69,7 @@ bool Foam::Rebound<CloudType>::correct
vector& U = p.U();
keepParticle = true;
p.active() = true;
p.active(true);
vector nw;
vector Up;

View File

@ -112,8 +112,6 @@ bool Foam::StandardWallInteraction<CloudType>::correct
{
vector& U = p.U();
bool& active = p.active();
if (isA<wallPolyPatch>(pp))
{
switch (interactionType_)
@ -121,7 +119,7 @@ bool Foam::StandardWallInteraction<CloudType>::correct
case PatchInteractionModel<CloudType>::itEscape:
{
keepParticle = false;
active = false;
p.active(false);
U = Zero;
nEscape_++;
massEscape_ += p.nParticle()*p.mass();
@ -130,7 +128,7 @@ bool Foam::StandardWallInteraction<CloudType>::correct
case PatchInteractionModel<CloudType>::itStick:
{
keepParticle = true;
active = false;
p.active(false);
U = Zero;
nStick_++;
massStick_ += p.nParticle()*p.mass();
@ -139,7 +137,7 @@ bool Foam::StandardWallInteraction<CloudType>::correct
case PatchInteractionModel<CloudType>::itRebound:
{
keepParticle = true;
active = true;
p.active(true);
vector nw;
vector Up;

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -58,17 +58,15 @@ class molecule
:
public particle
{
// Private data
//- Size in bytes of the fields
static const std::size_t sizeofFields_;
public:
//- Size in bytes of the fields
static const std::size_t sizeofFields;
// Values of special that are less than zero are for built-in functionality.
// Values greater than zero are user specifiable/expandable (i.e. test
// special_ >= SPECIAL_USER)
// Values greater than zero are user specifiable/expandable
// (i.e. test special_ >= SPECIAL_USER)
enum specialTypes
{
@ -78,6 +76,7 @@ public:
SPECIAL_USER = 1
};
//- Class to hold molecule constant properties
class constantProperties
{

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -29,7 +29,7 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
const std::size_t Foam::molecule::sizeofFields_
const std::size_t Foam::molecule::sizeofFields
(
offsetof(molecule, siteForces_) - offsetof(molecule, Q_)
);
@ -77,7 +77,7 @@ Foam::molecule::molecule
}
else
{
is.read(reinterpret_cast<char*>(&Q_), sizeofFields_);
is.read(reinterpret_cast<char*>(&Q_), sizeofFields);
is >> siteForces_ >> sitePositions_;
}
}
@ -276,7 +276,7 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const molecule& mol)
os.write
(
reinterpret_cast<const char*>(&mol.Q_),
molecule::sizeofFields_
molecule::sizeofFields
);
os << mol.siteForces_ << mol.sitePositions_;
}

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -61,9 +61,6 @@ class solidParticle
{
// Private data
//- Size in bytes of the fields
static const std::size_t sizeofFields_;
//- Diameter
scalar d_;
@ -116,6 +113,12 @@ public:
};
// Static data members
//- Size in bytes of the fields
static const std::size_t sizeofFields;
// Constructors
//- Construct from components

View File

@ -28,7 +28,7 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
const std::size_t Foam::solidParticle::sizeofFields_
const std::size_t Foam::solidParticle::sizeofFields
(
sizeof(solidParticle) - sizeof(particle)
);
@ -54,7 +54,7 @@ Foam::solidParticle::solidParticle
}
else
{
is.read(reinterpret_cast<char*>(&d_), sizeofFields_);
is.read(reinterpret_cast<char*>(&d_), sizeofFields);
}
}
@ -130,7 +130,7 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const solidParticle& p)
os.write
(
reinterpret_cast<const char*>(&p.d_),
solidParticle::sizeofFields_
solidParticle::sizeofFields
);
}

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -25,7 +25,7 @@ Class
Foam::SprayParcel
Description
Reacing spray parcel, with added functionality for atomization and breakup
Reacting spray parcel, with added functionality for atomization and breakup
\*---------------------------------------------------------------------------*/
@ -59,12 +59,6 @@ class SprayParcel
:
public ParcelType
{
// Private data
//- Size in bytes of the fields
static const std::size_t sizeofFields_;
public:
//- Class to hold reacting particle constant properties
@ -178,6 +172,9 @@ public:
// Static data members
//- Size in bytes of the fields
static const std::size_t sizeofFields;
//- Runtime type information
TypeName("SprayParcel");
@ -185,7 +182,7 @@ public:
AddToPropertyList
(
ParcelType,
+ " d0"
" d0"
+ " position0"
+ " sigma"
+ " mu"
@ -200,6 +197,25 @@ public:
+ " user"
);
//- String representation of property types
AddToPropertyTypes
(
ParcelType,
" scalar"
+ " vector"
+ " scalar"
+ " scalar"
+ " scalar"
+ " scalar"
+ " scalar"
+ " scalar"
+ " scalar"
+ " scalar"
+ " scalar"
+ " scalar"
+ " scalar"
);
// Constructors

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -32,9 +32,13 @@ template<class ParcelType>
Foam::string Foam::SprayParcel<ParcelType>::propertyList_ =
Foam::SprayParcel<ParcelType>::propertyList();
template<class ParcelType>
Foam::string Foam::SprayParcel<ParcelType>::propertyTypes_ =
Foam::SprayParcel<ParcelType>::propertyTypes();
template<class ParcelType>
const std::size_t Foam::SprayParcel<ParcelType>::sizeofFields_
const std::size_t Foam::SprayParcel<ParcelType>::sizeofFields
(
sizeof(SprayParcel<ParcelType>) - sizeof(ParcelType)
);
@ -85,7 +89,7 @@ Foam::SprayParcel<ParcelType>::SprayParcel
}
else
{
is.read(reinterpret_cast<char*>(&d0_), sizeofFields_);
is.read(reinterpret_cast<char*>(&d0_), sizeofFields);
}
}
@ -311,7 +315,7 @@ Foam::Ostream& Foam::operator<<
os.write
(
reinterpret_cast<const char*>(&p.d0_),
SprayParcel<ParcelType>::sizeofFields_
SprayParcel<ParcelType>::sizeofFields
);
}