Files
phasicFlow/src/Particles/Insertion/insertionRegion/insertionRegion.hpp

173 lines
4.2 KiB
C++
Raw Normal View History

2022-09-05 01:56:29 +04:30
/*------------------------------- phasicFlow ---------------------------------
O C enter of
O O E ngineering and
O O M ultiscale modeling of
OOOOOOO F luid flow
------------------------------------------------------------------------------
Copyright (C): www.cemf.ir
email: hamid.r.norouzi AT gmail.com
------------------------------------------------------------------------------
Licence:
This file is part of phasicFlow code. It is a free software for simulating
granular and multiphase flows. You can redistribute it and/or modify it under
the terms of GNU General Public License v3 or any other later versions.
phasicFlow is distributed to help others in their research in the field of
granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-----------------------------------------------------------------------------*/
2022-12-10 01:32:54 +03:30
#ifndef __insertionRegion_hpp__
#define __insertionRegion_hpp__
2022-09-05 01:56:29 +04:30
2022-12-10 01:32:54 +03:30
#include "timeFlowControl.hpp"
#include "shapeMixture.hpp"
#include "peakableRegions.hpp"
#include "setFieldList.hpp"
2022-09-05 01:56:29 +04:30
namespace pFlow
{
class dictionary;
2023-06-07 05:40:43 -07:00
/**
* This class defines all the necessary enteties for defining an insertion
* region.
*
* Insertion region information are supplied through a dictionary in a file.
* For example:
\verbatim
{
type cylinderRegion; // type of insertion region
rate 15000; // insertion rate (particles/s)
startTime 0; // (s)
endTime 0.5; // (s)
interval 0.025; // (s)
cylinderRegionInfo
{
radius 0.09; // radius of cylinder (m)
p1 (0.0 0.0 0.10); // (m,m,m)
p2 (0.0 0.0 0.11); // (m,m,m)
}
setFields
{
velocity realx3 (0.0 0.0 -0.6); // initial velocity of inserted particles
}
mixture
{
lightSphere 1; // mixture composition of inserted particles
}
} \endverbatim
*
* More information on the above dictionary entries can be found in
* the table below.
*
*
* | Parameter | Type | Description | Optional [default value] |
* |----| :---: | ---- | ---- |
* | type | word | type of the insertion region with name ### | No |
* | rate | real | rate of insertion (particle/s) | No |
* | startTime | real | start of insertion (s) | No |
* | endTime | real | end of insertion (s) | No |
* | interval | real | time interval between successive insertions (s) | No |
* | ###Info | dictionary | data for insertion region | No |
* | setFields | dictionary | set field for inserted particles (s) | Yes [empty dictionray] |
* | mixture | dictionary | mixture of particles to be inserted (s) | No |
*
*/
2022-09-05 01:56:29 +04:30
class insertionRegion
:
public timeFlowControl
{
protected:
2023-06-07 05:40:43 -07:00
/// name of the region
2022-09-05 01:56:29 +04:30
word name_;
2023-06-07 05:40:43 -07:00
/// type of insertion region
2022-09-05 01:56:29 +04:30
word type_;
2023-06-07 05:40:43 -07:00
/// peakable region of points
2022-09-05 01:56:29 +04:30
uniquePtr<peakableRegion> pRegion_ = nullptr;
2023-06-07 05:40:43 -07:00
/// mixture of shapes
2022-09-05 01:56:29 +04:30
uniquePtr<shapeMixture> mixture_ = nullptr;
2023-06-07 05:40:43 -07:00
/// setFields for insertion region
2022-09-05 01:56:29 +04:30
uniquePtr<setFieldList> setFields_ = nullptr;
2023-06-07 05:40:43 -07:00
/// read from dictionary
2022-09-05 01:56:29 +04:30
bool readInsertionRegion(const dictionary& dict);
2023-06-07 05:40:43 -07:00
/// write to dictionary
2022-09-05 01:56:29 +04:30
bool writeInsertionRegion(dictionary& dict) const;
public:
2023-06-07 05:40:43 -07:00
/// Type info
2022-12-10 01:32:54 +03:30
TypeInfoNV("insertionRegion");
2022-09-05 01:56:29 +04:30
2023-06-07 05:40:43 -07:00
// - Constructors
2022-09-05 01:56:29 +04:30
2023-06-07 05:40:43 -07:00
/// Construct from a dictionary
2022-09-05 01:56:29 +04:30
insertionRegion(const dictionary& dict);
2023-06-07 05:40:43 -07:00
/// Copy
2022-09-05 01:56:29 +04:30
insertionRegion(const insertionRegion& src);
2023-06-07 05:40:43 -07:00
/// Move
2022-09-05 01:56:29 +04:30
insertionRegion(insertionRegion&&) = default;
2023-06-07 05:40:43 -07:00
/// Copy assignment
2022-09-05 01:56:29 +04:30
insertionRegion& operator=(const insertionRegion&);
2023-06-07 05:40:43 -07:00
/// Move assignment
2022-09-05 01:56:29 +04:30
insertionRegion& operator=(insertionRegion&&) = default;
2023-06-07 05:40:43 -07:00
/// Destructor
2022-09-05 01:56:29 +04:30
~insertionRegion() = default;
2023-06-07 05:40:43 -07:00
// - Methods
/// Const ref to setFields
2022-09-05 01:56:29 +04:30
const auto& setFields()const
{
return setFields_();
}
2023-06-07 05:40:43 -07:00
/// Const ref to name of the region
2022-09-05 01:56:29 +04:30
const auto& name()const
{
return name_;
}
2023-06-07 05:40:43 -07:00
// - IO operation
2022-09-05 01:56:29 +04:30
2023-06-07 05:40:43 -07:00
/// read from dictionary
2022-09-05 01:56:29 +04:30
bool read(const dictionary& dict)
{
if(!timeFlowControl::read(dict))return false;
return readInsertionRegion(dict);
}
2023-06-07 05:40:43 -07:00
/// write to dictionary
2022-09-05 01:56:29 +04:30
bool write(dictionary& dict)const
{
if(!timeFlowControl::write(dict)) return false;
return writeInsertionRegion(dict);
}
};
} //pFlow
2022-12-10 01:32:54 +03:30
#endif //__insertionRegion_hpp__