mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG/ENH: Added use of engine time to cloud injection models - mantis #407
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -139,17 +139,28 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return Table value
|
||||
virtual Type value(const scalar x) const
|
||||
{
|
||||
return TableBase<Type>::value(x);
|
||||
}
|
||||
// Manipulation
|
||||
|
||||
//- Integrate between two (scalar) values
|
||||
virtual Type integrate(const scalar x1, const scalar x2) const
|
||||
{
|
||||
return TableBase<Type>::integrate(x1, x2);
|
||||
}
|
||||
//- Convert time
|
||||
virtual void convertTimeBase(const Time& t)
|
||||
{
|
||||
TableBase<Type>::convertTimeBase(t);
|
||||
}
|
||||
|
||||
|
||||
// Evaluation
|
||||
|
||||
//- Return Table value
|
||||
virtual Type value(const scalar x) const
|
||||
{
|
||||
return TableBase<Type>::value(x);
|
||||
}
|
||||
|
||||
//- Integrate between two (scalar) values
|
||||
virtual Type integrate(const scalar x1, const scalar x2) const
|
||||
{
|
||||
return TableBase<Type>::integrate(x1, x2);
|
||||
}
|
||||
|
||||
|
||||
// I/O
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -24,6 +24,7 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "DataEntry.H"
|
||||
#include "Time.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructor * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -59,6 +60,13 @@ const Foam::word& Foam::DataEntry<Type>::name() const
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::DataEntry<Type>::convertTimeBase(const Time&)
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Type Foam::DataEntry<Type>::value(const scalar x) const
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -45,6 +45,7 @@ SourceFiles
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
class Time;
|
||||
|
||||
template<class Type>
|
||||
class DataEntry;
|
||||
@ -133,6 +134,12 @@ public:
|
||||
const word& name() const;
|
||||
|
||||
|
||||
// Manipulation
|
||||
|
||||
//- Convert time
|
||||
virtual void convertTimeBase(const Time& t);
|
||||
|
||||
|
||||
// Evaluation
|
||||
|
||||
//- Return value as a function of (scalar) independent variable
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -106,17 +106,28 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return Table value
|
||||
virtual Type value(const scalar x) const
|
||||
{
|
||||
return TableBase<Type>::value(x);
|
||||
}
|
||||
// Manipulation
|
||||
|
||||
//- Integrate between two (scalar) values
|
||||
virtual Type integrate(const scalar x1, const scalar x2) const
|
||||
{
|
||||
return TableBase<Type>::integrate(x1, x2);
|
||||
}
|
||||
//- Convert time
|
||||
virtual void convertTimeBase(const Time& t)
|
||||
{
|
||||
TableBase<Type>::convertTimeBase(t);
|
||||
}
|
||||
|
||||
|
||||
// Evaluation
|
||||
|
||||
//- Return Table value
|
||||
virtual Type value(const scalar x) const
|
||||
{
|
||||
return TableBase<Type>::value(x);
|
||||
}
|
||||
|
||||
//- Integrate between two (scalar) values
|
||||
virtual Type integrate(const scalar x1, const scalar x2) const
|
||||
{
|
||||
return TableBase<Type>::integrate(x1, x2);
|
||||
}
|
||||
|
||||
|
||||
// I/O
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -24,6 +24,7 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "TableBase.H"
|
||||
#include "Time.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
@ -296,6 +297,17 @@ bool Foam::TableBase<Type>::checkMaxBounds
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::TableBase<Type>::convertTimeBase(const Time& t)
|
||||
{
|
||||
forAll(table_, i)
|
||||
{
|
||||
scalar value = table_[i].first();
|
||||
table_[i].first() = t.userTimeToTime(value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Type Foam::TableBase<Type>::value(const scalar x) const
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -129,6 +129,9 @@ public:
|
||||
//- Check maximum table bounds
|
||||
bool checkMaxBounds(const scalar x, scalar& xDash) const;
|
||||
|
||||
//- Convert time
|
||||
virtual void convertTimeBase(const Time& t);
|
||||
|
||||
//- Return Table value
|
||||
virtual Type value(const scalar x) const;
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -122,17 +122,28 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return TableFile value
|
||||
virtual Type value(const scalar x) const
|
||||
{
|
||||
return TableBase<Type>::value(x);
|
||||
}
|
||||
// Manipulation
|
||||
|
||||
//- Integrate between two (scalar) values
|
||||
virtual Type integrate(const scalar x1, const scalar x2) const
|
||||
{
|
||||
return TableBase<Type>::integrate(x1, x2);
|
||||
}
|
||||
//- Convert time
|
||||
virtual void convertTimeBase(const Time& t)
|
||||
{
|
||||
TableBase<Type>::convertTimeBase(t);
|
||||
}
|
||||
|
||||
|
||||
// Evaluation
|
||||
|
||||
//- Return TableFile value
|
||||
virtual Type value(const scalar x) const
|
||||
{
|
||||
return TableBase<Type>::value(x);
|
||||
}
|
||||
|
||||
//- Integrate between two (scalar) values
|
||||
virtual Type integrate(const scalar x1, const scalar x2) const
|
||||
{
|
||||
return TableBase<Type>::integrate(x1, x2);
|
||||
}
|
||||
|
||||
|
||||
// I/O
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -24,6 +24,7 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "polynomial.H"
|
||||
#include "Time.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -89,6 +90,16 @@ Foam::polynomial::~polynomial()
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::polynomial::convertTimeBase(const Time& t)
|
||||
{
|
||||
forAll(coeffs_, i)
|
||||
{
|
||||
scalar value = coeffs_[i].first();
|
||||
coeffs_[i].first() = t.userTimeToTime(value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::scalar Foam::polynomial::value(const scalar x) const
|
||||
{
|
||||
scalar y = 0.0;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -112,11 +112,19 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return polynomial value
|
||||
scalar value(const scalar x) const;
|
||||
// Manipulation
|
||||
|
||||
//- Integrate between two (scalar) values
|
||||
scalar integrate(const scalar x1, const scalar x2) const;
|
||||
//- Convert time
|
||||
virtual void convertTimeBase(const Time& t);
|
||||
|
||||
|
||||
// Evaluation
|
||||
|
||||
//- Return polynomial value
|
||||
scalar value(const scalar x) const;
|
||||
|
||||
//- Integrate between two (scalar) values
|
||||
scalar integrate(const scalar x1, const scalar x2) const;
|
||||
|
||||
|
||||
// I/O
|
||||
|
||||
@ -0,0 +1,137 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "TimeDataEntry.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructor * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::TimeDataEntry<Type>::TimeDataEntry
|
||||
(
|
||||
const Time& t,
|
||||
const word& name,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
time_(t),
|
||||
name_(name),
|
||||
entry_(DataEntry<Type>::New(name, dict))
|
||||
{
|
||||
entry_->convertTimeBase(t);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::TimeDataEntry<Type>::TimeDataEntry(const Time& t, const word& name)
|
||||
:
|
||||
time_(t),
|
||||
name_(name),
|
||||
entry_(NULL)
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::TimeDataEntry<Type>::TimeDataEntry
|
||||
(
|
||||
const TimeDataEntry<Type>& tde
|
||||
)
|
||||
:
|
||||
time_(tde.time_),
|
||||
name_(tde.name_),
|
||||
entry_(tde.entry_->clone().ptr())
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::TimeDataEntry<Type>::~TimeDataEntry()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
void Foam::TimeDataEntry<Type>::reset(const dictionary& dict)
|
||||
{
|
||||
entry_.reset
|
||||
(
|
||||
DataEntry<Type>::New
|
||||
(
|
||||
name_,
|
||||
dict
|
||||
).ptr()
|
||||
);
|
||||
|
||||
entry_->convertTimeBase(time_);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
const Foam::word& Foam::TimeDataEntry<Type>::name() const
|
||||
{
|
||||
return entry_->name();
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Type Foam::TimeDataEntry<Type>::value(const scalar x) const
|
||||
{
|
||||
return entry_->value(x);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Type Foam::TimeDataEntry<Type>::integrate
|
||||
(
|
||||
const scalar x1,
|
||||
const scalar x2
|
||||
) const
|
||||
{
|
||||
return entry_->integrate(x1, x2);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::Ostream& Foam::operator<<
|
||||
(
|
||||
Ostream& os,
|
||||
const TimeDataEntry<Type>& de
|
||||
)
|
||||
{
|
||||
return de.entry_->operator<<(os, de);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::TimeDataEntry<Type>::writeData(Ostream& os) const
|
||||
{
|
||||
entry_->writeData(os);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,153 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::TimeDataEntry
|
||||
|
||||
Description
|
||||
Light wrapper around DataEntry to provide a mechanism to update time-based
|
||||
entries.
|
||||
|
||||
SourceFiles
|
||||
TimeDataEntry.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef TimeDataEntry_H
|
||||
#define TimeDataEntry_H
|
||||
|
||||
#include "DataEntry.H"
|
||||
#include "Time.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
template<class Type>
|
||||
class TimeDataEntry;
|
||||
|
||||
template<class Type>
|
||||
Ostream& operator<<
|
||||
(
|
||||
Ostream&,
|
||||
const TimeDataEntry<Type>&
|
||||
);
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class TimeDataEntry Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class Type>
|
||||
class TimeDataEntry
|
||||
{
|
||||
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Reference to the time database
|
||||
const Time& time_;
|
||||
|
||||
//- Name of the data entry
|
||||
const word name_;
|
||||
|
||||
//- The underlying DataEntry
|
||||
autoPtr<DataEntry<Type> > entry_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructor
|
||||
|
||||
//- Construct from entry name
|
||||
TimeDataEntry
|
||||
(
|
||||
const Time& t,
|
||||
const word& name,
|
||||
const dictionary& dict
|
||||
);
|
||||
|
||||
//- Construct null from entry name
|
||||
TimeDataEntry
|
||||
(
|
||||
const Time& t,
|
||||
const word& entryName
|
||||
);
|
||||
|
||||
//- Copy constructor
|
||||
TimeDataEntry(const TimeDataEntry<Type>& tde);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~TimeDataEntry();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access
|
||||
|
||||
//- Reset entry by re-reading from dictionary
|
||||
void reset(const dictionary& dict);
|
||||
|
||||
//- Return the name of the entry
|
||||
const word& name() const;
|
||||
|
||||
|
||||
// Evaluation
|
||||
|
||||
//- Return value as a function of (scalar) independent variable
|
||||
virtual Type value(const scalar x) const;
|
||||
|
||||
//- Integrate between two (scalar) values
|
||||
virtual Type integrate(const scalar x1, const scalar x2) const;
|
||||
|
||||
|
||||
// I/O
|
||||
|
||||
//- Ostream Operator
|
||||
friend Ostream& operator<< <Type>
|
||||
(
|
||||
Ostream& os,
|
||||
const TimeDataEntry<Type>& de
|
||||
);
|
||||
|
||||
//- Write in dictionary format
|
||||
virtual void writeData(Ostream& os) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "TimeDataEntry.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -24,7 +24,7 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "ConeInjection.H"
|
||||
#include "DataEntry.H"
|
||||
#include "TimeDataEntry.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "unitConversion.H"
|
||||
|
||||
@ -51,11 +51,40 @@ Foam::ConeInjection<CloudType>::ConeInjection
|
||||
),
|
||||
flowRateProfile_
|
||||
(
|
||||
DataEntry<scalar>::New("flowRateProfile", this->coeffDict())
|
||||
TimeDataEntry<scalar>
|
||||
(
|
||||
owner.db().time(),
|
||||
"flowRateProfile",
|
||||
this->coeffDict()
|
||||
)
|
||||
),
|
||||
Umag_
|
||||
(
|
||||
TimeDataEntry<scalar>
|
||||
(
|
||||
owner.db().time(),
|
||||
"Umag",
|
||||
this->coeffDict()
|
||||
)
|
||||
),
|
||||
thetaInner_
|
||||
(
|
||||
TimeDataEntry<scalar>
|
||||
(
|
||||
owner.db().time(),
|
||||
"thetaInner",
|
||||
this->coeffDict()
|
||||
)
|
||||
),
|
||||
thetaOuter_
|
||||
(
|
||||
TimeDataEntry<scalar>
|
||||
(
|
||||
owner.db().time(),
|
||||
"thetaOuter",
|
||||
this->coeffDict()
|
||||
)
|
||||
),
|
||||
Umag_(DataEntry<scalar>::New("Umag", this->coeffDict())),
|
||||
thetaInner_(DataEntry<scalar>::New("thetaInner", this->coeffDict())),
|
||||
thetaOuter_(DataEntry<scalar>::New("thetaOuter", this->coeffDict())),
|
||||
sizeDistribution_
|
||||
(
|
||||
distributionModels::distributionModel::New
|
||||
@ -67,6 +96,8 @@ Foam::ConeInjection<CloudType>::ConeInjection
|
||||
tanVec1_(positionAxis_.size()),
|
||||
tanVec2_(positionAxis_.size())
|
||||
{
|
||||
duration_ = owner.db().time().userTimeToTime(duration_);
|
||||
|
||||
// Normalise direction vector and determine direction vectors
|
||||
// tangential to injector axis direction
|
||||
forAll(positionAxis_, i)
|
||||
@ -92,7 +123,7 @@ Foam::ConeInjection<CloudType>::ConeInjection
|
||||
}
|
||||
|
||||
// Set total volume to inject
|
||||
this->volumeTotal_ = flowRateProfile_().integrate(0.0, duration_);
|
||||
this->volumeTotal_ = flowRateProfile_.integrate(0.0, duration_);
|
||||
|
||||
// Set/cache the injector cells
|
||||
forAll(positionAxis_, i)
|
||||
@ -121,10 +152,10 @@ Foam::ConeInjection<CloudType>::ConeInjection
|
||||
injectorTetPts_(im.injectorTetPts_),
|
||||
duration_(im.duration_),
|
||||
parcelsPerInjector_(im.parcelsPerInjector_),
|
||||
flowRateProfile_(im.flowRateProfile_().clone().ptr()),
|
||||
Umag_(im.Umag_().clone().ptr()),
|
||||
thetaInner_(im.thetaInner_().clone().ptr()),
|
||||
thetaOuter_(im.thetaOuter_().clone().ptr()),
|
||||
flowRateProfile_(im.flowRateProfile_),
|
||||
Umag_(im.Umag_),
|
||||
thetaInner_(im.thetaInner_),
|
||||
thetaOuter_(im.thetaOuter_),
|
||||
sizeDistribution_(im.sizeDistribution_().clone().ptr()),
|
||||
nInjected_(im.nInjected_),
|
||||
tanVec1_(im.tanVec1_),
|
||||
@ -157,7 +188,7 @@ Foam::label Foam::ConeInjection<CloudType>::parcelsToInject
|
||||
{
|
||||
if ((time0 >= 0.0) && (time0 < duration_))
|
||||
{
|
||||
const scalar targetVolume = flowRateProfile_().integrate(0, time1);
|
||||
const scalar targetVolume = flowRateProfile_.integrate(0, time1);
|
||||
|
||||
const label targetParcels =
|
||||
parcelsPerInjector_*targetVolume/this->volumeTotal_;
|
||||
@ -184,7 +215,7 @@ Foam::scalar Foam::ConeInjection<CloudType>::volumeToInject
|
||||
{
|
||||
if ((time0 >= 0.0) && (time0 < duration_))
|
||||
{
|
||||
return flowRateProfile_().integrate(time0, time1);
|
||||
return flowRateProfile_.integrate(time0, time1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -229,8 +260,8 @@ void Foam::ConeInjection<CloudType>::setProperties
|
||||
const label i = parcelI % positionAxis_.size();
|
||||
|
||||
scalar t = time - this->SOI_;
|
||||
scalar ti = thetaInner_().value(t);
|
||||
scalar to = thetaOuter_().value(t);
|
||||
scalar ti = thetaInner_.value(t);
|
||||
scalar to = thetaOuter_.value(t);
|
||||
scalar coneAngle = degToRad(rnd.position<scalar>(ti, to));
|
||||
|
||||
scalar alpha = sin(coneAngle);
|
||||
@ -242,7 +273,7 @@ void Foam::ConeInjection<CloudType>::setProperties
|
||||
dirVec += normal;
|
||||
dirVec /= mag(dirVec);
|
||||
|
||||
parcel.U() = Umag_().value(t)*dirVec;
|
||||
parcel.U() = Umag_.value(t)*dirVec;
|
||||
|
||||
// set particle diameter
|
||||
parcel.d() = sizeDistribution_().sample();
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -45,17 +45,13 @@ SourceFiles
|
||||
#include "InjectionModel.H"
|
||||
#include "distributionModel.H"
|
||||
#include "vectorList.H"
|
||||
#include "TimeDataEntry.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward declaration of classes
|
||||
|
||||
template<class Type>
|
||||
class DataEntry;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class ConeInjection Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
@ -80,22 +76,22 @@ class ConeInjection
|
||||
labelList injectorTetPts_;
|
||||
|
||||
//- Injection duration [s]
|
||||
const scalar duration_;
|
||||
scalar duration_;
|
||||
|
||||
//- Number of parcels to introduce per injector
|
||||
const label parcelsPerInjector_;
|
||||
|
||||
//- Flow rate profile relative to SOI []
|
||||
const autoPtr<DataEntry<scalar> > flowRateProfile_;
|
||||
const TimeDataEntry<scalar> flowRateProfile_;
|
||||
|
||||
//- Parcel velocity magnitude relative to SOI [m/s]
|
||||
const autoPtr<DataEntry<scalar> > Umag_;
|
||||
const TimeDataEntry<scalar> Umag_;
|
||||
|
||||
//- Inner cone angle relative to SOI [deg]
|
||||
const autoPtr<DataEntry<scalar> > thetaInner_;
|
||||
const TimeDataEntry<scalar> thetaInner_;
|
||||
|
||||
//- Outer cone angle relative to SOI [deg]
|
||||
const autoPtr<DataEntry<scalar> > thetaOuter_;
|
||||
const TimeDataEntry<scalar> thetaOuter_;
|
||||
|
||||
//- Parcel size distribution model
|
||||
const autoPtr<distributionModels::distributionModel> sizeDistribution_;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -24,7 +24,7 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "ConeNozzleInjection.H"
|
||||
#include "DataEntry.H"
|
||||
#include "TimeDataEntry.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "distributionModel.H"
|
||||
|
||||
@ -74,26 +74,12 @@ void Foam::ConeNozzleInjection<CloudType>::setFlowType()
|
||||
}
|
||||
else if (flowType == "pressureDrivenVelocity")
|
||||
{
|
||||
Pinj_.reset
|
||||
(
|
||||
DataEntry<scalar>::New
|
||||
(
|
||||
"Pinj",
|
||||
this->coeffDict()
|
||||
).ptr()
|
||||
);
|
||||
Pinj_.reset(this->coeffDict());
|
||||
flowType_ = ftPressureDrivenVelocity;
|
||||
}
|
||||
else if (flowType == "flowRateAndDischarge")
|
||||
{
|
||||
Cd_.reset
|
||||
(
|
||||
DataEntry<scalar>::New
|
||||
(
|
||||
"Cd",
|
||||
this->coeffDict()
|
||||
).ptr()
|
||||
);
|
||||
Cd_.reset(this->coeffDict());
|
||||
flowType_ = ftFlowRateAndDischarge;
|
||||
}
|
||||
else
|
||||
@ -132,24 +118,27 @@ Foam::ConeNozzleInjection<CloudType>::ConeNozzleInjection
|
||||
),
|
||||
flowRateProfile_
|
||||
(
|
||||
DataEntry<scalar>::New
|
||||
TimeDataEntry<scalar>
|
||||
(
|
||||
owner.db().time(),
|
||||
"flowRateProfile",
|
||||
this->coeffDict()
|
||||
)
|
||||
),
|
||||
thetaInner_
|
||||
(
|
||||
DataEntry<scalar>::New
|
||||
TimeDataEntry<scalar>
|
||||
(
|
||||
owner.db().time(),
|
||||
"thetaInner",
|
||||
this->coeffDict()
|
||||
)
|
||||
),
|
||||
thetaOuter_
|
||||
(
|
||||
DataEntry<scalar>::New
|
||||
TimeDataEntry<scalar>
|
||||
(
|
||||
owner.db().time(),
|
||||
"thetaOuter",
|
||||
this->coeffDict()
|
||||
)
|
||||
@ -167,8 +156,8 @@ Foam::ConeNozzleInjection<CloudType>::ConeNozzleInjection
|
||||
normal_(vector::zero),
|
||||
|
||||
UMag_(0.0),
|
||||
Cd_(NULL),
|
||||
Pinj_(NULL)
|
||||
Cd_(owner.db().time(), "Cd"),
|
||||
Pinj_(owner.db().time(), "Pinj")
|
||||
{
|
||||
if (innerDiameter_ >= outerDiameter_)
|
||||
{
|
||||
@ -183,6 +172,8 @@ Foam::ConeNozzleInjection<CloudType>::ConeNozzleInjection
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
duration_ = owner.db().time().userTimeToTime(duration_);
|
||||
|
||||
setInjectionMethod();
|
||||
|
||||
setFlowType();
|
||||
@ -208,7 +199,7 @@ Foam::ConeNozzleInjection<CloudType>::ConeNozzleInjection
|
||||
tanVec2_ = direction_^tanVec1_;
|
||||
|
||||
// Set total volume to inject
|
||||
this->volumeTotal_ = flowRateProfile_().integrate(0.0, duration_);
|
||||
this->volumeTotal_ = flowRateProfile_.integrate(0.0, duration_);
|
||||
}
|
||||
|
||||
|
||||
@ -230,26 +221,17 @@ Foam::ConeNozzleInjection<CloudType>::ConeNozzleInjection
|
||||
tetPtI_(im.tetPtI_),
|
||||
direction_(im.direction_),
|
||||
parcelsPerSecond_(im.parcelsPerSecond_),
|
||||
flowRateProfile_(im.flowRateProfile_().clone().ptr()),
|
||||
thetaInner_(im.thetaInner_().clone().ptr()),
|
||||
thetaOuter_(im.thetaOuter_().clone().ptr()),
|
||||
flowRateProfile_(im.flowRateProfile_),
|
||||
thetaInner_(im.thetaInner_),
|
||||
thetaOuter_(im.thetaOuter_),
|
||||
sizeDistribution_(im.sizeDistribution_().clone().ptr()),
|
||||
tanVec1_(im.tanVec1_),
|
||||
tanVec2_(im.tanVec1_),
|
||||
normal_(im.normal_),
|
||||
UMag_(im.UMag_),
|
||||
Cd_(NULL),
|
||||
Pinj_(NULL)
|
||||
{
|
||||
if (im.Cd_.valid())
|
||||
{
|
||||
Cd_.reset(im.Cd_().clone().ptr());
|
||||
}
|
||||
if (im.Pinj_.valid())
|
||||
{
|
||||
Pinj_.reset(im.Pinj_().clone().ptr());
|
||||
}
|
||||
}
|
||||
Cd_(im.Cd_),
|
||||
Pinj_(im.Pinj_)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
@ -295,7 +277,7 @@ Foam::scalar Foam::ConeNozzleInjection<CloudType>::volumeToInject
|
||||
{
|
||||
if ((time0 >= 0.0) && (time0 < duration_))
|
||||
{
|
||||
return flowRateProfile_().integrate(time0, time1);
|
||||
return flowRateProfile_.integrate(time0, time1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -383,8 +365,8 @@ void Foam::ConeNozzleInjection<CloudType>::setProperties
|
||||
const scalar deg2Rad = mathematical::pi/180.0;
|
||||
|
||||
scalar t = time - this->SOI_;
|
||||
scalar ti = thetaInner_().value(t);
|
||||
scalar to = thetaOuter_().value(t);
|
||||
scalar ti = thetaInner_.value(t);
|
||||
scalar to = thetaOuter_.value(t);
|
||||
scalar coneAngle = rndGen.sample01<scalar>()*(to - ti) + ti;
|
||||
|
||||
coneAngle *= deg2Rad;
|
||||
@ -407,7 +389,7 @@ void Foam::ConeNozzleInjection<CloudType>::setProperties
|
||||
{
|
||||
scalar pAmbient = this->owner().pAmbient();
|
||||
scalar rho = parcel.rho();
|
||||
scalar UMag = ::sqrt(2.0*(Pinj_().value(t) - pAmbient)/rho);
|
||||
scalar UMag = ::sqrt(2.0*(Pinj_.value(t) - pAmbient)/rho);
|
||||
parcel.U() = UMag*dirVec;
|
||||
break;
|
||||
}
|
||||
@ -417,10 +399,10 @@ void Foam::ConeNozzleInjection<CloudType>::setProperties
|
||||
scalar Ai = 0.25*mathematical::pi*innerDiameter_*innerDiameter_;
|
||||
scalar massFlowRate =
|
||||
this->massTotal()
|
||||
*flowRateProfile_().value(t)
|
||||
*flowRateProfile_.value(t)
|
||||
/this->volumeTotal();
|
||||
|
||||
scalar Umag = massFlowRate/(parcel.rho()*Cd_().value(t)*(Ao - Ai));
|
||||
scalar Umag = massFlowRate/(parcel.rho()*Cd_.value(t)*(Ao - Ai));
|
||||
parcel.U() = Umag*dirVec;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -63,7 +63,7 @@ namespace Foam
|
||||
// Forward declaration of classes
|
||||
|
||||
template<class Type>
|
||||
class DataEntry;
|
||||
class TimeDataEntry;
|
||||
|
||||
class distributionModel;
|
||||
|
||||
@ -111,7 +111,7 @@ private:
|
||||
const scalar innerDiameter_;
|
||||
|
||||
//- Injection duration [s]
|
||||
const scalar duration_;
|
||||
scalar duration_;
|
||||
|
||||
//- Injector position [m]
|
||||
vector position_;
|
||||
@ -132,13 +132,13 @@ private:
|
||||
const label parcelsPerSecond_;
|
||||
|
||||
//- Flow rate profile relative to SOI []
|
||||
const autoPtr<DataEntry<scalar> > flowRateProfile_;
|
||||
const TimeDataEntry<scalar> flowRateProfile_;
|
||||
|
||||
//- Inner cone angle relative to SOI [deg]
|
||||
const autoPtr<DataEntry<scalar> > thetaInner_;
|
||||
const TimeDataEntry<scalar> thetaInner_;
|
||||
|
||||
//- Outer cone angle relative to SOI [deg]
|
||||
const autoPtr<DataEntry<scalar> > thetaOuter_;
|
||||
const TimeDataEntry<scalar> thetaOuter_;
|
||||
|
||||
//- Parcel size PDF model
|
||||
const autoPtr<distributionModels::distributionModel> sizeDistribution_;
|
||||
@ -162,10 +162,10 @@ private:
|
||||
scalar UMag_;
|
||||
|
||||
//- Discharge coefficient, relative to SOI [m/s]
|
||||
autoPtr<DataEntry<scalar> > Cd_;
|
||||
TimeDataEntry<scalar> Cd_;
|
||||
|
||||
//- Injection pressure [Pa]
|
||||
autoPtr<DataEntry<scalar> > Pinj_;
|
||||
TimeDataEntry<scalar> Pinj_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -48,16 +48,18 @@ Foam::InflationInjection<CloudType>::InflationInjection
|
||||
duration_(readScalar(this->coeffDict().lookup("duration"))),
|
||||
flowRateProfile_
|
||||
(
|
||||
DataEntry<scalar>::New
|
||||
TimeDataEntry<scalar>
|
||||
(
|
||||
owner.db().time(),
|
||||
"flowRateProfile",
|
||||
this->coeffDict()
|
||||
)
|
||||
),
|
||||
growthRate_
|
||||
(
|
||||
DataEntry<scalar>::New
|
||||
TimeDataEntry<scalar>
|
||||
(
|
||||
owner.db().time(),
|
||||
"growthRate",
|
||||
this->coeffDict()
|
||||
)
|
||||
@ -76,6 +78,8 @@ Foam::InflationInjection<CloudType>::InflationInjection
|
||||
)
|
||||
)
|
||||
{
|
||||
duration_ = owner.db().time().userTimeToTime(duration_);
|
||||
|
||||
if (selfSeed_)
|
||||
{
|
||||
dSeed_ = readScalar(this->coeffDict().lookup("dSeed"));
|
||||
@ -111,7 +115,7 @@ Foam::InflationInjection<CloudType>::InflationInjection
|
||||
}
|
||||
|
||||
// Set total volume/mass to inject
|
||||
this->volumeTotal_ = fraction_*flowRateProfile_().integrate(0.0, duration_);
|
||||
this->volumeTotal_ = fraction_*flowRateProfile_.integrate(0.0, duration_);
|
||||
this->massTotal_ *= fraction_;
|
||||
}
|
||||
|
||||
@ -128,8 +132,8 @@ Foam::InflationInjection<CloudType>::InflationInjection
|
||||
generationCells_(im.generationCells_),
|
||||
inflationCells_(im.inflationCells_),
|
||||
duration_(im.duration_),
|
||||
flowRateProfile_(im.flowRateProfile_().clone().ptr()),
|
||||
growthRate_(im.growthRate_().clone().ptr()),
|
||||
flowRateProfile_(im.flowRateProfile_),
|
||||
growthRate_(im.growthRate_),
|
||||
newParticles_(im.newParticles_),
|
||||
volumeAccumulator_(im.volumeAccumulator_),
|
||||
fraction_(im.fraction_),
|
||||
@ -167,7 +171,7 @@ Foam::label Foam::InflationInjection<CloudType>::parcelsToInject
|
||||
List<DynamicList<typename CloudType::parcelType*> >& cellOccupancy =
|
||||
this->owner().cellOccupancy();
|
||||
|
||||
scalar gR = growthRate_().value(time1);
|
||||
scalar gR = growthRate_.value(time1);
|
||||
|
||||
scalar dT = time1 - time0;
|
||||
|
||||
@ -202,7 +206,7 @@ Foam::label Foam::InflationInjection<CloudType>::parcelsToInject
|
||||
if ((time0 >= 0.0) && (time0 < duration_))
|
||||
{
|
||||
volumeAccumulator_ +=
|
||||
fraction_*flowRateProfile_().integrate(time0, time1);
|
||||
fraction_*flowRateProfile_.integrate(time0, time1);
|
||||
}
|
||||
|
||||
labelHashSet cellCentresUsed;
|
||||
@ -424,7 +428,7 @@ Foam::scalar Foam::InflationInjection<CloudType>::volumeToInject
|
||||
{
|
||||
if ((time0 >= 0.0) && (time0 < duration_))
|
||||
{
|
||||
return fraction_*flowRateProfile_().integrate(time0, time1);
|
||||
return fraction_*flowRateProfile_.integrate(time0, time1);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -81,13 +81,13 @@ class InflationInjection
|
||||
labelList inflationCells_;
|
||||
|
||||
//- Injection duration [s]
|
||||
const scalar duration_;
|
||||
scalar duration_;
|
||||
|
||||
//- Flow rate profile relative to SOI [m3/s]
|
||||
const autoPtr<DataEntry<scalar> > flowRateProfile_;
|
||||
TimeDataEntry<scalar> flowRateProfile_;
|
||||
|
||||
//- Growth rate of particle diameters towards target [m/s]
|
||||
const autoPtr<DataEntry<scalar> > growthRate_;
|
||||
TimeDataEntry<scalar> growthRate_;
|
||||
|
||||
//- Positions, velocities, diameters and target diameters of
|
||||
// new particles after splitting
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -316,6 +316,7 @@ Foam::InjectionModel<CloudType>::InjectionModel
|
||||
{
|
||||
this->coeffDict().lookup("massTotal") >> massTotal_;
|
||||
this->coeffDict().lookup("SOI") >> SOI_;
|
||||
SOI_ = owner.db().time().userTimeToTime(SOI_);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -57,6 +57,8 @@ Foam::KinematicLookupTableInjection<CloudType>::KinematicLookupTableInjection
|
||||
injectorTetFaces_(0),
|
||||
injectorTetPts_(0)
|
||||
{
|
||||
duration_ = owner.db().time().userTimeToTime(duration_);
|
||||
|
||||
// Set/cache the injector cells
|
||||
injectorCells_.setSize(injectors_.size());
|
||||
injectorTetFaces_.setSize(injectors_.size());
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -73,7 +73,7 @@ class KinematicLookupTableInjection
|
||||
const word inputFileName_;
|
||||
|
||||
//- Injection duration - common to all injection sources
|
||||
const scalar duration_;
|
||||
scalar duration_;
|
||||
|
||||
//- Number of parcels per injector - common to all injection sources
|
||||
const scalar parcelsPerSecond_;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -24,7 +24,7 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "PatchInjection.H"
|
||||
#include "DataEntry.H"
|
||||
#include "TimeDataEntry.H"
|
||||
#include "distributionModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
@ -47,7 +47,12 @@ Foam::PatchInjection<CloudType>::PatchInjection
|
||||
U0_(this->coeffDict().lookup("U0")),
|
||||
flowRateProfile_
|
||||
(
|
||||
DataEntry<scalar>::New("flowRateProfile", this->coeffDict())
|
||||
TimeDataEntry<scalar>
|
||||
(
|
||||
owner.db().time(),
|
||||
"flowRateProfile",
|
||||
this->coeffDict()
|
||||
)
|
||||
),
|
||||
sizeDistribution_
|
||||
(
|
||||
@ -76,6 +81,8 @@ Foam::PatchInjection<CloudType>::PatchInjection
|
||||
|
||||
const polyPatch& patch = owner.mesh().boundaryMesh()[patchId_];
|
||||
|
||||
duration_ = owner.db().time().userTimeToTime(duration_);
|
||||
|
||||
cellOwners_ = patch.faceCells();
|
||||
|
||||
label patchSize = cellOwners_.size();
|
||||
@ -84,7 +91,7 @@ Foam::PatchInjection<CloudType>::PatchInjection
|
||||
fraction_ = scalar(patchSize)/totalPatchSize;
|
||||
|
||||
// Set total volume/mass to inject
|
||||
this->volumeTotal_ = fraction_*flowRateProfile_().integrate(0.0, duration_);
|
||||
this->volumeTotal_ = fraction_*flowRateProfile_.integrate(0.0, duration_);
|
||||
this->massTotal_ *= fraction_;
|
||||
}
|
||||
|
||||
@ -101,7 +108,7 @@ Foam::PatchInjection<CloudType>::PatchInjection
|
||||
duration_(im.duration_),
|
||||
parcelsPerSecond_(im.parcelsPerSecond_),
|
||||
U0_(im.U0_),
|
||||
flowRateProfile_(im.flowRateProfile_().clone().ptr()),
|
||||
flowRateProfile_(im.flowRateProfile_),
|
||||
sizeDistribution_(im.sizeDistribution_().clone().ptr()),
|
||||
cellOwners_(im.cellOwners_),
|
||||
fraction_(im.fraction_)
|
||||
@ -171,7 +178,7 @@ Foam::scalar Foam::PatchInjection<CloudType>::volumeToInject
|
||||
{
|
||||
if ((time0 >= 0.0) && (time0 < duration_))
|
||||
{
|
||||
return fraction_*flowRateProfile_().integrate(time0, time1);
|
||||
return fraction_*flowRateProfile_.integrate(time0, time1);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -51,7 +51,7 @@ namespace Foam
|
||||
{
|
||||
|
||||
template<class Type>
|
||||
class DataEntry;
|
||||
class TimeDataEntry;
|
||||
|
||||
class distributionModel;
|
||||
|
||||
@ -73,7 +73,7 @@ class PatchInjection
|
||||
const label patchId_;
|
||||
|
||||
//- Injection duration [s]
|
||||
const scalar duration_;
|
||||
scalar duration_;
|
||||
|
||||
//- Number of parcels to introduce per second []
|
||||
const label parcelsPerSecond_;
|
||||
@ -82,7 +82,7 @@ class PatchInjection
|
||||
const vector U0_;
|
||||
|
||||
//- Flow rate profile relative to SOI []
|
||||
const autoPtr<DataEntry<scalar> > flowRateProfile_;
|
||||
const TimeDataEntry<scalar> flowRateProfile_;
|
||||
|
||||
//- Parcel size distribution model
|
||||
const autoPtr<distributionModels::distributionModel> sizeDistribution_;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -56,6 +56,8 @@ Foam::ReactingLookupTableInjection<CloudType>::ReactingLookupTableInjection
|
||||
injectorTetFaces_(0),
|
||||
injectorTetPts_(0)
|
||||
{
|
||||
duration_ = owner.db().time().userTimeToTime(duration_);
|
||||
|
||||
// Set/cache the injector cells
|
||||
injectorCells_.setSize(injectors_.size());
|
||||
injectorTetFaces_.setSize(injectors_.size());
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -76,7 +76,7 @@ class ReactingLookupTableInjection
|
||||
const word inputFileName_;
|
||||
|
||||
//- Injection duration - common to all injection sources
|
||||
const scalar duration_;
|
||||
scalar duration_;
|
||||
|
||||
//- Number of parcels per injector - common to all injection sources
|
||||
const scalar parcelsPerSecond_;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -57,6 +57,8 @@ ReactingMultiphaseLookupTableInjection
|
||||
injectorTetFaces_(0),
|
||||
injectorTetPts_(0)
|
||||
{
|
||||
duration_ = owner.db().time().userTimeToTime(duration_);
|
||||
|
||||
// Set/cache the injector cells
|
||||
injectorCells_.setSize(injectors_.size());
|
||||
injectorTetFaces_.setSize(injectors_.size());
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -79,7 +79,7 @@ class ReactingMultiphaseLookupTableInjection
|
||||
const word inputFileName_;
|
||||
|
||||
//- Injection duration - common to all injection sources
|
||||
const scalar duration_;
|
||||
scalar duration_;
|
||||
|
||||
//- Number of parcels per injector - common to all injection sources
|
||||
const scalar parcelsPerSecond_;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -57,6 +57,8 @@ Foam::ThermoLookupTableInjection<CloudType>::ThermoLookupTableInjection
|
||||
injectorTetFaces_(0),
|
||||
injectorTetPts_(0)
|
||||
{
|
||||
duration_ = owner.db().time().userTimeToTime(duration_);
|
||||
|
||||
// Set/cache the injector cells
|
||||
injectorCells_.setSize(injectors_.size());
|
||||
injectorTetFaces_.setSize(injectors_.size());
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -75,7 +75,7 @@ class ThermoLookupTableInjection
|
||||
const word inputFileName_;
|
||||
|
||||
//- Injection duration - common to all injection sources
|
||||
const scalar duration_;
|
||||
scalar duration_;
|
||||
|
||||
//- Number of parcels per injector - common to all injection sources
|
||||
const scalar parcelsPerSecond_;
|
||||
|
||||
Reference in New Issue
Block a user