mirror of
https://github.com/PhasicFlow/phasicFlow.git
synced 2025-06-22 16:28:30 +00:00
PostprocessData update
Modifications on fieldsDataBase to work both during simulation and post-simulation Some bug fixes and changes to the code based Correction for region volume
This commit is contained in:
@ -73,6 +73,18 @@ pFlow::grainShape::grainShape
|
||||
}
|
||||
}
|
||||
|
||||
pFlow::grainShape::grainShape
|
||||
(
|
||||
const word &shapeType,
|
||||
const word &fileName,
|
||||
repository *owner,
|
||||
const property &prop
|
||||
)
|
||||
:
|
||||
grainShape(fileName, owner, prop)
|
||||
{
|
||||
}
|
||||
|
||||
pFlow::real pFlow::grainShape::maxBoundingSphere() const
|
||||
{
|
||||
return max(grainDiameters_);
|
||||
@ -99,9 +111,12 @@ pFlow::real pFlow::grainShape::boundingDiameter(uint32 index) const
|
||||
{
|
||||
return grainDiameters_[index];
|
||||
}
|
||||
fatalErrorInFunction<<"Invalid index for diameter "<<
|
||||
index<<endl;
|
||||
|
||||
fatalErrorInFunction
|
||||
<<"Invalid index for diameter "
|
||||
<<index<<endl;
|
||||
fatalExit;
|
||||
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
@ -122,13 +137,17 @@ pFlow::real pFlow::grainShape::coarseGrainFactor(uint32 index) const
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
pFlow::realVector pFlow::grainShape::volume() const
|
||||
{
|
||||
return realVector("volume", Pi/6*pow(grainDiameters_,(real)3.0));
|
||||
}
|
||||
|
||||
pFlow::realVector pFlow::grainShape::coarseGrainFactor() const
|
||||
{
|
||||
return coarseGrainFactor_;
|
||||
}
|
||||
|
||||
pFlow::real pFlow::grainShape::orginalDiameter(uint32 index) const
|
||||
pFlow::real pFlow::grainShape::originalDiameter(uint32 index) const
|
||||
{
|
||||
if(indexValid(index))
|
||||
{
|
||||
@ -142,7 +161,7 @@ pFlow::real pFlow::grainShape::orginalDiameter(uint32 index) const
|
||||
|
||||
|
||||
|
||||
pFlow::realVector pFlow::grainShape::orginalDiameter() const
|
||||
pFlow::realVector pFlow::grainShape::originalDiameter() const
|
||||
{
|
||||
return sphereDiameters_;
|
||||
}
|
||||
|
@ -32,9 +32,13 @@ class grainShape
|
||||
{
|
||||
private:
|
||||
|
||||
// - diameter of spheres
|
||||
/// diameter of grains
|
||||
realVector grainDiameters_;
|
||||
|
||||
/// diameter of spheres
|
||||
realVector sphereDiameters_;
|
||||
|
||||
/// course-grain factor
|
||||
realVector coarseGrainFactor_;
|
||||
|
||||
|
||||
@ -54,9 +58,21 @@ public:
|
||||
repository* owner,
|
||||
const property& prop);
|
||||
|
||||
grainShape(
|
||||
const word& shapeType,
|
||||
const word& fileName,
|
||||
repository* owner,
|
||||
const property& prop);
|
||||
|
||||
|
||||
~grainShape() override = default;
|
||||
|
||||
add_vCtor
|
||||
(
|
||||
shape,
|
||||
grainShape,
|
||||
word
|
||||
);
|
||||
//// - Methods
|
||||
|
||||
real maxBoundingSphere()const override;
|
||||
@ -68,14 +84,16 @@ public:
|
||||
real boundingDiameter(uint32 index)const override;
|
||||
|
||||
realVector boundingDiameter()const override;
|
||||
|
||||
realVector volume()const override;
|
||||
|
||||
real coarseGrainFactor(uint32 index)const ;
|
||||
real coarseGrainFactor(uint32 index)const ;
|
||||
|
||||
realVector coarseGrainFactor()const ;
|
||||
|
||||
real orginalDiameter(uint32 index)const ;
|
||||
real originalDiameter(uint32 index)const ;
|
||||
|
||||
realVector orginalDiameter()const ;
|
||||
realVector originalDiameter()const ;
|
||||
|
||||
bool mass(uint32 index, real& m)const override;
|
||||
|
||||
|
@ -68,6 +68,18 @@ pFlow::sphereShape::sphereShape
|
||||
}
|
||||
}
|
||||
|
||||
pFlow::sphereShape::sphereShape
|
||||
(
|
||||
const word &shapeType,
|
||||
const word &fileName,
|
||||
repository *owner,
|
||||
const property &prop
|
||||
)
|
||||
:
|
||||
sphereShape(fileName, owner, prop)
|
||||
{
|
||||
}
|
||||
|
||||
pFlow::real pFlow::sphereShape::maxBoundingSphere() const
|
||||
{
|
||||
return max(diameters_);
|
||||
@ -105,6 +117,11 @@ pFlow::realVector pFlow::sphereShape::boundingDiameter() const
|
||||
return diameters_;
|
||||
}
|
||||
|
||||
pFlow::realVector pFlow::sphereShape::volume() const
|
||||
{
|
||||
return realVector("volume", Pi/6*pow(diameters_,(real)3.0));
|
||||
}
|
||||
|
||||
bool pFlow::sphereShape::mass(uint32 index, real &m) const
|
||||
{
|
||||
if( indexValid(index) )
|
||||
|
@ -51,9 +51,22 @@ public:
|
||||
repository* owner,
|
||||
const property& prop);
|
||||
|
||||
sphereShape(
|
||||
const word& shapeType,
|
||||
const word& fileName,
|
||||
repository* owner,
|
||||
const property& prop);
|
||||
|
||||
|
||||
~sphereShape() override = default;
|
||||
|
||||
add_vCtor
|
||||
(
|
||||
shape,
|
||||
sphereShape,
|
||||
word
|
||||
);
|
||||
|
||||
//// - Methods
|
||||
|
||||
real maxBoundingSphere()const override;
|
||||
@ -66,6 +79,8 @@ public:
|
||||
|
||||
realVector boundingDiameter()const override;
|
||||
|
||||
realVector volume()const override;
|
||||
|
||||
bool mass(uint32 index, real& m)const override;
|
||||
|
||||
real mass(uint32 index) const override;
|
||||
|
@ -186,7 +186,7 @@ public:
|
||||
}
|
||||
|
||||
inline
|
||||
uint maxId()const
|
||||
uint32 maxId()const
|
||||
{
|
||||
return idHandler_().maxId();
|
||||
}
|
||||
|
@ -1,5 +1,24 @@
|
||||
#include "shape.hpp"
|
||||
/*------------------------------- 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 "shape.hpp"
|
||||
|
||||
bool pFlow::shape::findPropertyIds()
|
||||
{
|
||||
@ -62,6 +81,18 @@ pFlow::shape::shape
|
||||
|
||||
}
|
||||
|
||||
pFlow::shape::shape
|
||||
(
|
||||
const word &shapeType,
|
||||
const word &fileName,
|
||||
repository *owner,
|
||||
const property &prop
|
||||
)
|
||||
:
|
||||
shape(fileName, owner, prop)
|
||||
{
|
||||
}
|
||||
|
||||
bool pFlow::shape::writeToDict(dictionary &dict)const
|
||||
{
|
||||
if(!baseShapeNames::writeToDict(dict))return false;
|
||||
@ -74,4 +105,37 @@ bool pFlow::shape::writeToDict(dictionary &dict)const
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
pFlow::uniquePtr<pFlow::shape> pFlow::shape::create
|
||||
(
|
||||
const word &shapeType,
|
||||
const word &fileName,
|
||||
repository *owner,
|
||||
const property &prop
|
||||
)
|
||||
{
|
||||
word type = angleBracketsNames("shape", shapeType);
|
||||
|
||||
if( wordvCtorSelector_.search(type) )
|
||||
{
|
||||
auto objPtr =
|
||||
wordvCtorSelector_[type]
|
||||
(shapeType, fileName, owner, prop);
|
||||
return objPtr;
|
||||
}
|
||||
else
|
||||
{
|
||||
printKeys
|
||||
(
|
||||
fatalError << "Ctor Selector "<<
|
||||
type << " dose not exist. \n"
|
||||
<<"Avaiable ones are: \n\n"
|
||||
,
|
||||
wordvCtorSelector_
|
||||
);
|
||||
fatalExit;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -60,9 +60,28 @@ public:
|
||||
const word& fileName,
|
||||
repository* owner,
|
||||
const property& prop);
|
||||
|
||||
shape(
|
||||
const word& shapeType,
|
||||
const word& fileName,
|
||||
repository* owner,
|
||||
const property& prop);
|
||||
|
||||
~shape() override=default;
|
||||
|
||||
create_vCtor
|
||||
(
|
||||
shape,
|
||||
word,
|
||||
(
|
||||
const word& shapeType,
|
||||
const word& fileName,
|
||||
repository* owner,
|
||||
const property& prop
|
||||
),
|
||||
(shapeType, fileName, owner, prop)
|
||||
);
|
||||
|
||||
inline
|
||||
const auto& properties()const
|
||||
{
|
||||
@ -148,6 +167,9 @@ public:
|
||||
virtual
|
||||
realVector boundingDiameter()const = 0;
|
||||
|
||||
virtual
|
||||
realVector volume()const = 0;
|
||||
|
||||
virtual
|
||||
bool mass(uint32 index, real& m)const = 0;
|
||||
|
||||
@ -187,6 +209,13 @@ public:
|
||||
virtual
|
||||
real Inertial_zz(uint32 index)const = 0;
|
||||
|
||||
static
|
||||
uniquePtr<shape> create(
|
||||
const word& shapeType,
|
||||
const word& fileName,
|
||||
repository* owner,
|
||||
const property& prop);
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user