Skip to content
Snippets Groups Projects
Commit a0fea418 authored by Andrew Heather's avatar Andrew Heather Committed by Kutalmış Berçin
Browse files

ENH: New FreezeParticles cloud function object

Sets the particle active flag to false to freeze the particle in space whilst
allowing it to evolve its physical models.
parent 1bce1e44
Branches
No related merge requests found
......@@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2018 OpenFOAM Foundation
Copyright (C) 2020-2023 OpenCFD Ltd.
Copyright (C) 2020-2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -33,6 +33,7 @@ License
#include "FaceInteraction.H"
#include "FacePostProcessing.H"
#include "FreezeParticles.H"
#include "ParticleCollector.H"
#include "ParticleErosion.H"
#include "ParticleTracks.H"
......@@ -56,6 +57,7 @@ License
\
makeCloudFunctionObjectType(FaceInteraction, CloudType); \
makeCloudFunctionObjectType(FacePostProcessing, CloudType); \
makeCloudFunctionObjectType(FreezeParticles, CloudType); \
makeCloudFunctionObjectType(ParticleCollector, CloudType); \
makeCloudFunctionObjectType(ParticleErosion, CloudType); \
makeCloudFunctionObjectType(ParticleTracks, CloudType); \
......
......@@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2018 OpenFOAM Foundation
Copyright (C) 2020-2023 OpenCFD Ltd.
Copyright (C) 2020-2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -33,6 +33,7 @@ License
#include "FaceInteraction.H"
#include "FacePostProcessing.H"
#include "FreezeParticles.H"
#include "ParticleCollector.H"
#include "ParticleErosion.H"
#include "ParticleTracks.H"
......@@ -58,6 +59,7 @@ License
\
makeCloudFunctionObjectType(FaceInteraction, CloudType); \
makeCloudFunctionObjectType(FacePostProcessing, CloudType); \
makeCloudFunctionObjectType(FreezeParticles, CloudType); \
makeCloudFunctionObjectType(ParticleCollector, CloudType); \
makeCloudFunctionObjectType(ParticleErosion, CloudType); \
makeCloudFunctionObjectType(ParticleTracks, CloudType); \
......
......@@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2021-2023 OpenCFD Ltd.
Copyright (C) 2021-2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -32,6 +32,7 @@ License
#include "FaceInteraction.H"
#include "FacePostProcessing.H"
#include "FreezeParticles.H"
#include "ParticleCollector.H"
#include "ParticleErosion.H"
#include "ParticleTracks.H"
......@@ -56,6 +57,7 @@ License
\
makeCloudFunctionObjectType(FaceInteraction, CloudType); \
makeCloudFunctionObjectType(FacePostProcessing, CloudType); \
makeCloudFunctionObjectType(FreezeParticles, CloudType); \
makeCloudFunctionObjectType(ParticleCollector, CloudType); \
makeCloudFunctionObjectType(ParticleErosion, CloudType); \
makeCloudFunctionObjectType(ParticleTracks, CloudType); \
......
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
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 "FreezeParticles.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class CloudType>
Foam::FreezeParticles<CloudType>::FreezeParticles
(
const dictionary& dict,
CloudType& owner,
const word& modelName
)
:
CloudFunctionObject<CloudType>(dict, owner, modelName, typeName)
{}
template<class CloudType>
Foam::FreezeParticles<CloudType>::FreezeParticles
(
const FreezeParticles<CloudType>& vf
)
:
CloudFunctionObject<CloudType>(vf)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
void Foam::FreezeParticles<CloudType>::preEvolve
(
const typename parcelType::trackingData& td
)
{
auto& c = this->owner();
forAllIters(c, particlePtr)
{
particlePtr->active(false);
}
}
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
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::FreezeParticles
Group
grpLagrangianIntermediateFunctionObjects
Description
Sets particle active flag to false to freeze particles in space
Usage
Minimal example by using \c constant/\<CloudProperties\>:
\verbatim
cloudFunctions
{
FreezeParticles
{
// Mandatory entries
type FreezeParticles;
}
}
\endverbatim
where the entries mean:
\table
Property | Description | Type | Reqd | Deflt
type | Type name: FreezeParticles | word | yes | -
\endtable
SourceFiles
FreezeParticles.C
\*---------------------------------------------------------------------------*/
#ifndef Foam_FreezeParticles_H
#define Foam_FreezeParticles_H
#include "CloudFunctionObject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class FreezeParticles Declaration
\*---------------------------------------------------------------------------*/
template<class CloudType>
class FreezeParticles
:
public CloudFunctionObject<CloudType>
{
// Private Member Functions
//- Write post-processing info
virtual void write()
{}
public:
typedef typename CloudType::parcelType parcelType;
//- Runtime type information
TypeName("FreezeParticles");
// Constructors
//- Construct from dictionary
FreezeParticles
(
const dictionary& dict,
CloudType& owner,
const word& modelName
);
//- Copy construct
FreezeParticles(const FreezeParticles<CloudType>& vf);
//- Construct and return a clone
virtual autoPtr<CloudFunctionObject<CloudType>> clone() const
{
return autoPtr<CloudFunctionObject<CloudType>>
(
new FreezeParticles<CloudType>(*this)
);
}
//- Destructor
virtual ~FreezeParticles() = default;
// Member Functions
//- Pre-evolve hook
virtual void preEvolve(const typename parcelType::trackingData& td);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "FreezeParticles.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment