v0.8.23
Files | Classes | Functions
Moisture element
Collaboration diagram for Moisture element:

Files

file  MoistureTransportElement.hpp
 Operators and data structures for moisture analyse.
 

Classes

struct  MoistureTransportElement
 struture grouping operators and data used for moisture problemsIn order to assemble matrices and right hand vectors, the loops over elements, enetities over that elememnts and finally loop over intergration points are executed. More...
 

Functions

PetscErrorCode MoistureTransportElement::addDiffusionElement (const string problem_name, const string field_name, const string mesh_nodals_positions="MESH_NODE_POSITIONS")
 add diffusion element on tetsIt get data from block set and define elemenet in moab More...
 
PetscErrorCode MoistureTransportElement::addDarceysFlowElement (const string problem_name, const string field_name, const string mesh_nodals_positions="MESH_NODE_POSITIONS")
 add darceys flow element on tetsIt get data from block set and define elemenet in moab More...
 
PetscErrorCode MoistureTransportElement::addDiffusionFluxElement (const string problem_name, const string field_name, const string mesh_nodals_positions="MESH_NODE_POSITIONS")
 add diffusion flux elementIt get data from het flux set and define elemenet in moab. Aletrantively uses block set with name HET_FLUX. More...
 
PetscErrorCode MoistureTransportElement::setTimeSteppingProblem (TsCtx &ts_ctx, string field_name, string rate_name, const string mesh_nodals_positions="MESH_NODE_POSITIONS")
 set up operators for unsedy moisture transport problem More...
 

Detailed Description

Function Documentation

◆ addDarceysFlowElement()

PetscErrorCode MoistureTransportElement::addDarceysFlowElement ( const string  problem_name,
const string  field_name,
const string  mesh_nodals_positions = "MESH_NODE_POSITIONS" 
)

add darceys flow element on tetsIt get data from block set and define elemenet in moab

Parameters
problemname
fieldname
nameof mesh nodal positions (if not defined nodal coordinates are used)

Definition at line 102 of file MoistureTransportElement.hpp.

