Commit 750cf2f5 authored by mattijs's avatar mattijs
Browse files

Merge branch 'master' of /home/noisy3/OpenFOAM/OpenFOAM-dev

parents c9d62120 d404293a
......@@ -74,7 +74,7 @@ Foam::KinematicCloud<ParcelType>::cloudSolution::cloudSolution
coupled_(false),
cellValueSourceCorrection_(false),
maxTrackTime_(0.0),
resetSourcesOnStartup_(false)
resetSourcesOnStartup_(true)
{
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_.subOrEmptyDict("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);
......
......@@ -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
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 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)
{
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -128,6 +128,12 @@ protected:
);
// Initialisation
//- Set cloud sub-models
void setModels();
// Cloud evolution functions
//- Reset state of cloud
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -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);
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 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
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 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.particleProperties_),
constProps_(c.constProps_),
thermo_(c.thermo_),
T_(c.T()),
p_(c.p()),
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 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
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 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
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 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")),