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

132 lines
2.7 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
2022-09-05 01:56:29 +04:30
------------------------------------------------------------------------------
Copyright (C): www.cemf.ir
email: hamid.r.norouzi AT gmail.com
------------------------------------------------------------------------------
2022-09-05 01:56:29 +04:30
Licence:
This file is part of phasicFlow code. It is a free software for simulating
2022-09-05 01:56:29 +04:30
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
2022-09-05 01:56:29 +04:30
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 __insertion_hpp__
#define __insertion_hpp__
2022-09-05 01:56:29 +04:30
#include "fileDictionary.hpp"
2022-09-05 01:56:29 +04:30
namespace pFlow
{
2023-06-07 05:40:43 -07:00
// forward
2022-09-05 01:56:29 +04:30
class particles;
class pointStructure;
2022-09-05 01:56:29 +04:30
2023-06-07 05:40:43 -07:00
/**
* Base class for particle insertion
*/
class insertion
:
public fileDictionary
2022-09-05 01:56:29 +04:30
{
private:
/// Is insertion active
Logical active_ = "No";
2022-09-05 01:56:29 +04:30
2023-06-07 05:40:43 -07:00
/// Check for collision? It is not active now
Logical checkForCollision_ = "Yes";
/// if increase velocity in case particles are failed
/// to be inserted due to collision
Logical increaseVelocity_ = "No";
2022-09-05 01:56:29 +04:30
word diameterName_ = "diameter";
word velocityName_ = "velocity";
/// Ref to particles
particles& particles_;
bool readFromFile_ = false;
2022-09-05 01:56:29 +04:30
2023-06-07 05:40:43 -07:00
/// Read from dictionary
bool readInsertionDict();
protected:
2022-09-05 01:56:29 +04:30
2023-06-07 05:40:43 -07:00
/// Write to dictionary
virtual bool writeInsertionDict(dictionary& dict)const;
2022-09-05 01:56:29 +04:30
public:
2023-06-07 05:40:43 -07:00
/// Type info
2022-12-10 01:32:54 +03:30
TypeInfo("insertion");
2022-09-05 01:56:29 +04:30
2023-06-07 05:40:43 -07:00
/// Construct from component
explicit insertion(particles& prtcl);
2022-09-05 01:56:29 +04:30
/// Destructor
~insertion() override = default;
2022-09-05 01:56:29 +04:30
/// is Insertion active
inline bool isActive() const
{
return readFromFile_ && active_();
2022-09-05 01:56:29 +04:30
}
inline bool checkForCollision() const
{
return checkForCollision_();
}
2022-09-05 01:56:29 +04:30
inline particles& Particles()
{
return particles_;
}
inline const particles& Particles() const
{
return particles_;
}
const pointStructure& pStruct()const;
inline bool readFromFile() const
{
return readFromFile_;
}
2022-09-05 01:56:29 +04:30
const word& diameterName()const
{
return diameterName_;
}
const word& velocityName()const
{
return velocityName_;
}
/// read from stream
//bool read(iIstream& is, const IOPattern& iop) override;
2022-09-05 01:56:29 +04:30
/*/// read from iIstream
virtual bool read(iIstream& is) = 0;*/
using fileDictionary::write;
/// write to iOstream
bool write(iOstream& os, const IOPattern& iop)const override ;
2022-09-05 01:56:29 +04:30
};
2022-09-05 01:56:29 +04:30
}
#endif