102  {
103  PetscFunctionBegin;
104 
105 
106  // cout<<"insides the addDiffusionElements = "<<endl;
107  ierr = mField.add_finite_element("DARCEYS_FE",MF_ZERO); CHKERRQ(ierr);
108  ierr = mField.modify_finite_element_add_field_row("DARCEYS_FE",field_name); CHKERRQ(ierr);
109  ierr = mField.modify_finite_element_add_field_col("DARCEYS_FE",field_name); CHKERRQ(ierr);
110  ierr = mField.modify_finite_element_add_field_data("DARCEYS_FE",field_name); CHKERRQ(ierr);
111  if(mField.check_field(mesh_nodals_positions)) {
112  ierr = mField.modify_finite_element_add_field_data("DARCEYS_FE",mesh_nodals_positions); CHKERRQ(ierr);
113  }
114  ierr = mField.modify_problem_add_finite_element(problem_name,"DARCEYS_FE"); CHKERRQ(ierr);
115 
116  // loop over all blocksets
118  if(it->getName().compare(0,19,"MAT_MOISTURE") == 0){
119  Mat_Moisture darceys_data;
120  ierr = it->getAttributeDataStructure(darceys_data); CHKERRQ(ierr);
121 
122 // cout<<"darceys_data.data.Viscosity = "<<darceys_data.data.Viscosity<<endl;
123 // cout<<"darceys_data.data.Permeability = "<<darceys_data.data.Permeability<<endl;
124 
125 // cout<<"it->getMeshsetId() = "<<it->getMeshsetId()<<endl;
126  //It is moisture conductivity acting the same as heat conductivity in thermal problem
127  setOfBlocks[it->getMeshsetId()].cOnductivity_mat.resize(3,3); //(3X3) conductivity matrix
128  setOfBlocks[it->getMeshsetId()].cOnductivity_mat.clear();
129  setOfBlocks[it->getMeshsetId()].cOnductivity_mat(0,0)=darceys_data.data.Permeability/darceys_data.data.Viscosity;
130  setOfBlocks[it->getMeshsetId()].cOnductivity_mat(1,1)=darceys_data.data.Permeability/darceys_data.data.Viscosity;
131  setOfBlocks[it->getMeshsetId()].cOnductivity_mat(2,2)=darceys_data.data.Permeability/darceys_data.data.Viscosity;
132 
133  //setOfBlocks[it->getMeshsetId()].cOnductivity = darceys_data.data.Permeability/darceys_data.data.Viscosity;
134  setOfBlocks[it->getMeshsetId()].cApacity = 1.0; //moisture capicity is 1 (will see this for the Darceys unsteady flow ????)
135 
136  rval = mField.get_moab().get_entities_by_type(it->meshset,MBTET,setOfBlocks[it->getMeshsetId()].tEts,true); CHKERRQ_MOAB(rval);
137  // cout<<"setOfBlocks[it->getMeshsetIdx()].tEts.size() = "<<setOfBlocks[it->getMeshsetId()].tEts.size()<<endl;
138  ierr = mField.add_ents_to_finite_element_by_type(setOfBlocks[it->getMeshsetId()].tEts,MBTET,"DARCEYS_FE"); CHKERRQ(ierr);
139  }
140  }
141  PetscFunctionReturn(0);
142  }
#define CHKERRQ_MOAB(a)
check error code of MoAB function
Definition: definitions.h:514
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 add_ents_to_finite_element_by_type(const EntityHandle entities, const EntityType type, const std::string &name, const bool recursive=true)=0
add entities to finite element
block name is "MAT_MOISTURE"
Definition: definitions.h:225
virtual moab::Interface & get_moab()=0
std::map< int, BlockData > setOfBlocks
maps block set id with appropriate BlockData
virtual MoFEMErrorCode modify_problem_add_finite_element(const std::string &name_problem, const std::string &fe_name)=0
add finite element to problem, this add entities assigned to finite element to a particular problem
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
Definition: Exceptions.hpp:84
MoFEM::Interface & mField
CHKERRQ(ierr)
#define _IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
Iterator that loops over a specific Cubit MeshSet in a moFEM field.
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_data(const std::string &fe_name, const std::string &name_filed)=0
set finite element field data
virtual bool check_field(const std::string &name) const =0
check if field is in database
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

◆ addDiffusionElement()

PetscErrorCode MoistureTransportElement::addDiffusionElement ( const string  problem_name,
const string  field_name,
const string  mesh_nodals_positions = "MESH_NODE_POSITIONS" 
)

add diffusion element on tetsIt get data from block set and define elemenet in moab

Parameters
problemname
fieldname
nameof mesh nodal positions (if not defined nodal coordinates are used)

Definition at line 52 of file MoistureTransportElement.hpp.

