Skip to content

Commit

Permalink
lagrangian: drag: Various improvements
Browse files Browse the repository at this point in the history
The dense drag models (WenYu, ErgunWenYu and PlessisMasliyah) have been
extended so that they can create their own void-fraction field when one
is not otherwise available.

The duplicated functionality in the drag models has been generalised and
is now utilised by multiple models.

References have been added for all models for which they could be found.
In addition, an additional drag model, SchillerNaumann, has been added.
This is of the same form as sphereDrag, and is designed for the same
scenario; sparsely distributed spherical particles. The SchillerNaumann
form is more widely referenced and should now be considered standard.

The thermo-parcel-specific force instantiation macro has been removed,
as all the force models are now possible to use with all parcel types.

Resolves bug report https://bugs.openfoam.org/view.php?id=3191
  • Loading branch information
Will Bainbridge committed Mar 15, 2019
1 parent d411661 commit 081db9a
Show file tree
Hide file tree
Showing 27 changed files with 630 additions and 362 deletions.
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand All @@ -28,7 +28,7 @@ License
#include "makeParcelCloudFunctionObjects.H"

// Kinematic
#include "makeThermoParcelForces.H" // thermo variant
#include "makeParcelForces.H"
#include "makeParcelDispersionModels.H"
#include "makeReactingMultiphaseParcelInjectionModels.H" // MP variant
#include "makeParcelPatchInteractionModels.H"
Expand All @@ -51,7 +51,7 @@ License
makeParcelCloudFunctionObjects(basicReactingMultiphaseCloud);

// Kinematic sub-models
makeThermoParcelForces(basicReactingMultiphaseCloud);
makeParcelForces(basicReactingMultiphaseCloud);
makeParcelDispersionModels(basicReactingMultiphaseCloud);
makeReactingMultiphaseParcelInjectionModels(basicReactingMultiphaseCloud);
makeParcelPatchInteractionModels(basicReactingMultiphaseCloud);
Expand Down
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand All @@ -28,7 +28,7 @@ License
#include "makeParcelCloudFunctionObjects.H"

// Kinematic
#include "makeThermoParcelForces.H" // thermo variant
#include "makeParcelForces.H"
#include "makeParcelDispersionModels.H"
#include "makeReactingParcelInjectionModels.H" // Reacting variant
#include "makeParcelPatchInteractionModels.H"
Expand All @@ -47,7 +47,7 @@ License
makeParcelCloudFunctionObjects(basicReactingCloud);

// Kinematic sub-models
makeThermoParcelForces(basicReactingCloud);
makeParcelForces(basicReactingCloud);
makeParcelDispersionModels(basicReactingCloud);
makeReactingParcelInjectionModels(basicReactingCloud);
makeParcelPatchInteractionModels(basicReactingCloud);
Expand Down
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand All @@ -28,7 +28,7 @@ License
#include "makeParcelCloudFunctionObjects.H"

// Kinematic
#include "makeThermoParcelForces.H" // thermo variant
#include "makeParcelForces.H"
#include "makeParcelDispersionModels.H"
#include "makeParcelInjectionModels.H"
#include "makeParcelPatchInteractionModels.H"
Expand All @@ -43,7 +43,7 @@ License
makeParcelCloudFunctionObjects(basicThermoCloud);

// Kinematic sub-models
makeThermoParcelForces(basicThermoCloud);
makeParcelForces(basicThermoCloud);
makeParcelDispersionModels(basicThermoCloud);
makeParcelInjectionModels(basicThermoCloud);
makeParcelPatchInteractionModels(basicThermoCloud);
Expand Down
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -30,6 +30,7 @@ License

#include "SphereDragForce.H"
#include "NonSphereDragForce.H"
#include "SchillerNaumannDragForce.H"
#include "WenYuDragForce.H"
#include "ErgunWenYuDragForce.H"
#include "PlessisMasliyahDragForce.H"
Expand All @@ -53,6 +54,7 @@ License
makeParticleForceModel(CloudType); \
makeParticleForceModelType(SphereDragForce, CloudType); \
makeParticleForceModelType(NonSphereDragForce, CloudType); \
makeParticleForceModelType(SchillerNaumannDragForce, CloudType); \
makeParticleForceModelType(WenYuDragForce, CloudType); \
makeParticleForceModelType(ErgunWenYuDragForce, CloudType); \
makeParticleForceModelType(PlessisMasliyahDragForce, CloudType); \
Expand Down

This file was deleted.

@@ -0,0 +1,118 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/

#include "DenseDragForce.H"
#include "SchillerNaumannDragForce.H"
#include "volFields.H"

// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

template<class CloudType>
Foam::DenseDragForce<CloudType>::DenseDragForce
(
CloudType& owner,
const fvMesh& mesh,
const dictionary& dict,
const word& typeName
)
:
ParticleForce<CloudType>(owner, mesh, dict, typeName, true),
alphacName_(this->coeffs().lookup("alphac")),
alphacPtr_(nullptr),
alphacInterpPtr_(nullptr)
{}


template<class CloudType>
Foam::DenseDragForce<CloudType>::DenseDragForce
(
const DenseDragForce<CloudType>& df
)
:
ParticleForce<CloudType>(df),
alphacName_(df.alphacName_),
alphacPtr_(nullptr),
alphacInterpPtr_(nullptr)
{}


// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //

template<class CloudType>
Foam::DenseDragForce<CloudType>::~DenseDragForce()
{}


// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //

template<class CloudType>
const Foam::interpolation<Foam::scalar>&
Foam::DenseDragForce<CloudType>::alphacInterp() const
{
if (!alphacInterpPtr_.valid())
{
FatalErrorInFunction
<< "Carrier phase volume-fraction interpolation object not set"
<< abort(FatalError);
}

return alphacInterpPtr_();
}


template<class CloudType>
void Foam::DenseDragForce<CloudType>::cacheFields(const bool store)
{
if (store)
{
if (!this->mesh().template foundObject<volVectorField>(alphacName_))
{
alphacPtr_.reset
(
new volScalarField(alphacName_, 1 - this->owner().theta())
);
}

const volScalarField& alphac =
this->mesh().template lookupObject<volScalarField>(alphacName_);

alphacInterpPtr_.reset
(
interpolation<scalar>::New
(
this->owner().solution().interpolationSchemes(),
alphac
).ptr()
);
}
else
{
alphacInterpPtr_.clear();
alphacPtr_.clear();
}
}


// ************************************************************************* //

0 comments on commit 081db9a

Please sign in to comment.