From 21430d634296f80e9fa094bd989e9c33a0fbe341 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 2 Feb 2012 17:20:47 +0000 Subject: [PATCH] BUG/ENH: Added use of engine time to cloud injection models - mantis #407 --- .../primitives/functions/DataEntry/CSV/CSV.H | 33 ++-- .../functions/DataEntry/DataEntry/DataEntry.C | 10 +- .../functions/DataEntry/DataEntry/DataEntry.H | 9 +- .../functions/DataEntry/Table/Table.H | 33 ++-- .../functions/DataEntry/Table/TableBase.C | 14 +- .../functions/DataEntry/Table/TableBase.H | 5 +- .../functions/DataEntry/TableFile/TableFile.H | 33 ++-- .../DataEntry/polynomial/polynomial.C | 13 +- .../DataEntry/polynomial/polynomial.H | 18 ++- .../TimeDataEntry/TimeDataEntry.C | 137 ++++++++++++++++ .../TimeDataEntry/TimeDataEntry.H | 153 ++++++++++++++++++ .../ConeInjection/ConeInjection.C | 63 ++++++-- .../ConeInjection/ConeInjection.H | 18 +-- .../ConeNozzleInjection/ConeNozzleInjection.C | 72 ++++----- .../ConeNozzleInjection/ConeNozzleInjection.H | 16 +- .../InflationInjection/InflationInjection.C | 22 +-- .../InflationInjection/InflationInjection.H | 8 +- .../InjectionModel/InjectionModel.C | 1 + .../KinematicLookupTableInjection.C | 4 +- .../KinematicLookupTableInjection.H | 4 +- .../PatchInjection/PatchInjection.C | 19 ++- .../PatchInjection/PatchInjection.H | 8 +- .../ReactingLookupTableInjection.C | 4 +- .../ReactingLookupTableInjection.H | 4 +- .../ReactingMultiphaseLookupTableInjection.C | 4 +- .../ReactingMultiphaseLookupTableInjection.H | 4 +- .../ThermoLookupTableInjection.C | 2 + .../ThermoLookupTableInjection.H | 4 +- 28 files changed, 558 insertions(+), 157 deletions(-) create mode 100644 src/OpenFOAM/primitives/functions/TimeDataEntry/TimeDataEntry/TimeDataEntry.C create mode 100644 src/OpenFOAM/primitives/functions/TimeDataEntry/TimeDataEntry/TimeDataEntry.H diff --git a/src/OpenFOAM/primitives/functions/DataEntry/CSV/CSV.H b/src/OpenFOAM/primitives/functions/DataEntry/CSV/CSV.H index c9540635..a506deed 100644 --- a/src/OpenFOAM/primitives/functions/DataEntry/CSV/CSV.H +++ b/src/OpenFOAM/primitives/functions/DataEntry/CSV/CSV.H @@ -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::value(x); - } + // Manipulation - //- Integrate between two (scalar) values - virtual Type integrate(const scalar x1, const scalar x2) const - { - return TableBase::integrate(x1, x2); - } + //- Convert time + virtual void convertTimeBase(const Time& t) + { + TableBase::convertTimeBase(t); + } + + + // Evaluation + + //- Return Table value + virtual Type value(const scalar x) const + { + return TableBase::value(x); + } + + //- Integrate between two (scalar) values + virtual Type integrate(const scalar x1, const scalar x2) const + { + return TableBase::integrate(x1, x2); + } // I/O diff --git a/src/OpenFOAM/primitives/functions/DataEntry/DataEntry/DataEntry.C b/src/OpenFOAM/primitives/functions/DataEntry/DataEntry/DataEntry.C index cb461558..3b972949 100644 --- a/src/OpenFOAM/primitives/functions/DataEntry/DataEntry/DataEntry.C +++ b/src/OpenFOAM/primitives/functions/DataEntry/DataEntry/DataEntry.C @@ -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::name() const } +template +void Foam::DataEntry::convertTimeBase(const Time&) +{ + // do nothing +} + + template Type Foam::DataEntry::value(const scalar x) const { diff --git a/src/OpenFOAM/primitives/functions/DataEntry/DataEntry/DataEntry.H b/src/OpenFOAM/primitives/functions/DataEntry/DataEntry/DataEntry.H index 5b3e7831..6ab51b98 100644 --- a/src/OpenFOAM/primitives/functions/DataEntry/DataEntry/DataEntry.H +++ b/src/OpenFOAM/primitives/functions/DataEntry/DataEntry/DataEntry.H @@ -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 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 diff --git a/src/OpenFOAM/primitives/functions/DataEntry/Table/Table.H b/src/OpenFOAM/primitives/functions/DataEntry/Table/Table.H index c1ba2121..3f19ec38 100644 --- a/src/OpenFOAM/primitives/functions/DataEntry/Table/Table.H +++ b/src/OpenFOAM/primitives/functions/DataEntry/Table/Table.H @@ -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::value(x); - } + // Manipulation - //- Integrate between two (scalar) values - virtual Type integrate(const scalar x1, const scalar x2) const - { - return TableBase::integrate(x1, x2); - } + //- Convert time + virtual void convertTimeBase(const Time& t) + { + TableBase::convertTimeBase(t); + } + + + // Evaluation + + //- Return Table value + virtual Type value(const scalar x) const + { + return TableBase::value(x); + } + + //- Integrate between two (scalar) values + virtual Type integrate(const scalar x1, const scalar x2) const + { + return TableBase::integrate(x1, x2); + } // I/O diff --git a/src/OpenFOAM/primitives/functions/DataEntry/Table/TableBase.C b/src/OpenFOAM/primitives/functions/DataEntry/Table/TableBase.C index 165b542a..cadc9c53 100644 --- a/src/OpenFOAM/primitives/functions/DataEntry/Table/TableBase.C +++ b/src/OpenFOAM/primitives/functions/DataEntry/Table/TableBase.C @@ -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::checkMaxBounds } +template +void Foam::TableBase::convertTimeBase(const Time& t) +{ + forAll(table_, i) + { + scalar value = table_[i].first(); + table_[i].first() = t.userTimeToTime(value); + } +} + + template Type Foam::TableBase::value(const scalar x) const { diff --git a/src/OpenFOAM/primitives/functions/DataEntry/Table/TableBase.H b/src/OpenFOAM/primitives/functions/DataEntry/Table/TableBase.H index f4d20028..50ee3b95 100644 --- a/src/OpenFOAM/primitives/functions/DataEntry/Table/TableBase.H +++ b/src/OpenFOAM/primitives/functions/DataEntry/Table/TableBase.H @@ -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; diff --git a/src/OpenFOAM/primitives/functions/DataEntry/TableFile/TableFile.H b/src/OpenFOAM/primitives/functions/DataEntry/TableFile/TableFile.H index f128f5ad..5c31c5cf 100644 --- a/src/OpenFOAM/primitives/functions/DataEntry/TableFile/TableFile.H +++ b/src/OpenFOAM/primitives/functions/DataEntry/TableFile/TableFile.H @@ -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 @@ -122,17 +122,28 @@ public: // Member Functions - //- Return TableFile value - virtual Type value(const scalar x) const - { - return TableBase::value(x); - } + // Manipulation - //- Integrate between two (scalar) values - virtual Type integrate(const scalar x1, const scalar x2) const - { - return TableBase::integrate(x1, x2); - } + //- Convert time + virtual void convertTimeBase(const Time& t) + { + TableBase::convertTimeBase(t); + } + + + // Evaluation + + //- Return TableFile value + virtual Type value(const scalar x) const + { + return TableBase::value(x); + } + + //- Integrate between two (scalar) values + virtual Type integrate(const scalar x1, const scalar x2) const + { + return TableBase::integrate(x1, x2); + } // I/O diff --git a/src/OpenFOAM/primitives/functions/DataEntry/polynomial/polynomial.C b/src/OpenFOAM/primitives/functions/DataEntry/polynomial/polynomial.C index 10111c86..34c595f8 100644 --- a/src/OpenFOAM/primitives/functions/DataEntry/polynomial/polynomial.C +++ b/src/OpenFOAM/primitives/functions/DataEntry/polynomial/polynomial.C @@ -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; diff --git a/src/OpenFOAM/primitives/functions/DataEntry/polynomial/polynomial.H b/src/OpenFOAM/primitives/functions/DataEntry/polynomial/polynomial.H index 37a45b33..2ed38a9f 100644 --- a/src/OpenFOAM/primitives/functions/DataEntry/polynomial/polynomial.H +++ b/src/OpenFOAM/primitives/functions/DataEntry/polynomial/polynomial.H @@ -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 diff --git a/src/OpenFOAM/primitives/functions/TimeDataEntry/TimeDataEntry/TimeDataEntry.C b/src/OpenFOAM/primitives/functions/TimeDataEntry/TimeDataEntry/TimeDataEntry.C new file mode 100644 index 00000000..b5e74a78 --- /dev/null +++ b/src/OpenFOAM/primitives/functions/TimeDataEntry/TimeDataEntry/TimeDataEntry.C @@ -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 . + +\*---------------------------------------------------------------------------*/ + +#include "TimeDataEntry.H" + +// * * * * * * * * * * * * * * * * Constructor * * * * * * * * * * * * * * * // + +template +Foam::TimeDataEntry::TimeDataEntry +( + const Time& t, + const word& name, + const dictionary& dict +) +: + time_(t), + name_(name), + entry_(DataEntry::New(name, dict)) +{ + entry_->convertTimeBase(t); +} + + +template +Foam::TimeDataEntry::TimeDataEntry(const Time& t, const word& name) +: + time_(t), + name_(name), + entry_(NULL) +{} + + +template +Foam::TimeDataEntry::TimeDataEntry +( + const TimeDataEntry& tde +) +: + time_(tde.time_), + name_(tde.name_), + entry_(tde.entry_->clone().ptr()) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::TimeDataEntry::~TimeDataEntry() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +void Foam::TimeDataEntry::reset(const dictionary& dict) +{ + entry_.reset + ( + DataEntry::New + ( + name_, + dict + ).ptr() + ); + + entry_->convertTimeBase(time_); +} + + +template +const Foam::word& Foam::TimeDataEntry::name() const +{ + return entry_->name(); +} + + +template +Type Foam::TimeDataEntry::value(const scalar x) const +{ + return entry_->value(x); +} + + +template +Type Foam::TimeDataEntry::integrate +( + const scalar x1, + const scalar x2 +) const +{ + return entry_->integrate(x1, x2); +} + + +// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // + +template +Foam::Ostream& Foam::operator<< +( + Ostream& os, + const TimeDataEntry& de +) +{ + return de.entry_->operator<<(os, de); +} + + +template +void Foam::TimeDataEntry::writeData(Ostream& os) const +{ + entry_->writeData(os); +} + + +// ************************************************************************* // diff --git a/src/OpenFOAM/primitives/functions/TimeDataEntry/TimeDataEntry/TimeDataEntry.H b/src/OpenFOAM/primitives/functions/TimeDataEntry/TimeDataEntry/TimeDataEntry.H new file mode 100644 index 00000000..2cbe1a61 --- /dev/null +++ b/src/OpenFOAM/primitives/functions/TimeDataEntry/TimeDataEntry/TimeDataEntry.H @@ -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 . + +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 TimeDataEntry; + +template +Ostream& operator<< +( + Ostream&, + const TimeDataEntry& +); + +/*---------------------------------------------------------------------------*\ + Class TimeDataEntry Declaration +\*---------------------------------------------------------------------------*/ + +template +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 > 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& 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<< + ( + Ostream& os, + const TimeDataEntry& de + ); + + //- Write in dictionary format + virtual void writeData(Ostream& os) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "TimeDataEntry.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.C index d9b5cf57..ab8a6a1c 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.C @@ -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::ConeInjection ), flowRateProfile_ ( - DataEntry::New("flowRateProfile", this->coeffDict()) + TimeDataEntry + ( + owner.db().time(), + "flowRateProfile", + this->coeffDict() + ) + ), + Umag_ + ( + TimeDataEntry + ( + owner.db().time(), + "Umag", + this->coeffDict() + ) + ), + thetaInner_ + ( + TimeDataEntry + ( + owner.db().time(), + "thetaInner", + this->coeffDict() + ) + ), + thetaOuter_ + ( + TimeDataEntry + ( + owner.db().time(), + "thetaOuter", + this->coeffDict() + ) ), - Umag_(DataEntry::New("Umag", this->coeffDict())), - thetaInner_(DataEntry::New("thetaInner", this->coeffDict())), - thetaOuter_(DataEntry::New("thetaOuter", this->coeffDict())), sizeDistribution_ ( distributionModels::distributionModel::New @@ -67,6 +96,8 @@ Foam::ConeInjection::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::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::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::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::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::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(ti, to)); scalar alpha = sin(coneAngle); @@ -242,7 +273,7 @@ void Foam::ConeInjection::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(); diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.H index 900606de..e41103af 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.H @@ -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 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 > flowRateProfile_; + const TimeDataEntry flowRateProfile_; //- Parcel velocity magnitude relative to SOI [m/s] - const autoPtr > Umag_; + const TimeDataEntry Umag_; //- Inner cone angle relative to SOI [deg] - const autoPtr > thetaInner_; + const TimeDataEntry thetaInner_; //- Outer cone angle relative to SOI [deg] - const autoPtr > thetaOuter_; + const TimeDataEntry thetaOuter_; //- Parcel size distribution model const autoPtr sizeDistribution_; diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeNozzleInjection/ConeNozzleInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeNozzleInjection/ConeNozzleInjection.C index 08e824f3..f03736d1 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeNozzleInjection/ConeNozzleInjection.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeNozzleInjection/ConeNozzleInjection.C @@ -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::setFlowType() } else if (flowType == "pressureDrivenVelocity") { - Pinj_.reset - ( - DataEntry::New - ( - "Pinj", - this->coeffDict() - ).ptr() - ); + Pinj_.reset(this->coeffDict()); flowType_ = ftPressureDrivenVelocity; } else if (flowType == "flowRateAndDischarge") { - Cd_.reset - ( - DataEntry::New - ( - "Cd", - this->coeffDict() - ).ptr() - ); + Cd_.reset(this->coeffDict()); flowType_ = ftFlowRateAndDischarge; } else @@ -132,24 +118,27 @@ Foam::ConeNozzleInjection::ConeNozzleInjection ), flowRateProfile_ ( - DataEntry::New + TimeDataEntry ( + owner.db().time(), "flowRateProfile", this->coeffDict() ) ), thetaInner_ ( - DataEntry::New + TimeDataEntry ( + owner.db().time(), "thetaInner", this->coeffDict() ) ), thetaOuter_ ( - DataEntry::New + TimeDataEntry ( + owner.db().time(), "thetaOuter", this->coeffDict() ) @@ -167,8 +156,8 @@ Foam::ConeNozzleInjection::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::ConeNozzleInjection << exit(FatalError); } + duration_ = owner.db().time().userTimeToTime(duration_); + setInjectionMethod(); setFlowType(); @@ -208,7 +199,7 @@ Foam::ConeNozzleInjection::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::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::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::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()*(to - ti) + ti; coneAngle *= deg2Rad; @@ -407,7 +389,7 @@ void Foam::ConeNozzleInjection::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::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; } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeNozzleInjection/ConeNozzleInjection.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeNozzleInjection/ConeNozzleInjection.H index 330cda3c..766b363c 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeNozzleInjection/ConeNozzleInjection.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeNozzleInjection/ConeNozzleInjection.H @@ -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 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 > flowRateProfile_; + const TimeDataEntry flowRateProfile_; //- Inner cone angle relative to SOI [deg] - const autoPtr > thetaInner_; + const TimeDataEntry thetaInner_; //- Outer cone angle relative to SOI [deg] - const autoPtr > thetaOuter_; + const TimeDataEntry thetaOuter_; //- Parcel size PDF model const autoPtr sizeDistribution_; @@ -162,10 +162,10 @@ private: scalar UMag_; //- Discharge coefficient, relative to SOI [m/s] - autoPtr > Cd_; + TimeDataEntry Cd_; //- Injection pressure [Pa] - autoPtr > Pinj_; + TimeDataEntry Pinj_; // Private Member Functions diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.C index 8f36cc78..6fd75381 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.C @@ -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::InflationInjection duration_(readScalar(this->coeffDict().lookup("duration"))), flowRateProfile_ ( - DataEntry::New + TimeDataEntry ( + owner.db().time(), "flowRateProfile", this->coeffDict() ) ), growthRate_ ( - DataEntry::New + TimeDataEntry ( + owner.db().time(), "growthRate", this->coeffDict() ) @@ -76,6 +78,8 @@ Foam::InflationInjection::InflationInjection ) ) { + duration_ = owner.db().time().userTimeToTime(duration_); + if (selfSeed_) { dSeed_ = readScalar(this->coeffDict().lookup("dSeed")); @@ -111,7 +115,7 @@ Foam::InflationInjection::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::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::parcelsToInject List >& 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::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::volumeToInject { if ((time0 >= 0.0) && (time0 < duration_)) { - return fraction_*flowRateProfile_().integrate(time0, time1); + return fraction_*flowRateProfile_.integrate(time0, time1); } else { diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.H index 07efb9fa..b01f4eed 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.H @@ -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 > flowRateProfile_; + TimeDataEntry flowRateProfile_; //- Growth rate of particle diameters towards target [m/s] - const autoPtr > growthRate_; + TimeDataEntry growthRate_; //- Positions, velocities, diameters and target diameters of // new particles after splitting diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C index abdce887..868824fb 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C @@ -316,6 +316,7 @@ Foam::InjectionModel::InjectionModel { this->coeffDict().lookup("massTotal") >> massTotal_; this->coeffDict().lookup("SOI") >> SOI_; + SOI_ = owner.db().time().userTimeToTime(SOI_); } else { diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/KinematicLookupTableInjection/KinematicLookupTableInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/KinematicLookupTableInjection/KinematicLookupTableInjection.C index ab10a98a..b803a52c 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/KinematicLookupTableInjection/KinematicLookupTableInjection.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/KinematicLookupTableInjection/KinematicLookupTableInjection.C @@ -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::KinematicLookupTableInjection injectorTetFaces_(0), injectorTetPts_(0) { + duration_ = owner.db().time().userTimeToTime(duration_); + // Set/cache the injector cells injectorCells_.setSize(injectors_.size()); injectorTetFaces_.setSize(injectors_.size()); diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/KinematicLookupTableInjection/KinematicLookupTableInjection.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/KinematicLookupTableInjection/KinematicLookupTableInjection.H index 9c88bc16..77807ac9 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/KinematicLookupTableInjection/KinematicLookupTableInjection.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/KinematicLookupTableInjection/KinematicLookupTableInjection.H @@ -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_; diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.C index 1834fe07..edaef803 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.C @@ -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::PatchInjection U0_(this->coeffDict().lookup("U0")), flowRateProfile_ ( - DataEntry::New("flowRateProfile", this->coeffDict()) + TimeDataEntry + ( + owner.db().time(), + "flowRateProfile", + this->coeffDict() + ) ), sizeDistribution_ ( @@ -76,6 +81,8 @@ Foam::PatchInjection::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::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::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::volumeToInject { if ((time0 >= 0.0) && (time0 < duration_)) { - return fraction_*flowRateProfile_().integrate(time0, time1); + return fraction_*flowRateProfile_.integrate(time0, time1); } else { diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.H index f3334993..fde6bcdd 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.H @@ -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 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 > flowRateProfile_; + const TimeDataEntry flowRateProfile_; //- Parcel size distribution model const autoPtr sizeDistribution_; diff --git a/src/lagrangian/intermediate/submodels/Reacting/InjectionModel/ReactingLookupTableInjection/ReactingLookupTableInjection.C b/src/lagrangian/intermediate/submodels/Reacting/InjectionModel/ReactingLookupTableInjection/ReactingLookupTableInjection.C index dd3d80ca..07de5839 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/InjectionModel/ReactingLookupTableInjection/ReactingLookupTableInjection.C +++ b/src/lagrangian/intermediate/submodels/Reacting/InjectionModel/ReactingLookupTableInjection/ReactingLookupTableInjection.C @@ -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::ReactingLookupTableInjection injectorTetFaces_(0), injectorTetPts_(0) { + duration_ = owner.db().time().userTimeToTime(duration_); + // Set/cache the injector cells injectorCells_.setSize(injectors_.size()); injectorTetFaces_.setSize(injectors_.size()); diff --git a/src/lagrangian/intermediate/submodels/Reacting/InjectionModel/ReactingLookupTableInjection/ReactingLookupTableInjection.H b/src/lagrangian/intermediate/submodels/Reacting/InjectionModel/ReactingLookupTableInjection/ReactingLookupTableInjection.H index 25a9657a..7a080d74 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/InjectionModel/ReactingLookupTableInjection/ReactingLookupTableInjection.H +++ b/src/lagrangian/intermediate/submodels/Reacting/InjectionModel/ReactingLookupTableInjection/ReactingLookupTableInjection.H @@ -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_; diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/InjectionModel/ReactingMultiphaseLookupTableInjection/ReactingMultiphaseLookupTableInjection.C b/src/lagrangian/intermediate/submodels/ReactingMultiphase/InjectionModel/ReactingMultiphaseLookupTableInjection/ReactingMultiphaseLookupTableInjection.C index 274c8cc7..9fb28ece 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/InjectionModel/ReactingMultiphaseLookupTableInjection/ReactingMultiphaseLookupTableInjection.C +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/InjectionModel/ReactingMultiphaseLookupTableInjection/ReactingMultiphaseLookupTableInjection.C @@ -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()); diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/InjectionModel/ReactingMultiphaseLookupTableInjection/ReactingMultiphaseLookupTableInjection.H b/src/lagrangian/intermediate/submodels/ReactingMultiphase/InjectionModel/ReactingMultiphaseLookupTableInjection/ReactingMultiphaseLookupTableInjection.H index a41ba3cd..00a89913 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/InjectionModel/ReactingMultiphaseLookupTableInjection/ReactingMultiphaseLookupTableInjection.H +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/InjectionModel/ReactingMultiphaseLookupTableInjection/ReactingMultiphaseLookupTableInjection.H @@ -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_; diff --git a/src/lagrangian/intermediate/submodels/Thermodynamic/InjectionModel/ThermoLookupTableInjection/ThermoLookupTableInjection.C b/src/lagrangian/intermediate/submodels/Thermodynamic/InjectionModel/ThermoLookupTableInjection/ThermoLookupTableInjection.C index 7208eab3..85bb11d3 100644 --- a/src/lagrangian/intermediate/submodels/Thermodynamic/InjectionModel/ThermoLookupTableInjection/ThermoLookupTableInjection.C +++ b/src/lagrangian/intermediate/submodels/Thermodynamic/InjectionModel/ThermoLookupTableInjection/ThermoLookupTableInjection.C @@ -57,6 +57,8 @@ Foam::ThermoLookupTableInjection::ThermoLookupTableInjection injectorTetFaces_(0), injectorTetPts_(0) { + duration_ = owner.db().time().userTimeToTime(duration_); + // Set/cache the injector cells injectorCells_.setSize(injectors_.size()); injectorTetFaces_.setSize(injectors_.size()); diff --git a/src/lagrangian/intermediate/submodels/Thermodynamic/InjectionModel/ThermoLookupTableInjection/ThermoLookupTableInjection.H b/src/lagrangian/intermediate/submodels/Thermodynamic/InjectionModel/ThermoLookupTableInjection/ThermoLookupTableInjection.H index c7019bb8..13a2ae49 100644 --- a/src/lagrangian/intermediate/submodels/Thermodynamic/InjectionModel/ThermoLookupTableInjection/ThermoLookupTableInjection.H +++ b/src/lagrangian/intermediate/submodels/Thermodynamic/InjectionModel/ThermoLookupTableInjection/ThermoLookupTableInjection.H @@ -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_;