mirror of
https://github.com/ParticulateFlow/CFDEMcoupling-PFM.git
synced 2025-12-08 06:37:44 +00:00
Removed obsolete code.
This commit is contained in:
@ -1,88 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
CFDEMcoupling academic - Open Source CFD-DEM coupling
|
|
||||||
|
|
||||||
Contributing authors:
|
|
||||||
Thomas Lichtenegger, Gerhard Holzinger
|
|
||||||
Copyright (C) 2015- Johannes Kepler University, Linz
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of CFDEMcoupling academic.
|
|
||||||
|
|
||||||
CFDEMcoupling academic 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.
|
|
||||||
|
|
||||||
CFDEMcoupling academic 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 CFDEMcoupling academic. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "error.H"
|
|
||||||
#include "forceModelRec.H"
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
defineTypeNameAndDebug(forceModelRec, 0);
|
|
||||||
|
|
||||||
defineRunTimeSelectionTable(forceModelRec, dictionary);
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// Construct from components
|
|
||||||
forceModelRec::forceModelRec
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
cfdemCloudRec& sm
|
|
||||||
)
|
|
||||||
:
|
|
||||||
dict_(dict),
|
|
||||||
particleCloud_(sm)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
forceModelRec::~forceModelRec()
|
|
||||||
{}
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Member Fct * * * * * * * * * * * * * * * //
|
|
||||||
void forceModelRec::partToArray
|
|
||||||
(
|
|
||||||
label& index,
|
|
||||||
const vector& dragTot
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
for(int j=0;j<3;j++)
|
|
||||||
DEMForces()[index][j] += dragTot[j];
|
|
||||||
}
|
|
||||||
|
|
||||||
void forceModelRec::partToArrayU
|
|
||||||
(
|
|
||||||
label& index,
|
|
||||||
const vector& U
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
for(int j=0;j<3;j++)
|
|
||||||
fluidVel()[index][j] += U[j];
|
|
||||||
}
|
|
||||||
|
|
||||||
void forceModelRec::coupleRecForce()
|
|
||||||
{
|
|
||||||
particleCloud_.coupleRecForce_=true;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,119 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
CFDEMcoupling academic - Open Source CFD-DEM coupling
|
|
||||||
|
|
||||||
Contributing authors:
|
|
||||||
Thomas Lichtenegger, Gerhard Holzinger
|
|
||||||
Copyright (C) 2015- Johannes Kepler University, Linz
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of CFDEMcoupling academic.
|
|
||||||
|
|
||||||
CFDEMcoupling academic 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.
|
|
||||||
|
|
||||||
CFDEMcoupling academic 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 CFDEMcoupling academic. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef forceModelRec_H
|
|
||||||
#define forceModelRec_H
|
|
||||||
|
|
||||||
#include "cfdemCloudRec.H"
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class forceModelRec Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class forceModelRec
|
|
||||||
{
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
// Protected data
|
|
||||||
const dictionary& dict_;
|
|
||||||
|
|
||||||
cfdemCloudRec& particleCloud_;
|
|
||||||
|
|
||||||
void coupleRecForce();
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("forceModelRec");
|
|
||||||
|
|
||||||
// Declare runtime constructor selection table
|
|
||||||
|
|
||||||
declareRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
autoPtr,
|
|
||||||
forceModelRec,
|
|
||||||
dictionary,
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
cfdemCloudRec& sm
|
|
||||||
),
|
|
||||||
(dict,sm)
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
forceModelRec
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
cfdemCloudRec& sm
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// Destructor
|
|
||||||
|
|
||||||
virtual ~forceModelRec();
|
|
||||||
|
|
||||||
|
|
||||||
// Selector
|
|
||||||
|
|
||||||
static autoPtr<forceModelRec> New
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
cfdemCloudRec& sm,
|
|
||||||
word forceType
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
virtual void setForce() const = 0;
|
|
||||||
|
|
||||||
|
|
||||||
// Access
|
|
||||||
inline double ** DEMForces() const { return particleCloud_.DEMForces_; }
|
|
||||||
|
|
||||||
inline double ** fluidVel() const { return particleCloud_.fluidVel_; }
|
|
||||||
|
|
||||||
inline double ** particleVel() const { return particleCloud_.velocities_; }
|
|
||||||
|
|
||||||
void partToArray(label&, const vector&) const;
|
|
||||||
|
|
||||||
void partToArrayU(label&, const vector&) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,70 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
CFDEMcoupling academic - Open Source CFD-DEM coupling
|
|
||||||
|
|
||||||
Contributing authors:
|
|
||||||
Thomas Lichtenegger, Gerhard Holzinger
|
|
||||||
Copyright (C) 2015- Johannes Kepler University, Linz
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of CFDEMcoupling academic.
|
|
||||||
|
|
||||||
CFDEMcoupling academic 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.
|
|
||||||
|
|
||||||
CFDEMcoupling academic 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 CFDEMcoupling academic. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "error.H"
|
|
||||||
#include "forceModelRec.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
autoPtr<forceModelRec> forceModelRec::New
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
cfdemCloudRec& sm,
|
|
||||||
word forceType
|
|
||||||
)
|
|
||||||
{
|
|
||||||
Info<< "Selecting forceModelRec "
|
|
||||||
<< forceType << endl;
|
|
||||||
|
|
||||||
dictionaryConstructorTable::iterator cstrIter =
|
|
||||||
dictionaryConstructorTablePtr_->find(forceType);
|
|
||||||
|
|
||||||
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
|
||||||
{
|
|
||||||
FatalError
|
|
||||||
<< "forceModelRec::New(const dictionary&, const spray&) : "
|
|
||||||
<< endl
|
|
||||||
<< " unknown forceModelRecType type "
|
|
||||||
<< forceType
|
|
||||||
<< ", constructor not in hash table" << endl << endl
|
|
||||||
<< " Valid forceModelRec types are :"
|
|
||||||
<< endl;
|
|
||||||
Info<< dictionaryConstructorTablePtr_->toc()
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
return autoPtr<forceModelRec>(cstrIter()(dict,sm));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,138 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
CFDEMcoupling academic - Open Source CFD-DEM coupling
|
|
||||||
|
|
||||||
Contributing authors:
|
|
||||||
Thomas Lichtenegger
|
|
||||||
Copyright (C) 2015- Johannes Kepler University, Linz
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of CFDEMcoupling academic.
|
|
||||||
|
|
||||||
CFDEMcoupling academic 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.
|
|
||||||
|
|
||||||
CFDEMcoupling academic 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 CFDEMcoupling academic. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "error.H"
|
|
||||||
|
|
||||||
#include "gradConcentration.H"
|
|
||||||
#include "recModel.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
#include "fvcSmooth.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
defineTypeNameAndDebug(gradConcentration, 0);
|
|
||||||
|
|
||||||
addToRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
forceModelRec,
|
|
||||||
gradConcentration,
|
|
||||||
dictionary
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// Construct from components
|
|
||||||
gradConcentration::gradConcentration
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
cfdemCloudRec& sm
|
|
||||||
)
|
|
||||||
:
|
|
||||||
forceModelRec(dict,sm),
|
|
||||||
propsDict_(dict.subDict(typeName + "Props")),
|
|
||||||
interpolate_(propsDict_.lookupOrDefault<bool>("interpolation", false)),
|
|
||||||
scalingFactor_(propsDict_.lookupOrDefault<scalar>("scalingFactor", 1.0)),
|
|
||||||
voidfractionRecFieldName_(propsDict_.lookupOrDefault<word>("voidfractionRecFieldName","voidfractionRec")),
|
|
||||||
voidfractionRec_(sm.mesh().lookupObject<volScalarField> (voidfractionRecFieldName_)),
|
|
||||||
voidfractionFieldName_(propsDict_.lookupOrDefault<word>("voidfractionFieldName","voidfraction")),
|
|
||||||
voidfraction_(sm.mesh().lookupObject<volScalarField> (voidfractionFieldName_)),
|
|
||||||
deltaVoidfraction_
|
|
||||||
( IOobject
|
|
||||||
(
|
|
||||||
"deltaVoidfraction",
|
|
||||||
sm.mesh().time().timeName(),
|
|
||||||
sm.mesh(),
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
voidfractionRec_
|
|
||||||
)
|
|
||||||
{
|
|
||||||
coupleRecForce();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
gradConcentration::~gradConcentration()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void gradConcentration::setForce() const
|
|
||||||
{
|
|
||||||
deltaVoidfraction_ = voidfraction_-voidfractionRec_;
|
|
||||||
volVectorField gradDeltaVoidfraction_ = fvc::grad(deltaVoidfraction_);
|
|
||||||
vector position(0,0,0);
|
|
||||||
vector force(0,0,0);
|
|
||||||
label cellI=0;
|
|
||||||
scalar scalDConc=0.0;
|
|
||||||
interpolationCellPoint<scalar> dConcInterpolator_(deltaVoidfraction_);
|
|
||||||
interpolationCellPoint<vector> gradConcInterpolator_(gradDeltaVoidfraction_);
|
|
||||||
|
|
||||||
for(int index = 0;index < particleCloud_.numberOfParticles(); ++index)
|
|
||||||
{
|
|
||||||
cellI = particleCloud_.cellIDs()[index][0];
|
|
||||||
force =vector(0,0,0);
|
|
||||||
if (cellI > -1) // particle Found
|
|
||||||
{
|
|
||||||
|
|
||||||
if( interpolate_ )
|
|
||||||
{
|
|
||||||
position = particleCloud_.position(index);
|
|
||||||
scalDConc=dConcInterpolator_.interpolate(position,cellI);
|
|
||||||
if(scalDConc<0)
|
|
||||||
force = gradConcInterpolator_.interpolate(position,cellI);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if(deltaVoidfraction_[cellI]<0)
|
|
||||||
force = gradDeltaVoidfraction_[cellI];
|
|
||||||
}
|
|
||||||
// need a prefactor to relate concentration gradient to force
|
|
||||||
force*= scalingFactor_;
|
|
||||||
|
|
||||||
// write particle based data to global array
|
|
||||||
partToArray(index,force);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void gradConcentration::smoothField(volScalarField& field)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,96 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
CFDEMcoupling academic - Open Source CFD-DEM coupling
|
|
||||||
|
|
||||||
Contributing authors:
|
|
||||||
Thomas Lichtenegger
|
|
||||||
Copyright (C) 2015- Johannes Kepler University, Linz
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of CFDEMcoupling academic.
|
|
||||||
|
|
||||||
CFDEMcoupling academic 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.
|
|
||||||
|
|
||||||
CFDEMcoupling academic 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 CFDEMcoupling academic. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef gradConcentration_H
|
|
||||||
#define gradConcentration_H
|
|
||||||
|
|
||||||
#include "forceModelRec.H"
|
|
||||||
#include "interpolationCellPoint.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class gradConcentration Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class gradConcentration
|
|
||||||
:
|
|
||||||
public forceModelRec
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
dictionary propsDict_;
|
|
||||||
|
|
||||||
bool interpolate_;
|
|
||||||
|
|
||||||
scalar scalingFactor_;
|
|
||||||
|
|
||||||
word voidfractionRecFieldName_;
|
|
||||||
|
|
||||||
const volScalarField& voidfractionRec_;
|
|
||||||
|
|
||||||
word voidfractionFieldName_;
|
|
||||||
|
|
||||||
const volScalarField& voidfraction_;
|
|
||||||
|
|
||||||
mutable volScalarField deltaVoidfraction_;
|
|
||||||
|
|
||||||
void smoothField(volScalarField&);
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("gradConcentration");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
gradConcentration
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
cfdemCloudRec& sm
|
|
||||||
);
|
|
||||||
|
|
||||||
// Destructor
|
|
||||||
|
|
||||||
~gradConcentration();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
void setForce() const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,191 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
CFDEMcoupling academic - Open Source CFD-DEM coupling
|
|
||||||
|
|
||||||
Contributing authors:
|
|
||||||
Thomas Lichtenegger, Gerhard Holzinger
|
|
||||||
Copyright (C) 2015- Johannes Kepler University, Linz
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of CFDEMcoupling academic.
|
|
||||||
|
|
||||||
CFDEMcoupling academic 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.
|
|
||||||
|
|
||||||
CFDEMcoupling academic 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 CFDEMcoupling academic. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "error.H"
|
|
||||||
|
|
||||||
#include "tracerPointSource.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
#include "dataExchangeModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
defineTypeNameAndDebug(tracerPointSource, 0);
|
|
||||||
|
|
||||||
addToRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
forceModelRec,
|
|
||||||
tracerPointSource,
|
|
||||||
dictionary
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// Construct from components
|
|
||||||
tracerPointSource::tracerPointSource
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
cfdemCloudRec& sm
|
|
||||||
)
|
|
||||||
:
|
|
||||||
forceModelRec(dict,sm),
|
|
||||||
propsDict_(dict.subDict(typeName + "Props")),
|
|
||||||
tracerConcentrationField_
|
|
||||||
( IOobject
|
|
||||||
(
|
|
||||||
"tracerConcentration",
|
|
||||||
sm.mesh().time().timeName(),
|
|
||||||
sm.mesh(),
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
sm.mesh(),
|
|
||||||
dimensionedScalar("zero", dimensionSet(0,0,0,0,0), 0.0)
|
|
||||||
),
|
|
||||||
tracerConcentrationPart_(NULL),
|
|
||||||
sourcePosition_(propsDict_.lookup("sourcePosition")),
|
|
||||||
sourceStrength_(readScalar(propsDict_.lookup("sourceStrength"))),
|
|
||||||
beginTime_(propsDict_.lookupOrDefault<scalar>("beginTime",0.0)),
|
|
||||||
endTime_(propsDict_.lookupOrDefault<scalar>("endTime",GREAT)),
|
|
||||||
numReceiverPart_(propsDict_.lookupOrDefault<label>("numReceiverPart",1)),
|
|
||||||
itID_(NULL),
|
|
||||||
itDist_(NULL)
|
|
||||||
{
|
|
||||||
if (numReceiverPart_<1)
|
|
||||||
{
|
|
||||||
FatalError
|
|
||||||
<< "tracerPointSource::tracerPointSource() : "
|
|
||||||
<< endl
|
|
||||||
<< " trying to set invalid number of receiver particles. "<< endl << endl
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
// distribute source strength by number of receiving particles and over the number of steps per time
|
|
||||||
sourceStrength_*=particleCloud_.mesh().time().deltaTValue()/numReceiverPart_; // need time step
|
|
||||||
|
|
||||||
Info<< "\nSource strength set to " << sourceStrength_ << " per receiver and time step.\n" << endl;
|
|
||||||
|
|
||||||
receiverIDs_.reserve(numReceiverPart_);
|
|
||||||
receiverDist_.reserve(numReceiverPart_);
|
|
||||||
allocateMyArrays();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
tracerPointSource::~tracerPointSource()
|
|
||||||
{
|
|
||||||
delete tracerConcentrationPart_;
|
|
||||||
}
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * private Member Functions * * * * * * * * * * * * * //
|
|
||||||
void tracerPointSource::allocateMyArrays() const
|
|
||||||
{
|
|
||||||
// get memory for 2d arrays
|
|
||||||
double initVal=0.0;
|
|
||||||
particleCloud_.dataExchangeM().allocateArray(tracerConcentrationPart_,initVal,1);
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * public Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void tracerPointSource::setForce() const
|
|
||||||
{
|
|
||||||
// not working yet, information lost on reallocation
|
|
||||||
// procedure moved to LIGGGHTS code
|
|
||||||
|
|
||||||
/* scalar currTime=particleCloud_.mesh().time().value();
|
|
||||||
if (currTime < beginTime_ || currTime > endTime_)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// realloc the arrays
|
|
||||||
allocateMyArrays();
|
|
||||||
|
|
||||||
// reset Scalar field
|
|
||||||
tracerConcentrationField_.internalField() = 0.0;
|
|
||||||
|
|
||||||
//get DEM data
|
|
||||||
// particleCloud_.dataExchangeM().getData("tracerconcentration","scalar-atom",tracerConcentrationPart_);
|
|
||||||
|
|
||||||
label cellI=0;
|
|
||||||
scalar distance=0.0;
|
|
||||||
vector position;
|
|
||||||
receiverIDs_.assign(numReceiverPart_, -1);
|
|
||||||
receiverDist_.assign(numReceiverPart_, GREAT);
|
|
||||||
|
|
||||||
for(int index = 0;index < particleCloud_.numberOfParticles(); ++index)
|
|
||||||
{
|
|
||||||
cellI = particleCloud_.cellIDs()[index][0];
|
|
||||||
if(cellI >= 0)
|
|
||||||
{
|
|
||||||
position = particleCloud_.position(index);
|
|
||||||
distance = mag(position-sourcePosition_);
|
|
||||||
if (distance < receiverDist_[numReceiverPart_-1])
|
|
||||||
{
|
|
||||||
int pos;
|
|
||||||
for(pos=numReceiverPart_-2; pos>=0; pos--)
|
|
||||||
if( distance > receiverDist_[pos] )
|
|
||||||
break;
|
|
||||||
receiverIDs_.pop_back();
|
|
||||||
receiverDist_.pop_back();
|
|
||||||
pos++;
|
|
||||||
itID_ = receiverIDs_.begin()+pos;
|
|
||||||
itDist_ = receiverDist_.begin()+pos;
|
|
||||||
receiverIDs_.insert(itID_,index);
|
|
||||||
receiverDist_.insert(itDist_,distance);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// check if enough particles were found
|
|
||||||
if(receiverIDs_[numReceiverPart_-1] < 0)
|
|
||||||
{
|
|
||||||
FatalError
|
|
||||||
<< "tracerPointSource::setForce() : "
|
|
||||||
<< endl
|
|
||||||
<< " not enough receiver particles found. "<< endl << endl
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
particleCloud_.averagingM().setScalarSum
|
|
||||||
(
|
|
||||||
tracerConcentrationField_,
|
|
||||||
tracerConcentrationPart_,
|
|
||||||
particleCloud_.particleWeights(),
|
|
||||||
NULL
|
|
||||||
);
|
|
||||||
// give DEM data
|
|
||||||
particleCloud_.dataExchangeM().giveData("tracerconcentration","scalar-atom", tracerConcentrationPart_);
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,112 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
CFDEMcoupling academic - Open Source CFD-DEM coupling
|
|
||||||
|
|
||||||
Contributing authors:
|
|
||||||
Thomas Lichtenegger, Gerhard Holzinger
|
|
||||||
Copyright (C) 2015- Johannes Kepler University, Linz
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of CFDEMcoupling academic.
|
|
||||||
|
|
||||||
CFDEMcoupling academic 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.
|
|
||||||
|
|
||||||
CFDEMcoupling academic 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 CFDEMcoupling academic. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
|
|
||||||
Class
|
|
||||||
tracerPointSource
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
tracerPointSource.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef tracerPointSource_H
|
|
||||||
#define tracerPointSource_H
|
|
||||||
|
|
||||||
#include "forceModelRec.H"
|
|
||||||
#include "averagingModel.H"
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class tracerPointSource Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class tracerPointSource
|
|
||||||
:
|
|
||||||
public forceModelRec
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
dictionary propsDict_;
|
|
||||||
|
|
||||||
mutable volScalarField tracerConcentrationField_; // Eulerian field
|
|
||||||
|
|
||||||
mutable double **tracerConcentrationPart_; // Lagrangian array
|
|
||||||
|
|
||||||
vector sourcePosition_;
|
|
||||||
|
|
||||||
scalar sourceStrength_;
|
|
||||||
|
|
||||||
scalar beginTime_;
|
|
||||||
|
|
||||||
scalar endTime_;
|
|
||||||
|
|
||||||
label numReceiverPart_;
|
|
||||||
|
|
||||||
mutable std::vector<int> receiverIDs_;
|
|
||||||
|
|
||||||
mutable std::vector<scalar> receiverDist_;
|
|
||||||
|
|
||||||
mutable std::vector<int>::iterator itID_;
|
|
||||||
|
|
||||||
mutable std::vector<scalar>::iterator itDist_;
|
|
||||||
|
|
||||||
void allocateMyArrays() const;
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("tracerPointSource");
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
tracerPointSource
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
cfdemCloudRec& sm
|
|
||||||
);
|
|
||||||
|
|
||||||
// Destructor
|
|
||||||
|
|
||||||
~tracerPointSource();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
void setForce() const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
Reference in New Issue
Block a user