Commit 38ada7f5 authored by Andrew Heather's avatar Andrew Heather
Browse files

updating injection mechanism + added coneInjection model

parent 238b126c
......@@ -48,4 +48,8 @@ submodels/addOns/radiation/scatter/cloudScatter/cloudScatter.C
IntegrationScheme/makeIntegrationSchemes.C
/* Data entries */
submodels/IO/DataEntry/makeDataEntries.C
LIB = $(FOAM_LIBBIN)/liblagrangianIntermediate
......@@ -437,7 +437,13 @@ void Foam::KinematicCloud<ParcelType>::inject
);
// Velocity of parcels
vector pU = this->injection().velocity(iParcel, timeInj);
vector pU = this->injection().velocity
(
iParcel,
timeInj,
this->meshInfo(),
rndGen_
);
// Determine the injection cell
label pCell = -1;
......@@ -496,8 +502,9 @@ void Foam::KinematicCloud<ParcelType>::postInjectCheck()
{
if (nParcelsAdded_)
{
Pout<< "\n--> Cloud: " << this->name() << nl <<
" Added " << nParcelsAdded_ << " new parcels" << nl << endl;
Pout<< "\n--> Cloud: " << this->name() << nl
<< " Added " << nParcelsAdded_
<< " new parcels" << nl << endl;
}
// Reset parcel counters
......
......@@ -277,7 +277,12 @@ void Foam::ReactingCloud<ParcelType>::inject
);
// Velocity of parcels
vector pU = this->injection().velocity(iParcel, timeInj);
vector pU = this->injection().velocity
(
iParcel,
timeInj,
this->meshInfo()
);
// Determine the injection cell
label pCell = -1;
......
......@@ -26,8 +26,9 @@ License
#include "basicKinematicParcel.H"
#include "KinematicCloud.H"
#include "ManualInjection.H"
#include "NoInjection.H"
#include "ManualInjection.H"
#include "ConeInjection.H"
namespace Foam
{
......@@ -35,6 +36,12 @@ namespace Foam
// Add instances of injection model to the table
makeInjectionModelType
(
NoInjection,
KinematicCloud,
basicKinematicParcel
);
makeInjectionModelType
(
ManualInjection,
KinematicCloud,
......@@ -42,7 +49,7 @@ namespace Foam
);
makeInjectionModelType
(
NoInjection,
ConeInjection,
KinematicCloud,
basicKinematicParcel
);
......
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "Constant.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
Foam::Constant<Type>::Constant
(
const word& entryName,
const dictionary& dict
)
:
DataEntry<Type>(typeName, entryName, dict),
value_(this->dict_.lookup("value"))
{}
template<>
Foam::Constant<Foam::label>::Constant
(
const word& entryName,
const dictionary& dict
)
:
DataEntry<label>(typeName, entryName, dict),
value_(readLabel(this->dict_.lookup("value")))
{}
template<>
Foam::Constant<Foam::scalar>::Constant
(
const word& entryName,
const dictionary& dict
)
:
DataEntry<scalar>(typeName, entryName, dict),
value_(readScalar(this->dict_.lookup("value")))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class Type>
Foam::Constant<Type>::~Constant()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
Type Foam::Constant<Type>::value(const scalar x) const
{
return value_;
}
template<class Type>
Type Foam::Constant<Type>::integrate(const scalar x1, const scalar x2) const
{
return (x2 - x1)*value_;
}
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::Constant
Description
Templated basic entry that holds a constant value.
@verbatim
entry Constant
entryCoeffs
{
value 100.0; // Constant value
}
@endverbatim
SourceFiles
Constant.C
\*---------------------------------------------------------------------------*/
#ifndef Constant_H
#define Constant_H
#include "DataEntry.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class Constant Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class Constant
:
public DataEntry<Type>
{
// Private data
Type value_;
// Private Member Functions
//- Disallow default bitwise copy construct
Constant(const Constant<Type>&);
//- Disallow default bitwise assignment
void operator=(const Constant<Type>&);
public:
// Runtime type information
TypeName("Constant");
// Constructors
//- Construct from dictionary
Constant
(
const word& entryName,
const dictionary& dict
);
//- Destructor
~Constant();
// Member Functions
//- Return constant value
Type value(const scalar) const;
//- Integrate between two values
Type integrate(const scalar x1, const scalar x2) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<>
Constant<label>::Constant(const word& entryName, const dictionary& dict);
template<>
Constant<scalar>::Constant(const word& entryName, const dictionary& dict);
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "Constant.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "DataEntry.H"
// * * * * * * * * * * * * * * * * Constructor * * * * * * * * * * * * * * * //
template<class Type>
Foam::DataEntry<Type>::DataEntry
(
const word& typeName,
const word& entryName,
const dictionary& dict
)
:
dict_(dict.subDict(entryName + "Coeffs")),
entry_(entryName)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class Type>
Foam::DataEntry<Type>::~DataEntry()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
const Foam::dictionary& Foam::DataEntry<Type>::dict() const
{
return dict_;
}
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::DataEntry
Description
SourceFiles
DataEntry.C
NewDataEntry.C
\*---------------------------------------------------------------------------*/
#ifndef DataEntry_H
#define DataEntry_H
#include "dictionary.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class DataEntry Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class DataEntry
{
// Private Member Functions
//- Disallow default bitwise copy construct
DataEntry(const DataEntry<Type>&);
//- Disallow default bitwise assignment
void operator=(const DataEntry<Type>&);
protected:
// Protected data
//- Coefficients dictionary
const dictionary dict_;
//- Name of entry
const word entry_;
public:
//- Runtime type information
TypeName("DataEntry")
//- Declare runtime constructor selection table
declareRunTimeSelectionTable
(
autoPtr,
DataEntry,
dictionary,
(
const word& entryName,
const dictionary& dict
),
(entryName, dict)
);
// Constructor
//- Construct from type name and dictionary
DataEntry
(
const word& TypeName,
const word& entryName,
const dictionary& dict
);
//- Selector
static autoPtr<DataEntry<Type> > New
(
const word& entryName,
const dictionary& dict
);
//- Destructor
virtual ~DataEntry();
// Member Functions
// Access
//- Return the dictionary
const dictionary& dict() const;
//- Return value as a function of (scalar) independent variable
virtual Type value(const scalar x) const = 0;
//- Integrate between two (scalar) values
virtual Type integrate(const scalar x1, const scalar x2) const = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define makeDataEntry(Type) \
\
defineNamedTemplateTypeNameAndDebug(DataEntry<Type>, 0); \
\
defineTemplateRunTimeSelectionTable \
( \
DataEntry<Type>, \
dictionary \
);
#define makeDataEntryType(SS, Type) \
\
defineNamedTemplateTypeNameAndDebug(SS<Type>, 0); \
\
DataEntry<Type>::adddictionaryConstructorToTable<SS<Type> > \
add##SS##Type##ConstructorToTable_;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "DataEntry.C"
# include "NewDataEntry.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "DataEntry.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type>
Foam::autoPtr<Foam::DataEntry<Type> > Foam::DataEntry<Type>::New
(
const word& entryName,
const dictionary& dict
)
{
word DataEntryType(dict.lookup(entryName));
// Info<< "Selecting DataEntry " << DataEntryType << endl;
typename dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(DataEntryType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalErrorIn
(
"DataEntry<Type>::New(const dictionary&"
) << "Unknown DataEntry type "
<< DataEntryType << " for " << entryName
<< ", constructor not in hash table" << nl << nl
<< " Valid DataEntry types are :" << nl
<< dictionaryConstructorTablePtr_->toc() << nl
<< exit(FatalError);
}
return autoPtr<DataEntry<Type> >(cstrIter()(entryName, dict));
}
// ************************************************************************* //
/*---------------------------------------------------------------------------*\