mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Removed cloud injection surface film model
This commit is contained in:
@ -1,118 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2009-2010 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 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "cloudInjection.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
#include "fvMesh.H"
|
|
||||||
#include "Time.H"
|
|
||||||
#include "mathematicalConstants.H"
|
|
||||||
#include "Random.H"
|
|
||||||
#include "volFields.H"
|
|
||||||
|
|
||||||
using namespace Foam::constant;
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace surfaceFilmModels
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(cloudInjection, 0);
|
|
||||||
addToRunTimeSelectionTable(injectionModel, cloudInjection, dictionary);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::surfaceFilmModels::cloudInjection::cloudInjection
|
|
||||||
(
|
|
||||||
const surfaceFilmModel& owner,
|
|
||||||
const dictionary& dict
|
|
||||||
)
|
|
||||||
:
|
|
||||||
injectionModel(type(), owner, dict),
|
|
||||||
cloudName_(coeffs_.lookup("cloudName")),
|
|
||||||
cloud_
|
|
||||||
(
|
|
||||||
const_cast<kinematicCloud&>
|
|
||||||
(
|
|
||||||
owner.mesh().lookupObject<kinematicCloud>(cloudName_)
|
|
||||||
)
|
|
||||||
),
|
|
||||||
particlesPerParcel_(readScalar(coeffs_.lookup("particlesPerParcel"))),
|
|
||||||
rndGen_(label(0)),
|
|
||||||
parcelPDF_(pdfs::pdf::New(coeffs_.subDict("parcelPDF"), rndGen_)),
|
|
||||||
diameter_(owner.film().nCells(), 0.0)
|
|
||||||
{
|
|
||||||
forAll(diameter_, faceI)
|
|
||||||
{
|
|
||||||
diameter_[faceI] = parcelPDF_->sample();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::surfaceFilmModels::cloudInjection::~cloudInjection()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void Foam::surfaceFilmModels::cloudInjection::correct
|
|
||||||
(
|
|
||||||
scalarField& massToInject,
|
|
||||||
scalarField& diameterToInject
|
|
||||||
)
|
|
||||||
{
|
|
||||||
const scalarField& rhoFilm = owner().rho();
|
|
||||||
|
|
||||||
// Collect the data to be transferred
|
|
||||||
forAll(massToInject, cellI)
|
|
||||||
{
|
|
||||||
scalar rho = rhoFilm[cellI];
|
|
||||||
scalar diam = diameter_[cellI];
|
|
||||||
scalar minMass = particlesPerParcel_*rho*mathematical::pi/6*pow3(diam);
|
|
||||||
|
|
||||||
if (massToInject[cellI] > minMass)
|
|
||||||
{
|
|
||||||
// All mass can be injected - set particle diameter
|
|
||||||
diameterToInject[cellI] = diameter_[cellI];
|
|
||||||
|
|
||||||
// Retrieve new particle diameter sample
|
|
||||||
diameter_[cellI] = parcelPDF_->sample();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Mass below minimum threshold - cannot be injected
|
|
||||||
massToInject[cellI] = 0.0;
|
|
||||||
diameterToInject[cellI] = -1.0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,142 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2009-2010 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 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::cloudInjection
|
|
||||||
|
|
||||||
Description
|
|
||||||
Cloud injection model
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
cloudInjection.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef cloudInjection_H
|
|
||||||
#define cloudInjection_H
|
|
||||||
|
|
||||||
#include "injectionModel.H"
|
|
||||||
#include "kinematicCloud.H"
|
|
||||||
#include "pdf.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace surfaceFilmModels
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class cloudInjection Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class cloudInjection
|
|
||||||
:
|
|
||||||
public injectionModel
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
|
|
||||||
// Private member functions
|
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
|
||||||
cloudInjection(const cloudInjection&);
|
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
|
||||||
void operator=(const cloudInjection&);
|
|
||||||
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
// Protected data
|
|
||||||
|
|
||||||
//- Name of the cloud owner for newly ejected parcels
|
|
||||||
word cloudName_;
|
|
||||||
|
|
||||||
//- Reference to the cloud
|
|
||||||
kinematicCloud& cloud_;
|
|
||||||
|
|
||||||
//- Number of particles per parcel
|
|
||||||
scalar particlesPerParcel_;
|
|
||||||
|
|
||||||
//- Random number generator
|
|
||||||
Random rndGen_;
|
|
||||||
|
|
||||||
//- Parcel size PDF model
|
|
||||||
const autoPtr<pdfs::pdf> parcelPDF_;
|
|
||||||
|
|
||||||
//- Diameters of particles to inject into the cloud
|
|
||||||
scalarList diameter_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("cloudInjection");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from surface film model
|
|
||||||
cloudInjection(const surfaceFilmModel& owner, const dictionary& dict);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~cloudInjection();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
// Access
|
|
||||||
|
|
||||||
//- Return the cloud name
|
|
||||||
inline const word& cloudName() const;
|
|
||||||
|
|
||||||
//- Return a reference to the cloud
|
|
||||||
inline const kinematicCloud& cloud() const;
|
|
||||||
|
|
||||||
|
|
||||||
// Evolution
|
|
||||||
|
|
||||||
//- Correct
|
|
||||||
virtual void correct
|
|
||||||
(
|
|
||||||
scalarField& massToInject,
|
|
||||||
scalarField& diameterToInject
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace surfaceFilmModels
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#include "cloudInjectionI.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,44 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2009-2010 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 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "cloudInjection.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
inline const Foam::word&
|
|
||||||
Foam::surfaceFilmModels::cloudInjection::cloudName() const
|
|
||||||
{
|
|
||||||
return cloudName_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::kinematicCloud&
|
|
||||||
Foam::surfaceFilmModels::cloudInjection::cloud() const
|
|
||||||
{
|
|
||||||
return cloud_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
Reference in New Issue
Block a user