src folder

This commit is contained in:
hamidrezanorouzi
2022-09-05 01:56:29 +04:30
parent 9d177aba28
commit ac5c3f08af
97 changed files with 11707 additions and 13 deletions

View File

@ -0,0 +1,59 @@
/*------------------------------- 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_H__
#define __demInteraction_H__
#include "property.H"
#include "demComponent.H"
#include "pointFields.H"
#include "triSurfaceFields.H"
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_H__

View File

@ -0,0 +1,107 @@
/*------------------------------- 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.
-----------------------------------------------------------------------------*/
#include "interaction.H"
pFlow::interaction::interaction
(
systemControl& control,
const particles& prtcl,
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 ))
{
this->subscribe(prtcl.pStruct());
contactSearch_ = contactSearch::create(
fileDict_.subDict("contactSearch"),
this->control().domain(),
prtcl,
geom,
timers()
);
}
pFlow::uniquePtr<pFlow::interaction> pFlow::interaction::create
(
systemControl& control,
const particles& prtcl,
const geometry& geom
)
{
word shapeTypeName = prtcl.shapeTypeName();
word motionTypeName = geom.motionModelTypeName();
fileSystem file = control.caseSetup().path()+interactionFile__;
dictionary dict(interactionFile__, file);
auto interactionDict= dict.subDict("model");
word clType = dict.getVal<word>("contactListType");
word cfModel = interactionDict.getVal<word>("contactForceModel");
word rfModel = interactionDict.getVal<word>("rollingFrictionModel");
auto interactionModel = angleBracketsNames3(
shapeTypeName+"Interaction",
angleBracketsNames(rfModel,cfModel),
motionTypeName,
clType);
Report(1)<< "Selecting interaction model..."<<endReport;
if( systemControlvCtorSelector_.search(interactionModel) )
{
auto objPtr =
systemControlvCtorSelector_[interactionModel]
(control, prtcl, geom);
Report(2)<<"Model "<<greenText(interactionModel)<<" is created."<<endReport;
return objPtr;
}
else
{
printKeys
(
fatalError << "Ctor Selector "<<
interactionModel << " dose not exist. \n"
<<"Avaiable ones are: \n\n"
,
systemControlvCtorSelector_
);
fatalExit;
}
return nullptr;
}

View File

@ -0,0 +1,109 @@
/*------------------------------- 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 __interaction_H__
#define __interaction_H__
#include "demInteraction.H"
#include "eventObserver.H"
#include "interactionBase.H"
#include "contactSearch.H"
namespace pFlow
{
class interaction
:
public demInteraction,
public eventObserver,
public interactionBase
{
public:
using IdType = typename interactionBase::IdType;
using IndexType = typename interactionBase::IndexType;
using ExecutionSpace = typename interactionBase::ExecutionSpace;
protected:
/// interaction file dictionary
dictionary& fileDict_;
/// contact search object for pp and pw interactions
uniquePtr<contactSearch> contactSearch_ = nullptr;
public:
TypeName("interaction");
//// - constructors
interaction(
systemControl& control,
const particles& prtcl,
const geometry& geom );
virtual ~interaction() = default;
create_vCtor(
interaction,
systemControl,
(
systemControl& control,
const particles& prtcl,
const geometry& geom
),
(control, prtcl, geom)
);
auto& contactSearchPtr()
{
return contactSearch_;
}
auto& contactSearchRef()
{
return contactSearch_();
}
const auto& fileDict()const
{
return fileDict_;
}
static
uniquePtr<interaction> create(
systemControl& control,
const particles& prtcl,
const geometry& geom);
};
}
#endif //__interaction_H__

View File

@ -0,0 +1,84 @@
/*------------------------------- 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_H__
#define __interactionBase_H__
#include "interactionTypes.H"
#include "particles.H"
#include "geometry.H"
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_H__

View File

@ -0,0 +1,45 @@
/*------------------------------- 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_H__
#define __interactionTypes_H__
#include "types.H"
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_H__