diff --git a/src/postProcessing/functionObjects/lagrangian/icoUncoupledKinematicCloud/icoUncoupledKinematicCloud.C b/src/postProcessing/functionObjects/lagrangian/icoUncoupledKinematicCloud/icoUncoupledKinematicCloud.C new file mode 100644 index 0000000000..d0f3f2fc9c --- /dev/null +++ b/src/postProcessing/functionObjects/lagrangian/icoUncoupledKinematicCloud/icoUncoupledKinematicCloud.C @@ -0,0 +1,148 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 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 "icoUncoupledKinematicCloud.H" +#include "singlePhaseTransportModel.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace functionObjects +{ + defineTypeNameAndDebug(icoUncoupledKinematicCloud, 0); + addToRunTimeSelectionTable + ( + functionObject, + icoUncoupledKinematicCloud, + dictionary + ); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::functionObjects::icoUncoupledKinematicCloud::icoUncoupledKinematicCloud +( + const word& name, + const Time& runTime, + const dictionary& dict +) +: + fvMeshFunctionObject(name, runTime, dict), + g_ + ( + IOobject + ( + "g", + time_.constant(), + mesh_, + IOobject::READ_IF_PRESENT, + IOobject::NO_WRITE + ), + dimensionedVector("g", dimAcceleration, Zero) + ), + laminarTransport_ + ( + mesh_.lookupObject("transportProperties") + ), + rhoValue_ + ( + "rho", + dimDensity, + laminarTransport_ + ), + rho_ + ( + IOobject + ( + "rho", + time_.timeName(), + mesh_ + ), + mesh_, + rhoValue_ + ), + mu_("mu", rhoValue_*laminarTransport_.nu()), + U_ + ( + mesh_.lookupObject(dict.lookupOrDefault("U", "U")) + ), + kinematicCloudName_ + ( + dict.lookupOrDefault("kinematicCloud", "kinematicCloud") + ), + kinematicCloud_ + ( + kinematicCloudName_, + rho_, + U_, + mu_, + g_ + ) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::functionObjects::icoUncoupledKinematicCloud::~icoUncoupledKinematicCloud() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +bool Foam::functionObjects::icoUncoupledKinematicCloud::read +( + const dictionary& dict +) +{ + return true; +} + + +bool Foam::functionObjects::icoUncoupledKinematicCloud::execute +( + const bool postProcess +) +{ + mu_ = rhoValue_*laminarTransport_.nu(); + kinematicCloud_.evolve(); + + return true; +} + + +bool Foam::functionObjects::icoUncoupledKinematicCloud::write +( + const bool postProcess +) +{ + return true; +} + + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/lagrangian/icoUncoupledKinematicCloud/icoUncoupledKinematicCloud.H b/src/postProcessing/functionObjects/lagrangian/icoUncoupledKinematicCloud/icoUncoupledKinematicCloud.H new file mode 100644 index 0000000000..03311a015d --- /dev/null +++ b/src/postProcessing/functionObjects/lagrangian/icoUncoupledKinematicCloud/icoUncoupledKinematicCloud.H @@ -0,0 +1,177 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 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::functionObjects::icoUncoupledKinematicCloud + +Group + grpLagrangianFunctionObjects + +Description + This Foam::functionObject tracks a uncoupled kinematic particle cloud in the + specified velocity field of an incompressible flow (laminar, RANS or LES). + + It may be used in conjunction with any transient single-phase incompressible + flow solver such as \c pisoFoam or \c pimpleFoam and tracks the particles or + parcels without affecting the the flow-field. + + The \c kinematicCloud requires the the density of the fluid which is + looked-up from \c constant/transportProperties dictionary and the + acceleration due to gravity which is read from the \c constant/g file if + present or defaults to zero. + + The \c kinematicCloud properties are read from the \c + constant/kinematicCloudProperties dictionary in the usual manner. + + Example of function object specification: + \verbatim + tracks + { + libs ("liblagrangianFunctionObjects.so"); + type icoUncoupledKinematicCloud; + } + \endverbatim + + \heading Function object usage + \table + Property | Description | Required | Default value + type | Type name: icoUncoupledKinematicCloud | yes | + U | Name of the velocity field | no | U + kinematicCloud | Name of the kinematicCloud | no | kinematicCloud + \endtable + +SeeAlso + Foam::functionObjects::fvMeshFunctionObject + +SourceFiles + icoUncoupledKinematicCloud.C + +\*---------------------------------------------------------------------------*/ + +#ifndef functionObjects_icoUncoupledKinematicCloud_H +#define functionObjects_icoUncoupledKinematicCloud_H + +#include "fvMeshFunctionObject.H" +#include "basicKinematicCollidingCloud.H" +#include "volFields.H" +#include "uniformDimensionedFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +class singlePhaseTransportModel; + +namespace functionObjects +{ + +/*---------------------------------------------------------------------------*\ + Class icoUncoupledKinematicCloud Declaration +\*---------------------------------------------------------------------------*/ + +class icoUncoupledKinematicCloud +: + public fvMeshFunctionObject +{ + // Private member data + + //- Optional acceleration due to gravity + uniformDimensionedVectorField g_; + + //- Reference to the laminar transport model + const singlePhaseTransportModel& laminarTransport_; + + //- Uniform density value + dimensionedScalar rhoValue_; + + //- Density field needed to construct kinematicCloud + volScalarField rho_; + + //- Dynamic viscosity field needed to construct kinematicCloud + volScalarField mu_; + + //- Reference to the velocity field + const volVectorField& U_; + + //- Name of the cloud + word kinematicCloudName_; + + //- The kinematic cloud + basicKinematicCollidingCloud kinematicCloud_; + + + // Private member functions + + //- Disallow default bitwise copy construct + icoUncoupledKinematicCloud(const icoUncoupledKinematicCloud&); + + //- Disallow default bitwise assignment + void operator==(const icoUncoupledKinematicCloud&); + + +public: + + //- Runtime type information + TypeName("icoUncoupledKinematicCloud"); + + + // Constructors + + //- Construct for given objectRegistry and dictionary. + // Allow the possibility to load fields from files + icoUncoupledKinematicCloud + ( + const word& name, + const Time& runTime, + const dictionary& dict + ); + + + //- Destructor + virtual ~icoUncoupledKinematicCloud(); + + + // Member Functions + + //- Read the controls + virtual bool read(const dictionary&); + + //- Track the cloud + virtual bool execute(const bool postProcess = false); + + //- Write the cloud + virtual bool write(const bool postProcess = false); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace functionObjects +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* //