Implementation of operators for fluid flow.
Implementation of operators for computations of the fluid flow, governed by for Stokes and Navier-Stokes equations, and computation of the drag force
#ifndef __NAVIERSTOKESELEMENT_HPP__
#define __NAVIERSTOKESELEMENT_HPP__
#ifndef __BASICFINITEELEMENTS_HPP__
#endif
using namespace boost::numeric;
PostProcBrokenMeshInMoab<VolumeElementForcesAndSourcesCore>;
PostProcBrokenMeshInMoab<FaceElementForcesAndSourcesCore>;
using EntData = EntitiesFieldData::EntData;
};
boost::shared_ptr<MatrixDouble>
velPtr;
boost::shared_ptr<VectorDouble>
pressPtr;
gradVelPtr = boost::shared_ptr<MatrixDouble>(
new MatrixDouble());
velPtr = boost::shared_ptr<MatrixDouble>(
new MatrixDouble());
pressPtr = boost::shared_ptr<VectorDouble>(
new VectorDouble());
int vec_size;
vec_size = 3;
else
vec_size = 0;
}
CHKERR PetscOptionsBegin(PETSC_COMM_WORLD,
"",
"Problem",
"none");
ierr = PetscOptionsEnd();
}
};
}
};
const string element_name,
const string velocity_field_name,
const string pressure_field_name,
const string mesh_field_name,
velocity_field_name);
velocity_field_name);
velocity_field_name);
pressure_field_name);
pressure_field_name);
pressure_field_name);
mesh_field_name);
if (ents != nullptr) {
element_name);
} else {
}
}
boost::shared_ptr<VolumeElementForcesAndSourcesCore> feRhs,
boost::shared_ptr<VolumeElementForcesAndSourcesCore> feLhs,
const std::string velocity_field, const std::string pressure_field,
boost::shared_ptr<CommonData> common_data,
const EntityType type = MBTET);
boost::shared_ptr<VolumeElementForcesAndSourcesCore> feRhs,
boost::shared_ptr<VolumeElementForcesAndSourcesCore> feLhs,
const std::string velocity_field, const std::string pressure_field,
boost::shared_ptr<CommonData> common_data,
const EntityType type = MBTET);
boost::shared_ptr<FaceElementForcesAndSourcesCore> dragFe,
boost::shared_ptr<VolumeElementForcesAndSourcesCoreOnSide> sideDragFe,
std::string side_fe_name, const std::string velocity_field,
const std::string pressure_field,
boost::shared_ptr<CommonData> common_data);
boost::shared_ptr<PostProcFace> postProcDragPtr,
boost::shared_ptr<VolumeElementForcesAndSourcesCoreOnSide> sideDragFe,
std::string side_fe_name, const std::string velocity_field,
const std::string pressure_field,
boost::shared_ptr<CommonData> common_data);
boost::shared_ptr<VolumeElementForcesAndSourcesCore> fe_flux_ptr,
const std::string velocity_field,
boost::shared_ptr<CommonData> common_data,
const EntityType type = MBTET);
int operator()(
int order_row,
int order_col,
int order_data)
const {
return 2 * order_data;
}
};
int operator()(
int order_row,
int order_col,
int order_data)
const {
return order_data + 2;
}
};
OpAssembleLhs(const string field_name_row, const string field_name_col,
boost::shared_ptr<CommonData> common_data,
};
};
};
struct OpAssembleLhsOffDiag : public OpAssembleLhs {
OpAssembleLhsOffDiag(const string field_name_row,
const string field_name_col,
boost::shared_ptr<CommonData> common_data,
: OpAssembleLhs(field_name_row, field_name_col, common_data,
block_data) {
};
};
struct OpAssembleLhsDiagLin : public OpAssembleLhs {
OpAssembleLhsDiagLin(const string field_name_row,
const string field_name_col,
boost::shared_ptr<CommonData> common_data,
: OpAssembleLhs(field_name_row, field_name_col, common_data,
block_data) {
};
};
struct OpAssembleLhsDiagNonLin : public OpAssembleLhs {
OpAssembleLhsDiagNonLin(const string field_name_row,
const string field_name_col,
boost::shared_ptr<CommonData> common_data,
: OpAssembleLhs(field_name_row, field_name_col, common_data,
block_data) {
};
};
boost::shared_ptr<CommonData> common_data,
};
};
struct OpAssembleRhsVelocityLin : public OpAssembleRhs {
boost::shared_ptr<CommonData> common_data,
: OpAssembleRhs(
field_name, common_data, block_data){};
};
struct OpAssembleRhsVelocityNonLin : public OpAssembleRhs {
OpAssembleRhsVelocityNonLin(
const string field_name,
boost::shared_ptr<CommonData> common_data,
: OpAssembleRhs(
field_name, common_data, block_data){};
};
struct OpAssembleRhsPressure : public OpAssembleRhs {
boost::shared_ptr<CommonData> common_data,
: OpAssembleRhs(
field_name, common_data, block_data){};
};
boost::shared_ptr<CommonData> &common_data,
: FaceElementForcesAndSourcesCore::UserDataOperator(
};
};
boost::shared_ptr<VolumeElementForcesAndSourcesCoreOnSide>
sideFe;
OpCalcDragTraction(
boost::shared_ptr<VolumeElementForcesAndSourcesCoreOnSide> &side_fe,
std::string side_fe_name, boost::shared_ptr<CommonData> &common_data,
: FaceElementForcesAndSourcesCore::UserDataOperator(
};
};
OpPostProcDrag(
const string field_name, moab::Interface &post_proc_mesh,
std::vector<EntityHandle> &map_gauss_pts,
boost::shared_ptr<CommonData> &common_data,
: FaceElementForcesAndSourcesCore::UserDataOperator(
};
};
OpPostProcVorticity(moab::Interface &post_proc_mesh,
std::vector<EntityHandle> &map_gauss_pts,
boost::shared_ptr<CommonData> &common_data,
};
};
boost::shared_ptr<CommonData> common_data,
};
};
#endif
ForcesAndSourcesCore::UserDataOperator UserDataOperator
static PetscErrorCode ierr
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
virtual MoFEMErrorCode add_ents_to_finite_element_by_dim(const EntityHandle entities, const int dim, const std::string &name, const bool recursive=true)=0
add entities to finite element
virtual MoFEMErrorCode add_finite_element(const std::string &fe_name, enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
add finite element
virtual MoFEMErrorCode modify_finite_element_add_field_col(const std::string &fe_name, const std::string name_row)=0
set field col which finite element use
virtual MoFEMErrorCode modify_finite_element_add_field_data(const std::string &fe_name, const std::string name_filed)=0
set finite element field data
virtual MoFEMErrorCode modify_finite_element_add_field_row(const std::string &fe_name, const std::string name_row)=0
set field row which finite element use
PostProcBrokenMeshInMoab< VolumeElementForcesAndSourcesCore > PostProcVol
PostProcBrokenMeshInMoab< FaceElementForcesAndSourcesCore > PostProcFace
constexpr auto field_name
Set integration rule to boundary elements.
Class used to scale loads, f.e. in arc-length control.
virtual MPI_Comm & get_comm() const =0
virtual int get_comm_rank() const =0
bool & doPrisms
\deprectaed
bool sYmm
If true assume that matrix is symmetric structure.
bool & doVertices
\deprectaed If false skip vertices
bool & doEdges
\deprectaed If false skip edges
bool & doQuads
\deprectaed
Deprecated interface functions.
Data on single entity (This is passed as argument to DataOperator::doWork)
default operator for TRI element
@ OPROW
operator doWork function is executed on FE rows
@ OPROWCOL
operator doWork is executed on FE rows &columns
boost::shared_ptr< MatrixDouble > pressureDragTract
SmartPetscObj< Vec > volumeFluxVec
boost::shared_ptr< MatrixDouble > gradVelPtr
std::map< int, BlockData > setOfBlocksData
boost::shared_ptr< MatrixDouble > shearDragTract
std::map< int, BlockData > setOfFacesData
MoFEMErrorCode getParameters()
boost::shared_ptr< VectorDouble > pressPtr
boost::shared_ptr< MatrixDouble > totalDragTract
SmartPetscObj< Vec > pressureDragForceVec
boost::shared_ptr< MatrixDouble > velPtr
SmartPetscObj< Vec > totalDragForceVec
SmartPetscObj< Vec > shearDragForceVec
int operator()(int order_row, int order_col, int order_data) const
MoFEMErrorCode scaleNf(const FEMethod *fe, VectorDouble &nf)
MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data)
FTensor::Tensor2< double, 3, 3 > diffDiff
MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data)
FTensor::Tensor2< double, 3, 3 > diffDiff
MoFEMErrorCode aSsemble(EntData &row_data, EntData &col_data)
virtual MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data)
MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
Operator for bi-linear form, usually to calculate values on left hand side.
boost::shared_ptr< CommonData > commonData
MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data)
boost::shared_ptr< CommonData > commonData
MoFEMErrorCode doWork(int row_side, EntityType row_type, EntData &row_data)
Operator for linear form, usually to calculate values on right hand side.
MoFEMErrorCode aSsemble(EntData &data)
int nbRows
number of dofs on row
virtual MoFEMErrorCode iNtegrate(EntData &data)
MoFEMErrorCode iNtegrate(EntData &data)
Integrate local constrains vector.
MoFEMErrorCode iNtegrate(EntData &data)
Integrate local entity vector.
MoFEMErrorCode iNtegrate(EntData &data)
boost::shared_ptr< CommonData > commonData
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
Operator for linear form, usually to calculate values on right hand side.
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
Operator for linear form, usually to calculate values on right hand side.
boost::shared_ptr< CommonData > commonData
boost::shared_ptr< VolumeElementForcesAndSourcesCoreOnSide > sideFe
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
Operator for linear form, usually to calculate values on right hand side.
int nbRows
number of dofs on row
boost::shared_ptr< CommonData > commonData
boost::shared_ptr< CommonData > commonData
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
Operator for linear form, usually to calculate values on right hand side.
moab::Interface & postProcMesh
std::vector< EntityHandle > & mapGaussPts
moab::Interface & postProcMesh
std::vector< EntityHandle > & mapGaussPts
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
Operator for linear form, usually to calculate values on right hand side.
boost::shared_ptr< CommonData > commonData
int operator()(int order_row, int order_col, int order_data) const
Element for simulating viscous fluid flow.
static MoFEMErrorCode setCalcDragOperators(boost::shared_ptr< FaceElementForcesAndSourcesCore > dragFe, boost::shared_ptr< VolumeElementForcesAndSourcesCoreOnSide > sideDragFe, std::string side_fe_name, const std::string velocity_field, const std::string pressure_field, boost::shared_ptr< CommonData > common_data)
Setting up operators for calculating drag force on the solid surface.
static MoFEMErrorCode addElement(MoFEM::Interface &m_field, const string element_name, const string velocity_field_name, const string pressure_field_name, const string mesh_field_name, const int dim=3, Range *ents=nullptr)
Setting up elements.
static MoFEMErrorCode setPostProcDragOperators(boost::shared_ptr< PostProcFace > postProcDragPtr, boost::shared_ptr< VolumeElementForcesAndSourcesCoreOnSide > sideDragFe, std::string side_fe_name, const std::string velocity_field, const std::string pressure_field, boost::shared_ptr< CommonData > common_data)
Setting up operators for post processing output of drag traction.
static MoFEMErrorCode setNavierStokesOperators(boost::shared_ptr< VolumeElementForcesAndSourcesCore > feRhs, boost::shared_ptr< VolumeElementForcesAndSourcesCore > feLhs, const std::string velocity_field, const std::string pressure_field, boost::shared_ptr< CommonData > common_data, const EntityType type=MBTET)
Setting up operators for solving Navier-Stokes equations.
MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator UserDataOperator
static MoFEMErrorCode setStokesOperators(boost::shared_ptr< VolumeElementForcesAndSourcesCore > feRhs, boost::shared_ptr< VolumeElementForcesAndSourcesCore > feLhs, const std::string velocity_field, const std::string pressure_field, boost::shared_ptr< CommonData > common_data, const EntityType type=MBTET)
Setting up operators for solving Stokes equations.
MoFEM::FaceElementForcesAndSourcesCore::UserDataOperator FaceUserDataOperator
static MoFEMErrorCode setCalcVolumeFluxOperators(boost::shared_ptr< VolumeElementForcesAndSourcesCore > fe_flux_ptr, const std::string velocity_field, boost::shared_ptr< CommonData > common_data, const EntityType type=MBTET)
Setting up operators for calculation of volume flux.