Interaction folder is finalized with adjustable box and tested for rotating drum

This commit is contained in:
Hamidreza Norouzi
2024-03-24 01:46:19 -07:00
parent be56d8ee2e
commit d21b7276e1
48 changed files with 2252 additions and 3260 deletions

View File

@ -1,59 +0,0 @@
/*------------------------------- 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.
-----------------------------------------------------------------------------*/
#ifndef __demInteraction_hpp__
#define __demInteraction_hpp__
#include "property.hpp"
#include "demComponent.hpp"
#include "pointFields.hpp"
#include "triSurfaceFields.hpp"
namespace pFlow
{
class demInteraction
:
public property,
public demComponent
{
protected:
public:
demInteraction(systemControl& control)
:
property(),
demComponent("interaction", control)
{}
demInteraction(systemControl& control, const fileSystem& file)
:
property(file),
demComponent("interaction", control)
{}
};
}
#endif //__interaction_hpp__

View File

@ -19,7 +19,9 @@ Licence:
-----------------------------------------------------------------------------*/
#include "interaction.hpp"
#include "particles.hpp"
#include "vocabs.hpp"
#include "geometry.hpp"
pFlow::interaction::interaction
(
@ -28,26 +30,16 @@ pFlow::interaction::interaction
const geometry& geom
)
:
demInteraction(control, control.caseSetup().path()+interactionFile__),
interactionBase(prtcl, geom),
fileDict_(control.caseSetup().emplaceObject<dictionary>(
objectFile(
interactionFile__,
"",
objectFile::READ_ALWAYS,
objectFile::WRITE_NEVER),
interactionFile__,
true ))
property(interactionFile__, &control.caseSetup()),
observer
(
&prtcl.dynPointStruct(),
msg_
),
demComponent("interaction", control),
particles_(prtcl),
geometry_(geom)
{
this->subscribe(prtcl.pStruct());
contactSearch_ = contactSearch::create(
fileDict_.subDict("contactSearch"),
this->control().domain(),
prtcl,
geom,
timers()
);
}
@ -79,14 +71,14 @@ pFlow::uniquePtr<pFlow::interaction> pFlow::interaction::create
clType);
REPORT(1)<< "Selecting interaction model..."<<endREPORT;
REPORT(1)<< "Selecting interaction model..."<<END_REPORT;
if( systemControlvCtorSelector_.search(interactionModel) )
{
auto objPtr =
systemControlvCtorSelector_[interactionModel]
(control, prtcl, geom);
REPORT(2)<<"Model "<<greenText(interactionModel)<<" is created."<<endREPORT;
REPORT(2)<<"Model "<<Green_Text(interactionModel)<<" is created."<<END_REPORT;
return objPtr;
}
else

View File

@ -21,9 +21,10 @@ Licence:
#ifndef __interaction_hpp__
#define __interaction_hpp__
#include "demInteraction.hpp"
#include "eventObserver.hpp"
#include "interactionBase.hpp"
#include "demComponent.hpp"
#include "property.hpp"
#include "observer.hpp"
#include "systemControl.hpp"
#include "contactSearch.hpp"
@ -31,27 +32,26 @@ Licence:
namespace pFlow
{
class particles;
class geometry;
class interaction
:
public demInteraction,
public eventObserver,
public interactionBase
{
public:
public property,
public observer,
public demComponent
using IdType = typename interactionBase::IdType;
{
private:
using IndexType = typename interactionBase::IndexType;
/// reference to particles object
const particles& particles_;
using ExecutionSpace = typename interactionBase::ExecutionSpace;
/// reference to geometry object
const geometry& geometry_;
protected:
/// interaction file dictionary
dictionary& fileDict_;
/// contact search object for pp and pw interactions
uniquePtr<contactSearch> contactSearch_ = nullptr;
static inline
const message msg_ = message::ITEM_REARRANGE;
public:
@ -65,11 +65,10 @@ public:
const particles& prtcl,
const geometry& geom );
~interaction() override = default;
virtual ~interaction() = default;
create_vCtor(
create_vCtor
(
interaction,
systemControl,
(
@ -78,22 +77,8 @@ public:
const geometry& geom
),
(control, prtcl, geom)
);
);
auto& contactSearchPtr()
{
return contactSearch_;
}
auto& contactSearchRef()
{
return contactSearch_();
}
const auto& fileDict()const
{
return fileDict_;
}
static
uniquePtr<interaction> create(

View File

@ -1,84 +0,0 @@
/*------------------------------- 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.
-----------------------------------------------------------------------------*/
#ifndef __interactionBase_hpp__
#define __interactionBase_hpp__
#include "interactionTypes.hpp"
#include "particles.hpp"
#include "geometry.hpp"
namespace pFlow
{
class interactionBase
{
public:
using IndexType = CELL_INDEX_TYPE;
using IdType = ID_TYPE;
using ExecutionSpace = DefaultExecutionSpace;
protected:
const particles& particles_;
const geometry& geometry_;
public:
interactionBase(
const particles& prtcl,
const geometry& geom)
:
particles_(prtcl),
geometry_(geom)
{}
inline
const auto& pStruct()const
{
return particles_.pStruct();
}
inline
const auto& surface()const
{
return geometry_.surface();
}
inline
const auto& Particles()const
{
return particles_;
}
inline auto& Geometry()const
{
return geometry_;
}
};
}
#endif //__interactionBase_hpp__

View File

@ -1,45 +0,0 @@
/*------------------------------- 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.
-----------------------------------------------------------------------------*/
#ifndef __interactionTypes_hpp__
#define __interactionTypes_hpp__
#include "types.hpp"
namespace pFlow
{
// always use signed types
using CELL_INDEX_TYPE = int32;
using ID_TYPE = int32;
//constexpr int32 minCellIndex = largestNegative<CELL_INDEX_TYPE>();
//constexpr int32 maxCellIndex = largestPositive<CELL_INDEX_TYPE>();
}
#endif //__interactionTypes_hpp__