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 __geometry_hpp__
|
|
|
|
#define __geometry_hpp__
|
2022-09-05 01:56:29 +04:30
|
|
|
|
|
|
|
|
2022-12-10 01:32:54 +03:30
|
|
|
#include "virtualConstructor.hpp"
|
2024-02-05 21:27:24 -08:00
|
|
|
#include "demComponent.hpp"
|
2022-12-10 01:32:54 +03:30
|
|
|
#include "property.hpp"
|
|
|
|
#include "multiTriSurface.hpp"
|
|
|
|
#include "triSurfaceFields.hpp"
|
2024-02-05 21:27:24 -08:00
|
|
|
//#include "Fields.hpp"
|
|
|
|
//#include "Vectors.hpp"
|
|
|
|
|
|
|
|
|
2022-09-05 01:56:29 +04:30
|
|
|
|
|
|
|
namespace pFlow
|
|
|
|
{
|
|
|
|
|
2023-04-13 11:42:41 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Base class for geometry for managing tri-surfaces, geometry motion,
|
|
|
|
* and surface physical properties.
|
|
|
|
*
|
|
|
|
*/
|
2022-09-05 01:56:29 +04:30
|
|
|
class geometry
|
|
|
|
:
|
2024-02-05 21:27:24 -08:00
|
|
|
public multiTriSurface,
|
|
|
|
public demComponent
|
2022-09-05 01:56:29 +04:30
|
|
|
{
|
2024-02-05 21:27:24 -08:00
|
|
|
private:
|
2022-09-05 01:56:29 +04:30
|
|
|
|
2023-04-13 11:42:41 -07:00
|
|
|
// - Protected members
|
|
|
|
|
|
|
|
/// Const reference to physical property of materials
|
|
|
|
const property& wallProperty_;
|
2022-09-05 01:56:29 +04:30
|
|
|
|
2023-04-13 11:42:41 -07:00
|
|
|
/// The name of motion component of each wall surface
|
2024-02-05 21:27:24 -08:00
|
|
|
wordField_H motionComponentName_;
|
2022-09-05 01:56:29 +04:30
|
|
|
|
2023-04-13 11:42:41 -07:00
|
|
|
/// Material name of each wall surface
|
2024-02-05 21:27:24 -08:00
|
|
|
wordField_H materialName_;
|
2022-09-05 01:56:29 +04:30
|
|
|
|
2023-04-13 11:42:41 -07:00
|
|
|
/// Property id of each triangle in the set of wall surfaces
|
2024-02-05 21:27:24 -08:00
|
|
|
uint32TriSurfaceField_D propertyId_;
|
2022-09-05 01:56:29 +04:30
|
|
|
|
2023-04-13 11:42:41 -07:00
|
|
|
/// Contact force on each triangle in the set of wall surfaces
|
2024-02-05 21:27:24 -08:00
|
|
|
realx3TriSurfaceField_D contactForceWall_;
|
2022-09-05 01:56:29 +04:30
|
|
|
|
2024-02-05 21:27:24 -08:00
|
|
|
/// Stress on each triangle in the set of wall surfaces
|
|
|
|
realx3TriSurfaceField_D normalStressWall_;
|
|
|
|
|
|
|
|
/// Stress on each triangle in the set of wall surfaces
|
|
|
|
realx3TriSurfaceField_D shearStressWall_;
|
|
|
|
|
|
|
|
|
|
|
|
bool readWholeObject_ = true;
|
2022-09-05 01:56:29 +04:30
|
|
|
|
2023-04-13 11:42:41 -07:00
|
|
|
// - Protected member functions
|
|
|
|
|
|
|
|
/// Find property id of each triangle based on the supplied material name
|
|
|
|
/// and the surface wall that the triangle belongs to.
|
2024-02-05 21:27:24 -08:00
|
|
|
bool createPropertyId();
|
2022-09-05 01:56:29 +04:30
|
|
|
|
2023-04-13 11:42:41 -07:00
|
|
|
/// Initialize contact force to zero
|
2024-02-05 21:27:24 -08:00
|
|
|
/*void zeroForce()
|
2023-04-13 11:42:41 -07:00
|
|
|
{
|
|
|
|
contactForceWall_.fill(zero3);
|
2024-02-05 21:27:24 -08:00
|
|
|
}*/
|
2022-09-05 01:56:29 +04:30
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2023-04-13 11:42:41 -07:00
|
|
|
/// Type info
|
2022-12-10 01:32:54 +03:30
|
|
|
TypeInfo("geometry");
|
2022-09-05 01:56:29 +04:30
|
|
|
|
2023-04-13 11:42:41 -07:00
|
|
|
// - Constructors
|
2022-09-05 01:56:29 +04:30
|
|
|
|
2023-04-13 11:42:41 -07:00
|
|
|
/// Construct from controlSystem and property, for reading from file
|
2022-09-05 01:56:29 +04:30
|
|
|
geometry(systemControl& control, const property& prop);
|
|
|
|
|
2024-02-05 21:27:24 -08:00
|
|
|
geometry(systemControl& control,
|
|
|
|
const property& prop,
|
|
|
|
multiTriSurface& surf,
|
|
|
|
const wordVector& motionCompName,
|
|
|
|
const wordVector& materialName,
|
|
|
|
const dictionary& motionDict);
|
|
|
|
|
2023-04-13 11:42:41 -07:00
|
|
|
/// Construct from components
|
2024-02-05 21:27:24 -08:00
|
|
|
/*geometry(systemControl& control,
|
2022-09-05 01:56:29 +04:30
|
|
|
const property& prop,
|
|
|
|
const multiTriSurface& triSurface,
|
|
|
|
const wordVector& motionCompName,
|
|
|
|
const wordVector& propName
|
|
|
|
);
|
|
|
|
|
2023-04-13 11:42:41 -07:00
|
|
|
/// Construct from components and dictionary that contains
|
|
|
|
/// motionModel
|
2022-09-05 01:56:29 +04:30
|
|
|
geometry(systemControl& control,
|
|
|
|
const property& prop,
|
|
|
|
const dictionary& dict,
|
|
|
|
const multiTriSurface& triSurface,
|
|
|
|
const wordVector& motionCompName,
|
2024-02-05 21:27:24 -08:00
|
|
|
const wordVector& propName);*/
|
2022-09-05 01:56:29 +04:30
|
|
|
|
2023-04-13 11:42:41 -07:00
|
|
|
/// Destructor
|
2022-09-05 01:56:29 +04:30
|
|
|
virtual ~geometry() = default;
|
|
|
|
|
2023-04-13 11:42:41 -07:00
|
|
|
/// Virtual constructor
|
2024-02-05 21:27:24 -08:00
|
|
|
/*create_vCtor
|
2022-09-05 01:56:29 +04:30
|
|
|
(
|
|
|
|
geometry,
|
|
|
|
systemControl,
|
|
|
|
(
|
|
|
|
systemControl& control,
|
|
|
|
const property& prop
|
|
|
|
),
|
|
|
|
(control, prop)
|
2024-02-05 21:27:24 -08:00
|
|
|
);*/
|
2022-09-05 01:56:29 +04:30
|
|
|
|
2023-04-13 11:42:41 -07:00
|
|
|
/// Virtual constructor
|
2022-09-05 01:56:29 +04:30
|
|
|
create_vCtor
|
|
|
|
(
|
|
|
|
geometry,
|
|
|
|
dictionary,
|
2024-02-05 21:27:24 -08:00
|
|
|
(
|
|
|
|
systemControl& control,
|
|
|
|
const property& prop,
|
|
|
|
multiTriSurface& surf,
|
|
|
|
const wordVector& motionCompName,
|
|
|
|
const wordVector& materialName,
|
|
|
|
const dictionary& motionDic),
|
|
|
|
(control, prop, surf, motionCompName, materialName, motionDic)
|
2022-09-05 01:56:29 +04:30
|
|
|
);
|
|
|
|
|
2024-02-05 21:27:24 -08:00
|
|
|
//- Methods
|
2022-09-05 01:56:29 +04:30
|
|
|
|
2023-04-13 11:42:41 -07:00
|
|
|
/// Number of triangles in the set of surface walls
|
2022-09-05 01:56:29 +04:30
|
|
|
inline
|
|
|
|
auto numTriangles()const
|
|
|
|
{
|
|
|
|
return size();
|
|
|
|
}
|
|
|
|
|
2023-04-13 11:42:41 -07:00
|
|
|
/// Access to the points
|
2024-02-05 21:27:24 -08:00
|
|
|
/*inline
|
2022-09-05 01:56:29 +04:30
|
|
|
const auto& points()const
|
|
|
|
{
|
|
|
|
return triSurface_.points();
|
2024-02-05 21:27:24 -08:00
|
|
|
}*/
|
2022-09-05 01:56:29 +04:30
|
|
|
|
2023-04-13 11:42:41 -07:00
|
|
|
/// Access to the vertices
|
2024-02-05 21:27:24 -08:00
|
|
|
/*inline
|
2022-09-05 01:56:29 +04:30
|
|
|
const auto& vertices()const
|
|
|
|
{
|
|
|
|
return triSurface_.vertices();
|
2024-02-05 21:27:24 -08:00
|
|
|
}*/
|
2022-09-05 01:56:29 +04:30
|
|
|
|
2023-04-13 11:42:41 -07:00
|
|
|
/// Obtain an object for accessing triangles
|
2024-02-05 21:27:24 -08:00
|
|
|
/*inline auto getTriangleAccessor()const
|
2022-09-05 01:56:29 +04:30
|
|
|
{
|
|
|
|
return triSurface_.getTriangleAccessor();
|
2024-02-05 21:27:24 -08:00
|
|
|
}*/
|
2022-09-05 01:56:29 +04:30
|
|
|
|
2023-04-13 11:42:41 -07:00
|
|
|
/// Surface
|
2024-02-05 21:27:24 -08:00
|
|
|
inline
|
|
|
|
auto& surface()
|
2022-09-05 01:56:29 +04:30
|
|
|
{
|
2024-02-05 21:27:24 -08:00
|
|
|
return static_cast<multiTriSurface&>(*this);
|
2022-09-05 01:56:29 +04:30
|
|
|
}
|
|
|
|
|
2023-04-13 11:42:41 -07:00
|
|
|
/// Surface
|
2024-02-05 21:27:24 -08:00
|
|
|
inline
|
|
|
|
const auto& surface()const
|
2022-09-05 01:56:29 +04:30
|
|
|
{
|
2024-02-05 21:27:24 -08:00
|
|
|
return static_cast<const multiTriSurface&>(*this);
|
2022-09-05 01:56:29 +04:30
|
|
|
}
|
|
|
|
|
2024-02-05 21:27:24 -08:00
|
|
|
inline
|
|
|
|
const auto& motionComponentName()const
|
|
|
|
{
|
|
|
|
return motionComponentName_;
|
|
|
|
}
|
|
|
|
|
2023-04-13 11:42:41 -07:00
|
|
|
/// Access to contact force
|
2024-02-05 21:27:24 -08:00
|
|
|
/*inline
|
2022-09-05 01:56:29 +04:30
|
|
|
realx3TriSurfaceField_D& contactForceWall()
|
|
|
|
{
|
|
|
|
return contactForceWall_;
|
|
|
|
}
|
|
|
|
|
2023-04-13 11:42:41 -07:00
|
|
|
/// Access to contact force
|
2022-09-05 01:56:29 +04:30
|
|
|
inline
|
|
|
|
const realx3TriSurfaceField_D& contactForceWall() const
|
|
|
|
{
|
|
|
|
return contactForceWall_;
|
|
|
|
}
|
|
|
|
|
2023-04-13 11:42:41 -07:00
|
|
|
/// Access to property
|
2022-09-05 01:56:29 +04:30
|
|
|
inline const auto& wallProperty()const
|
|
|
|
{
|
|
|
|
return wallProperty_;
|
2024-02-05 21:27:24 -08:00
|
|
|
}*/
|
2022-09-05 01:56:29 +04:30
|
|
|
|
2023-04-13 11:42:41 -07:00
|
|
|
/// Owner repository
|
2024-02-05 21:27:24 -08:00
|
|
|
/*inline
|
2022-09-05 01:56:29 +04:30
|
|
|
const repository& owner()const
|
|
|
|
{
|
|
|
|
return geometryRepository_;
|
2024-02-05 21:27:24 -08:00
|
|
|
}*/
|
2022-09-05 01:56:29 +04:30
|
|
|
|
2023-04-13 11:42:41 -07:00
|
|
|
/// Owner repository
|
2024-02-05 21:27:24 -08:00
|
|
|
/*inline
|
2022-09-05 01:56:29 +04:30
|
|
|
repository& owner()
|
|
|
|
{
|
|
|
|
return geometryRepository_;
|
2024-02-05 21:27:24 -08:00
|
|
|
}*/
|
2022-09-05 01:56:29 +04:30
|
|
|
|
2023-04-13 11:42:41 -07:00
|
|
|
/// Path to the repository folder
|
2024-02-05 21:27:24 -08:00
|
|
|
/*inline auto path()
|
2022-09-05 01:56:29 +04:30
|
|
|
{
|
|
|
|
return owner().path();
|
2024-02-05 21:27:24 -08:00
|
|
|
}*/
|
2022-09-05 01:56:29 +04:30
|
|
|
|
2023-04-13 11:42:41 -07:00
|
|
|
/// The name of motion model
|
2024-02-05 21:27:24 -08:00
|
|
|
/*virtual
|
|
|
|
word motionModelTypeName()const = 0;*/
|
2022-09-05 01:56:29 +04:30
|
|
|
|
2023-04-13 11:42:41 -07:00
|
|
|
/// Motion model index of triangles
|
2024-02-05 21:27:24 -08:00
|
|
|
/*virtual
|
2022-09-05 01:56:29 +04:30
|
|
|
const int8Vector_HD& triMotionIndex() const =0;
|
|
|
|
|
2023-04-13 11:42:41 -07:00
|
|
|
/// Motion model index of points
|
2022-09-05 01:56:29 +04:30
|
|
|
virtual
|
|
|
|
const int8Vector_HD& pointMotionIndex()const = 0;
|
|
|
|
|
2023-04-13 11:42:41 -07:00
|
|
|
/// Property ide of triangles
|
2022-09-05 01:56:29 +04:30
|
|
|
const int8TriSurfaceField_D& propertyId() const
|
|
|
|
{
|
|
|
|
return propertyId_;
|
2024-02-05 21:27:24 -08:00
|
|
|
}*/
|
2022-09-05 01:56:29 +04:30
|
|
|
|
2023-04-13 11:42:41 -07:00
|
|
|
/// Operations before each iteration
|
2024-02-05 21:27:24 -08:00
|
|
|
//bool beforeIteration() override;
|
2022-09-05 01:56:29 +04:30
|
|
|
|
2023-04-13 11:42:41 -07:00
|
|
|
/// Operations after each iteration
|
2024-02-05 21:27:24 -08:00
|
|
|
//bool afterIteration() override;
|
2023-04-13 11:42:41 -07:00
|
|
|
|
2024-02-05 21:27:24 -08:00
|
|
|
|
|
|
|
bool beforeIteration() override
|
|
|
|
{
|
|
|
|
notImplementedFunction;
|
|
|
|
return true;
|
|
|
|
}
|
2022-09-05 01:56:29 +04:30
|
|
|
|
2024-02-05 21:27:24 -08:00
|
|
|
/// This is called in time loop. Perform the main calculations
|
|
|
|
/// when the component should evolve along time.
|
|
|
|
bool iterate() override
|
|
|
|
{
|
|
|
|
notImplementedFunction;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// This is called in time loop, after iterate.
|
|
|
|
bool afterIteration() override
|
2022-09-05 01:56:29 +04:30
|
|
|
{
|
2024-02-05 21:27:24 -08:00
|
|
|
notImplementedFunction;
|
|
|
|
return true;
|
2022-09-05 01:56:29 +04:30
|
|
|
}
|
|
|
|
|
2024-02-05 21:27:24 -08:00
|
|
|
//- IO
|
|
|
|
|
|
|
|
bool read(iIstream& is, const IOPattern& iop) override;
|
|
|
|
|
|
|
|
/// write
|
|
|
|
bool write( iOstream& os, const IOPattern& iop )const override;
|
|
|
|
|
|
|
|
|
2022-09-05 01:56:29 +04:30
|
|
|
|
2023-04-13 11:42:41 -07:00
|
|
|
//- Static members
|
2022-09-05 01:56:29 +04:30
|
|
|
|
2024-02-05 21:27:24 -08:00
|
|
|
/*static
|
|
|
|
uniquePtr<geometry> create(systemControl& control, const property& prop);*/
|
2022-09-05 01:56:29 +04:30
|
|
|
|
|
|
|
static
|
2023-04-13 11:42:41 -07:00
|
|
|
uniquePtr<geometry> create(
|
2024-02-05 21:27:24 -08:00
|
|
|
systemControl& control,
|
|
|
|
const property& prop,
|
|
|
|
multiTriSurface& surf,
|
|
|
|
const wordVector& motionCompName,
|
|
|
|
const wordVector& materialName,
|
|
|
|
const dictionary& motionDic);
|
2022-09-05 01:56:29 +04:30
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|