52  {
53  PetscFunctionBegin;
54 
55 
56  // cout<<"insides the addDiffusionElements = "<<endl;
57  ierr = mField.add_finite_element("DIFFUSION_FE",MF_ZERO); CHKERRQ(ierr);
58  ierr = mField.modify_finite_element_add_field_row("DIFFUSION_FE",field_name); CHKERRQ(ierr);
59  ierr = mField.modify_finite_element_add_field_col("DIFFUSION_FE",field_name); CHKERRQ(ierr);
60  ierr = mField.modify_finite_element_add_field_data("DIFFUSION_FE",field_name); CHKERRQ(ierr);
61  if(mField.check_field(mesh_nodals_positions)) {
62  ierr = mField.modify_finite_element_add_field_data("DIFFUSION_FE",mesh_nodals_positions); CHKERRQ(ierr);
63  }
64  ierr = mField.modify_problem_add_finite_element(problem_name,"DIFFUSION_FE"); CHKERRQ(ierr);
65 
66  // loop over all blocksets
68  if(it->getName().compare(0,19,"MAT_MOISTURE") == 0){
69  Mat_Moisture diffusion_data;
70  ierr = it->getAttributeDataStructure(diffusion_data); CHKERRQ(ierr);
71  // cout<<"diffusion_data.data.Diffusivity = "<<diffusion_data.data.Diffusivity<<endl;
72  // cout<<"it->getMeshsetId() = "<<it->getMeshsetId()<<endl;
73  //It is moisture conductivity acting the same as heat conductivity in thermal problem
74 
75  setOfBlocks[it->getMeshsetId()].cOnductivity_mat.resize(3,3); //(3X3) conductivity matrix
76  setOfBlocks[it->getMeshsetId()].cOnductivity_mat.clear();
77  setOfBlocks[it->getMeshsetId()].cOnductivity_mat(0,0)=diffusion_data.data.Diffusivity;
78  setOfBlocks[it->getMeshsetId()].cOnductivity_mat(1,1)=diffusion_data.data.Diffusivity;
79  setOfBlocks[it->getMeshsetId()].cOnductivity_mat(2,2)=diffusion_data.data.Diffusivity;
80 
81  //setOfBlocks[it->getMeshsetId()].cOnductivity = diffusion_data.data.Diffusivity;
82  setOfBlocks[it->getMeshsetId()].cApacity = 1.0; //moisture capicity is 1
83 
84  rval = mField.get_moab().get_entities_by_type(it->meshset,MBTET,setOfBlocks[it->getMeshsetId()].tEts,true); CHKERRQ_MOAB(rval);
85  // cout<<"setOfBlocks[it->getMeshsetIdx()].tEts.size() = "<<setOfBlocks[it->getMeshsetId()].tEts.size()<<endl;
86  ierr = mField.add_ents_to_finite_element_by_type(setOfBlocks[it->getMeshsetId()].tEts,MBTET,"DIFFUSION_FE"); CHKERRQ(ierr);
87  }
88  }
89  PetscFunctionReturn(0);
90  }
#define CHKERRQ_MOAB(a)
check error code of MoAB function
Definition: definitions.h:514
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 add_ents_to_finite_element_by_type(const EntityHandle entities, const EntityType type, const std::string &name, const bool recursive=true)=0
add entities to finite element
block name is "MAT_MOISTURE"
Definition: definitions.h:225
virtual moab::Interface & get_moab()=0
std::map< int, BlockData > setOfBlocks
maps block set id with appropriate BlockData
virtual MoFEMErrorCode modify_problem_add_finite_element(const std::string &name_problem, const std::string &fe_name)=0
add finite element to problem, this add entities assigned to finite element to a particular problem
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
Definition: Exceptions.hpp:84
MoFEM::Interface & mField
CHKERRQ(ierr)
#define _IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
Iterator that loops over a specific Cubit MeshSet in a moFEM field.
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_data(const std::string &fe_name, const std::string &name_filed)=0
set finite element field data
virtual bool check_field(const std::string &name) const =0
check if field is in database
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

◆ addDiffusionFluxElement()

PetscErrorCode MoistureTransportElement::addDiffusionFluxElement ( const string  problem_name,
const string  field_name,
const string  mesh_nodals_positions = "MESH_NODE_POSITIONS" 
)

add diffusion flux elementIt get data from het flux set and define elemenet in moab. Aletrantively uses block set with name HET_FLUX.

Parameters
problemname
fieldname
nameof mesh nodal positions (if not defined nodal coordinates are used)

Definition at line 154 of file MoistureTransportElement.hpp.

