Implementation of operators for fluid flowImplementation 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 // __BASICFINITEELEMENTS_HPP__
using namespace boost::numeric;
PostProcBrokenMeshInMoab<VolumeElementForcesAndSourcesCore>;
PostProcBrokenMeshInMoab<FaceElementForcesAndSourcesCore>;
int iD;
double fluidViscosity;
double fluidDensity;
double inertiaCoef;
double viscousCoef;
: iD(-1), fluidViscosity(-1), fluidDensity(-1), inertiaCoef(-1),
viscousCoef(-1) {}
};
boost::shared_ptr<MatrixDouble> gradVelPtr;
boost::shared_ptr<MatrixDouble> velPtr;
boost::shared_ptr<VectorDouble> pressPtr;
boost::shared_ptr<MatrixDouble> pressureDragTract;
boost::shared_ptr<MatrixDouble> shearDragTract;
boost::shared_ptr<MatrixDouble> totalDragTract;
SmartPetscObj<Vec> pressureDragForceVec;
SmartPetscObj<Vec> shearDragForceVec;
SmartPetscObj<Vec> totalDragForceVec;
SmartPetscObj<Vec> volumeFluxVec;
std::map<int, BlockData> setOfBlocksData;
std::map<int, BlockData> setOfFacesData;
gradVelPtr = boost::shared_ptr<MatrixDouble>(
new MatrixDouble());
velPtr = boost::shared_ptr<MatrixDouble>(
new MatrixDouble());
pressPtr = boost::shared_ptr<VectorDouble>(
new VectorDouble());
pressureDragTract = boost::shared_ptr<MatrixDouble>(
new MatrixDouble());
shearDragTract = boost::shared_ptr<MatrixDouble>(
new MatrixDouble());
totalDragTract = boost::shared_ptr<MatrixDouble>(
new MatrixDouble());
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,
const int dim = 3,
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;
}
};
boost::shared_ptr<CommonData> commonData;
bool diagonalBlock;
int row_nb_dofs;
int col_nb_dofs;
int row_nb_gauss_pts;
bool isOnDiagonal;
OpAssembleLhs(const string field_name_row, const string field_name_col,
boost::shared_ptr<CommonData> common_data,
commonData(common_data), blockData(block_data) {
sYmm = false;
diagonalBlock = false;
};
MoFEMErrorCode doWork(
int row_side,
int col_side, EntityType row_type,
EntityType col_type,
EntData &row_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) {
sYmm = false;
diagonalBlock = false;
};
};
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) {
sYmm = true;
diagonalBlock = true;
};
};
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) {
sYmm = false;
diagonalBlock = true;
};
};
boost::shared_ptr<CommonData> commonData;
int nbRows;
int nbIntegrationPts;
boost::shared_ptr<CommonData> common_data,
commonData(common_data), blockData(block_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> commonData;
boost::shared_ptr<CommonData> &common_data,
commonData(common_data), blockData(block_data) {
doVertices = true;
doEdges = false;
doQuads = false;
doTris = false;
doTets = false;
doPrisms = false;
};
};
boost::shared_ptr<CommonData> commonData;
boost::shared_ptr<VolumeElementForcesAndSourcesCoreOnSide> sideFe;
std::string sideFeName;
OpCalcDragTraction(
boost::shared_ptr<VolumeElementForcesAndSourcesCoreOnSide> &side_fe,
std::string side_fe_name, boost::shared_ptr<CommonData> &common_data,
sideFe(side_fe), sideFeName(side_fe_name), commonData(common_data),
blockData(block_data) {
doVertices = true;
doEdges = false;
doQuads = false;
doTris = false;
doTets = false;
doPrisms = false;
};
};
boost::shared_ptr<CommonData> commonData;
std::vector<EntityHandle> &mapGaussPts;
std::vector<EntityHandle> &map_gauss_pts,
boost::shared_ptr<CommonData> &common_data,
commonData(common_data), postProcMesh(post_proc_mesh),
mapGaussPts(map_gauss_pts), blockData(block_data) {
doVertices = true;
doEdges = false;
doQuads = false;
doTris = false;
doTets = false;
doPrisms = false;
};
};
boost::shared_ptr<CommonData> commonData;
std::vector<EntityHandle> &mapGaussPts;
std::vector<EntityHandle> &map_gauss_pts,
boost::shared_ptr<CommonData> &common_data,
commonData(common_data), postProcMesh(post_proc_mesh),
mapGaussPts(map_gauss_pts), blockData(block_data) {
doVertices = true;
doEdges = false;
doQuads = false;
doTris = false;
doTets = false;
doPrisms = false;
};
};
boost::shared_ptr<CommonData> commonData;
int nbRows;
int nbIntegrationPts;
boost::shared_ptr<CommonData> common_data,
commonData(common_data), blockData(block_data){};
};
};
#endif //__NAVIERSTOKESELEMENT_HPP__