# PhasicFlow: src/Interaction/Models/rolling/normalRolling.hpp Source File
PhasicFlow is an open-source parallel DEM (discrete element method) package for simulating granular flow. It is developed in C++ and can be exectued on both GPU (like CUDA) and CPU.

normalRolling.hpp
Go to the documentation of this file.
/*------------------------------- 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 __normalRolling_hpp__
#define __normalRolling_hpp__
namespace pFlow::cfModels
{
template<typename contactForceModel>
class normalRolling
:
public contactForceModel
{
public:
using contactForceStorage =
typename contactForceModel::contactForceStorage;
realSymArray_D mur_;
bool readNormalDict(const dictionary& dict)
{
auto mur = dict.getVal<realVector>("mur");
uint32 nMat;
if(!realSymArray_D::getN(mur.size(),nMat) || nMat != this->numMaterial())
{
fatalErrorInFunction<<
"wrong number of values supplied in mur. \n";
return false;
}
mur_.assign(mur);
return true;
}
public:
TypeInfoNV(word("normal<"+contactForceModel::TYPENAME()+">"));
normalRolling(int32 nMaterial, const ViewType1D<real>& rho, const dictionary& dict)
:
contactForceModel(nMaterial, rho, dict),
mur_("mur", nMaterial)
{
if(!readNormalDict(dict))
{
fatalExit;
}
}
INLINE_FUNCTION_HD
void rollingFriction
(
const real dt,
const uint32 i,
const uint32 j,
const uint32 propId_i,
const uint32 propId_j,
const real Ri,
const real Rj,
const realx3& wi,
const realx3& wj,
const realx3& Nij,
const realx3& FCn,
realx3& Mri,
realx3& Mrj
)const
{
realx3 w_hat = wi-wj;
real w_hat_mag = length(w_hat);
if( !equal(w_hat_mag,0.0) )
w_hat /= w_hat_mag;
else
w_hat = 0.0;
auto Reff = (Ri*Rj)/(Ri+Rj);
Mri = ( -mur_(propId_i,propId_j) *length(FCn) * Reff ) * w_hat ;
//removing the normal part
// Mri = Mri - ( (Mri .dot. nij)*nij )
Mrj = -Mri;
}
};
}
#endif
pFlow::cfModels::normalRolling::rollingFriction
INLINE_FUNCTION_HD void rollingFriction(const real dt, const uint32 i, const uint32 j, const uint32 propId_i, const uint32 propId_j, const real Ri, const real Rj, const realx3 &wi, const realx3 &wj, const realx3 &Nij, const realx3 &FCn, realx3 &Mri, realx3 &Mrj) const
Definition: normalRolling.hpp:77
pFlow::real
float real
Definition: builtinTypes.hpp:45
fatalExit
#define fatalExit
Fatal exit.
Definition: error.hpp:98
pFlow::equal
INLINE_FUNCTION_HD bool equal(const box &b1, const box &b2, real tol=smallValue)
Definition: box.hpp:135
pFlow::uint32
unsigned int uint32
Definition: builtinTypes.hpp:56
pFlow::word
std::string word
Definition: builtinTypes.hpp:64
pFlow::symArray< real >::getN
static bool getN(uint32 nElem, uint32 &n)
Definition: symArrayHD.hpp:238
pFlow::symArray::assign
bool assign(const Vector< T > src)
Definition: symArrayHD.hpp:175
pFlow::cfModels::normalRolling::TypeInfoNV
TypeInfoNV(word("normal<"+contactForceModel::TYPENAME()+">"))
pFlow::cfModels::normalRolling::contactForceStorage
typename contactForceModel::contactForceStorage contactForceStorage
Definition: normalRolling.hpp:36
fatalErrorInFunction
#define fatalErrorInFunction
Report a fatal error and function name and exit the application.
Definition: error.hpp:77
length
INLINE_FUNCTION_HD T length(const triple< T > &v1)
pFlow::int32
int int32
Definition: builtinTypes.hpp:50
pFlow::ViewType1D
Kokkos::View< T *, properties... > ViewType1D
1D veiw as a vector
Definition: KokkosTypes.hpp:93
pFlow::dictionary::getVal
T getVal(const word &keyword) const
get the value of data entry
Definition: dictionary.hpp:379
pFlow::cfModels::normalRolling::mur_
realSymArray_D mur_
Definition: normalRolling.hpp:39
pFlow::cfModels::normalRolling::readNormalDict
bool readNormalDict(const dictionary &dict)
Definition: normalRolling.hpp:41
pFlow::cfModels
Definition: cGAbsoluteLinearCF.hpp:34
INLINE_FUNCTION_HD
#define INLINE_FUNCTION_HD
Definition: pFlowMacros.hpp:55
pFlow::triple< real >
pFlow::Vector< real >
pFlow::symArray< real >
pFlow::cfModels::normalRolling::normalRolling
normalRolling(int32 nMaterial, const ViewType1D< real > &rho, const dictionary &dict)
Definition: normalRolling.hpp:64
pFlow::cfModels::normalRolling
Definition: normalRolling.hpp:29
pFlow::dictionary
Dictionary holds a set of data entries or sub-dictionaries that are enclosed in a curely braces or ar...
Definition: dictionary.hpp:67