154  {
155  PetscFunctionBegin;
156 
157 
158 
159 
160  ierr = mField.add_finite_element("DIFFUSION_FLUX_FE",MF_ZERO); CHKERRQ(ierr);
161  ierr = mField.modify_finite_element_add_field_row("DIFFUSION_FLUX_FE",field_name); CHKERRQ(ierr);
162  ierr = mField.modify_finite_element_add_field_col("DIFFUSION_FLUX_FE",field_name); CHKERRQ(ierr);
163  ierr = mField.modify_finite_element_add_field_data("DIFFUSION_FLUX_FE",field_name); CHKERRQ(ierr);
164  if(mField.check_field(mesh_nodals_positions)) {
165  ierr = mField.modify_finite_element_add_field_data("DIFFUSION_FLUX_FE",mesh_nodals_positions); CHKERRQ(ierr);
166  }
167  ierr = mField.modify_problem_add_finite_element(problem_name,"DIFFUSION_FLUX_FE"); CHKERRQ(ierr);
168 
169  //this is alternative method for setting boundary conditions, to bypass bu in cubit file reader.
170  //not elegant, but good enough
172  if(it->getName().compare(0,9,"MASS_FLUX") == 0) {
173  vector<double> data;
174  ierr = it->getAttributes(data); CHKERRQ(ierr);
175  if(data.size()!=1) {
176  SETERRQ(PETSC_COMM_SELF,1,"Data inconsistency");
177  }
178 // cout<<"data[0] "<<data[0]<<endl;
179 // std::string wait;
180 // std::cin >> wait;
181  setOfFluxes[it->getMeshsetId()].dAta.data.flag1 = 1;
182  setOfFluxes[it->getMeshsetId()].dAta.data.value1 = data[0];
183  //cerr << setOfFluxes[it->getMeshsetId()].dAta << endl;
184  rval = mField.get_moab().get_entities_by_type(it->meshset,MBTRI,setOfFluxes[it->getMeshsetId()].tRis,true); CHKERRQ_MOAB(rval);
185  ierr = mField.add_ents_to_finite_element_by_type(setOfFluxes[it->getMeshsetId()].tRis,MBTRI,"DIFFUSION_FLUX_FE"); CHKERRQ(ierr);
186 
187  }
188  }
189 
190  PetscFunctionReturn(0);
191  }
#define CHKERRQ_MOAB(a)
check error code of MoAB function
Definition: definitions.h:514
std::map< int, FluxData > setOfFluxes
maps side set id with appropriate FluxData
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 add_ents_to_finite_element_by_type(const EntityHandle entities, const EntityType type, const std::string &name, const bool recursive=true)=0
add entities to finite element
virtual moab::Interface & get_moab()=0
virtual MoFEMErrorCode modify_problem_add_finite_element(const std::string &name_problem, const std::string &fe_name)=0
add finite element to problem, this add entities assigned to finite element to a particular problem
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
Definition: Exceptions.hpp:84
MoFEM::Interface & mField
CHKERRQ(ierr)
virtual MoFEMErrorCode add_finite_element(const std::string &fe_name, enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
add finite element
#define _IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
Iterator that loops over a specific Cubit MeshSet having a particular BC meshset in a moFEM field.
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 bool check_field(const std::string &name) const =0
check if field is in database
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

◆ setTimeSteppingProblem()

PetscErrorCode MoistureTransportElement::setTimeSteppingProblem ( TsCtx &  ts_ctx,
string  field_name,
string  rate_name,
const string  mesh_nodals_positions = "MESH_NODE_POSITIONS" 
)

set up operators for unsedy moisture transport problem

Definition at line 197 of file MoistureTransportElement.hpp.

197  {
198  PetscFunctionBegin;
199 
200 
201  ierr = ThermalElement::setTimeSteppingProblem(field_name,rate_name,mesh_nodals_positions); CHKERRQ(ierr);
202 
203  //rhs
204  TsCtx::loops_to_do_type& loops_to_do_Rhs = ts_ctx.get_loops_to_do_IFunction();
205  loops_to_do_Rhs.push_back(TsCtx::loop_pair_type("DIFFUSION_FE",&feRhs));
206  loops_to_do_Rhs.push_back(TsCtx::loop_pair_type("DIFFUSION_FLUX_FE",&feFlux));
207 
208  //lhs
209  TsCtx::loops_to_do_type& loops_to_do_Mat = ts_ctx.get_loops_to_do_IJacobian();
210  loops_to_do_Mat.push_back(TsCtx::loop_pair_type("DIFFUSION_FE",&feLhs));
211  //monitor
212  //TsCtx::loops_to_do_type& loops_to_do_Monitor = ts_ctx.get_loops_to_do_Monitor();
213 
214  PetscFunctionReturn(0);
215  }
MoFEMErrorCode setTimeSteppingProblem(string field_name, string rate_name, const std::string mesh_nodals_positions="MESH_NODE_POSITIONS")
set up operators for unsteady heat flux; convection; radiation problem
CHKERRQ(ierr)
MyVolumeFE feRhs
cauclate right hand side for tetrahedral elements
MyVolumeFE feLhs