From c0264dcdfa2617282d640737ec791916d6685a08 Mon Sep 17 00:00:00 2001 From: ignis Date: Mon, 5 Feb 2018 04:38:47 +0900 Subject: [PATCH] ThermoMPPICCloud to accept ThermoCloud --- .../clouds/Templates/MPPICCloud/MPPICCloud.C | 4 +- .../clouds/Templates/MPPICCloud/MPPICCloud.H | 3 +- .../ThermoMPPICCloud/ThermoMPPICCloud.C | 76 ++++++++++ .../ThermoMPPICCloud/ThermoMPPICCloud.H | 135 ++++++++++++++++++ .../basicThermoKinematicMPPICCloud.H | 6 +- 5 files changed, 217 insertions(+), 7 deletions(-) create mode 100644 src/lagrangian/intermediate/clouds/Templates/ThermoMPPICCloud/ThermoMPPICCloud.C create mode 100644 src/lagrangian/intermediate/clouds/Templates/ThermoMPPICCloud/ThermoMPPICCloud.H diff --git a/src/lagrangian/intermediate/clouds/Templates/MPPICCloud/MPPICCloud.C b/src/lagrangian/intermediate/clouds/Templates/MPPICCloud/MPPICCloud.C index f6cc7c950..702d2454b 100644 --- a/src/lagrangian/intermediate/clouds/Templates/MPPICCloud/MPPICCloud.C +++ b/src/lagrangian/intermediate/clouds/Templates/MPPICCloud/MPPICCloud.C @@ -70,12 +70,12 @@ Foam::MPPICCloud::MPPICCloud const word& cloudName, const volScalarField& rho, const volVectorField& U, + const volScalarField& mu, const dimensionedVector& g, - const SLGThermo& thermo, bool readFields ) : - CloudType(cloudName, rho, U, g, thermo, false), + CloudType(cloudName, rho, U, mu, g, false), packingModel_(NULL), dampingModel_(NULL), isotropyModel_(NULL) diff --git a/src/lagrangian/intermediate/clouds/Templates/MPPICCloud/MPPICCloud.H b/src/lagrangian/intermediate/clouds/Templates/MPPICCloud/MPPICCloud.H index c49125bd6..1d34b686e 100644 --- a/src/lagrangian/intermediate/clouds/Templates/MPPICCloud/MPPICCloud.H +++ b/src/lagrangian/intermediate/clouds/Templates/MPPICCloud/MPPICCloud.H @@ -43,7 +43,6 @@ SourceFiles #include "fvMesh.H" #include "volFields.H" -#include "ThermoCloud.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam @@ -134,8 +133,8 @@ public: const word& cloudName, const volScalarField& rho, const volVectorField& U, + const volScalarField& mu, const dimensionedVector& g, - const SLGThermo& thermo, bool readFields = true ); diff --git a/src/lagrangian/intermediate/clouds/Templates/ThermoMPPICCloud/ThermoMPPICCloud.C b/src/lagrangian/intermediate/clouds/Templates/ThermoMPPICCloud/ThermoMPPICCloud.C new file mode 100644 index 000000000..5d4cdb97e --- /dev/null +++ b/src/lagrangian/intermediate/clouds/Templates/ThermoMPPICCloud/ThermoMPPICCloud.C @@ -0,0 +1,76 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013-2016 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 "ThermoMPPICCloud.H" +#include "PackingModel.H" +#include "ParticleStressModel.H" +#include "DampingModel.H" +#include "IsotropyModel.H" +#include "TimeScaleModel.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::ThermoMPPICCloud::ThermoMPPICCloud +( + const word& cloudName, + const volScalarField& rho, + const volVectorField& U, + const dimensionedVector& g, + const SLGThermo& thermo, + bool readFields +) +: + CloudType(cloudName, rho, U, g, thermo, false) +{ + this->packingModel_.clear(); + this->dampingModel_.clear(); + this->isotropyModel_.clear(); + + if (this->solution().steadyState()) + { + FatalErrorInFunction + << "MPPIC modelling not available for steady state calculations" + << exit(FatalError); + } + + if (this->solution().active()) + { + this->setModels(); + + if (readFields) + { + parcelType::readFields(*this); + } + } +} + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::ThermoMPPICCloud::~ThermoMPPICCloud() +{} + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/clouds/Templates/ThermoMPPICCloud/ThermoMPPICCloud.H b/src/lagrangian/intermediate/clouds/Templates/ThermoMPPICCloud/ThermoMPPICCloud.H new file mode 100644 index 000000000..8ffdfa461 --- /dev/null +++ b/src/lagrangian/intermediate/clouds/Templates/ThermoMPPICCloud/ThermoMPPICCloud.H @@ -0,0 +1,135 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013-2016 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::ThermoMPPICCloud + +Description + Adds MPPIC modelling to kinematic clouds + +SourceFiles + ThermoMPPICCloudI.H + ThermoMPPICCloud.C + +\*---------------------------------------------------------------------------*/ + +#ifndef ThermoMPPICCloud_H +#define ThermoMPPICCloud_H + +#include "particle.H" +#include "Cloud.H" +#include "IOdictionary.H" +#include "autoPtr.H" +#include "fvMesh.H" +#include "volFields.H" +#include "SLGThermo.H" +#include "MPPICCloud.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of classes + +template +class PackingModel; + +template +class DampingModel; + +template +class IsotropyModel; + +/*---------------------------------------------------------------------------*\ + Class ThermoMPPICCloud Declaration +\*---------------------------------------------------------------------------*/ + +template +class ThermoMPPICCloud +: + public MPPICCloud +{ +public: + + // Public typedefs + + //- Type of cloud this cloud was instantiated for + typedef CloudType cloudType; + + //- Type of parcel the cloud was instantiated for + typedef typename CloudType::parcelType parcelType; + + //- Convenience typedef for this cloud type + typedef ThermoMPPICCloud ThermoMPPICCloudType; + + +private: + + // Private Member Functions + + //- Disallow default bitwise copy construct + ThermoMPPICCloud(const ThermoMPPICCloud&); + + //- Disallow default bitwise assignment + void operator=(const ThermoMPPICCloud&); + + +public: + + // Constructors + + //- Construct given carrier gas fields + ThermoMPPICCloud + ( + const word& cloudName, + const volScalarField& rho, + const volVectorField& U, + const dimensionedVector& g, + const SLGThermo& thermo, + bool readFields = true + ); + + + //- Destructor + virtual ~ThermoMPPICCloud(); + + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "ThermoMPPICCloud.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/clouds/derived/basicThermoKinematicMPPICCloud/basicThermoKinematicMPPICCloud.H b/src/lagrangian/intermediate/clouds/derived/basicThermoKinematicMPPICCloud/basicThermoKinematicMPPICCloud.H index dbf6b7c0a..28c021191 100644 --- a/src/lagrangian/intermediate/clouds/derived/basicThermoKinematicMPPICCloud/basicThermoKinematicMPPICCloud.H +++ b/src/lagrangian/intermediate/clouds/derived/basicThermoKinematicMPPICCloud/basicThermoKinematicMPPICCloud.H @@ -34,16 +34,16 @@ Description #include "Cloud.H" #include "KinematicCloud.H" -#include "MPPICCloud.H" +#include "ThermoCloud.H" +#include "ThermoMPPICCloud.H" #include "basicThermoKinematicMPPICParcel.H" -#include "ThermoCloud.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - typedef MPPICCloud + typedef ThermoMPPICCloud < ThermoCloud <