ChemicalFemPhysics
The GeMA Standard Chemical FEM Physics Plugin
Loading...
Searching...
No Matches
gmpChemicalInterface.h
Go to the documentation of this file.
1/************************************************************************
2**
3** Copyright (C) 2014 by Carlos Augusto Teixera Mendes
4** All rights reserved.
5**
6** This file is part of the "GeMA" software. It's use should respect
7** the terms in the license agreement that can be found together
8** with this source code.
9** It is provided AS IS, with NO WARRANTY OF ANY KIND,
10** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR
11** A PARTICULAR PURPOSE.
12**
13************************************************************************/
14
24#ifndef _GEMA_PLUGIN_CHEMICAL_INTERFACE_H_
25#define _GEMA_PLUGIN_CHEMICAL_INTERFACE_H_
26
27
28#include <gmpFemPhysicsCommon.h>
29#include <gmpFemPhysicsCommonMaterial.h>
31#include <gmGaussAccessor.h>
32#include <gmTrace.h>
33
34class GmGaussAccessor;
35
36
40{
41public:
42 // constructor
43 GmpChemicalInterface(GmSimulationData* simulation, QString id, QString description, const GmLogCategory& logger);
44
45 // destructor
46 virtual ~GmpChemicalInterface();
47
50 {
52 An_ID,
53
54 // --- NO ADDING BELOW THIS LINE
56 };
57
59 {
61 AnOLD_GA_ID,
62
63 // --- NO ADDING BELOW THIS LINE
65 };
66
67 virtual const QVariantMap* physicsMetaDataMap();
68
69 // Comments on the base class
70 virtual const char* pluginType() const { return "interface"; }
71
72 virtual bool checkAndLoadAttributeAccessors(LuaTable& nodeTable, LuaTable& cellTable, LuaTable& gaussTable);
73 //virtual bool beforeElementStiffnessLoop(const GmpFemMatrixSet& elemMatrices, const GmpFemVectorSet& elemVectors);
74 virtual GmpFemPhysics::FemResultType fillElementData(const GmElement* e, GmpFemMatrixSet& elemMatrices, GmpFemVectorSet& elemVectors);
75
76 virtual FemResultType fillElementDataForBc(const GmElement* e, const GmBoundaryCondition* bc, int bcIndex, int bcListIndex,
77 int border, GmpFemMatrixSet& elemMatrices, GmpFemVectorSet& elemVectors);
78
79 virtual bool fixedNodalDofsBc(QVector<int>& nodes, QVector<int>&dof, QVector<double>& values, bool* constantValues) const;
80
81 virtual bool calcDerivedResults(bool nonLinearSolver);
82
85 virtual void fillStorageCompMatrix(const GmElement* e, const GmVector* coord, int ip, GmMatrix& Sc, const GmVector& N,
86 double phi, double k, double c) const;
87
90 virtual void fillDiffusionMatrix(const GmElement* e, GmMatrix& Kc, const GmMatrix& Bp, const GmMatrix& D, const GmVector& v,
91 const GmVector& N, double phi, double c, int ns);
92
95 //virtual bool setInitialGaussAttributes(const GmElement* e, const GmVector* coord, int ip) const;
96
97 virtual bool setInitialConditions() const;
100 virtual void fillElementConcentration(const GmElement* e, GmVector& pe);
101
103 virtual double initiallyOpenElem(const GmElement* e, const GmVector* coord, int ip) const
104 {
105 S_TRACE();
106 assert(e);
107 GmCellAccessor* iOpenAcc = propertyAc(IOPEN_ID);
108 if (iOpenAcc == NULL)
109 {
110 return 1.0;
111 }
112 return iOpenAcc->scalarValueAt(e, coord, ip);
113 }
114
117 {
120 //PRESCRIBED_MIXED_BC_INT_ID, //!< Id for third kind boundary condition on cell
121 };
122
125 {
128 //BC_MX_VAL_ID, //!< Third Kind Boundary Condition. Robin/Cauchy.
131 //BC_MX_INT_ID, //!< BC Id for node on cell where is prescribed the thrid kind boundary condition.
132 };
133protected:
134 virtual const GmElementDof* dofMapping(GmCellType type) const;
135
140 void fillMiddleCoordinates(const GmElement* e, const GmMatrix& Xnode, GmMatrix& MX) const;
141
142 // Computes the chemical reaction
143 virtual bool reactionRate(const GmElement* e, const GmVector* ip, int ipIndex, const GmVector& N,
144 const GmVector& C, double wtJ, GmVector& elemFe, GmMatrix& elemK, bool needsFe, bool needsK);
145};
146
147#endif
Basic class for chemical fem physics. Treats the diffusion and convective terms of the transport equa...
Definition gmpChemicalFemPhysics.h:35
@ NUM_BCV_IDS
The number of BC ids above.
Definition gmpChemicalFemPhysics.h:145
@ NUM_PROPERTY_IDS
The number of property ids above.
Definition gmpChemicalFemPhysics.h:120
@ NUM_BC_IDS
The number of BC ids above.
Definition gmpChemicalFemPhysics.h:132
@ NUM_GA_IDS
The number of gauss attribute ids above.
Definition gmpChemicalFemPhysics.h:107
Basic class for the hydraulic interface element plugin object.
Definition gmpChemicalInterface.h:40
virtual bool setInitialConditions() const
sets the initial value of chemical gauss attributes.
Definition gmpChemicalInterface.cpp:1006
virtual const QVariantMap * physicsMetaDataMap()
Returns a reference for the chemical interface attribute map, built when the function is called for t...
Definition gmpChemicalInterface.cpp:56
virtual bool calcDerivedResults(bool nonLinearSolver)
Calc velocity and flow on nodes and/or Gauss points.
Definition gmpChemicalInterface.cpp:1057
virtual bool fixedNodalDofsBc(QVector< int > &nodes, QVector< int > &dof, QVector< double > &values, bool *constantValues) const
See comments on base class. Fills vectors with prescribed node concentrations
Definition gmpChemicalInterface.cpp:370
virtual double initiallyOpenElem(const GmElement *e, const GmVector *coord, int ip) const
Returns the initially open element
Definition gmpChemicalInterface.h:103
void fillMiddleCoordinates(const GmElement *e, const GmMatrix &Xnode, GmMatrix &MX) const
Computes the coordinate at the middle plane of the interface element . Given an element 'e' and the n...
Definition gmpChemicalInterface.cpp:703
InterfaceGaussAttributeIds
Definition gmpChemicalInterface.h:59
@ An_GA_ID
Base Id for Gauss attribute(s) used to store the normal aperture.
Definition gmpChemicalInterface.h:60
@ NUM_GA_IDS
The number of property ids above.
Definition gmpChemicalInterface.h:64
virtual bool checkAndLoadAttributeAccessors(LuaTable &nodeTable, LuaTable &cellTable, LuaTable &gaussTable)
Reimplementation of the common function to set initial gauss attributes.
Definition gmpChemicalInterface.cpp:137
InterfacePropertyIds
IDs for physics element properties.
Definition gmpChemicalInterface.h:50
@ IOPEN_ID
Id for retrieving the initially open element accessor.
Definition gmpChemicalInterface.h:51
@ NUM_PROPER_IDS
The number of property ids above.
Definition gmpChemicalInterface.h:55
BoundaryConditionIds
IDs for accepted boundary condition types.
Definition gmpChemicalInterface.h:117
@ FIXED_C_BC_INT_ID
Id for prescribed concentration boundary condition on cell.
Definition gmpChemicalInterface.h:118
@ FIXED_CF_BC_INT_ID
Id for prescribed flux boundary condition on cell.
Definition gmpChemicalInterface.h:119
virtual FemResultType fillElementDataForBc(const GmElement *e, const GmBoundaryCondition *bc, int bcIndex, int bcListIndex, int border, GmpFemMatrixSet &elemMatrices, GmpFemVectorSet &elemVectors)
Fills the element force vector elemF for element 'e', taking into account fixed flux boundary conditi...
Definition gmpChemicalInterface.cpp:156
virtual bool reactionRate(const GmElement *e, const GmVector *ip, int ipIndex, const GmVector &N, const GmVector &C, double wtJ, GmVector &elemFe, GmMatrix &elemK, bool needsFe, bool needsK)
Reaction rate term based on a fixed element property. See the parameters description on the base clas...
Definition gmpChemicalInterface.cpp:676
virtual void fillElementConcentration(const GmElement *e, GmVector &pe)
Given an element, fills the vector pe with nodal pore pressure.
Definition gmpChemicalInterface.cpp:691
virtual GmpFemPhysics::FemResultType fillElementData(const GmElement *e, GmpFemMatrixSet &elemMatrices, GmpFemVectorSet &elemVectors)
Fills the element matrices and vectors for a generic Interface element.
Definition gmpChemicalInterface.cpp:450
BoundaryConditionValueIds
IDs for property values from accepted boundary condition types.
Definition gmpChemicalInterface.h:125
@ BC_C_INT_ID
Nodal concentration for fixed concentration boundary condition on cell.
Definition gmpChemicalInterface.h:126
@ BC_Q_POS_ID
BC Id for edge/face on cell where is fixed the flux.
Definition gmpChemicalInterface.h:130
@ BC_Q_INT_ID
Concentration flux for fixed concentration flux boundary condition on cell.
Definition gmpChemicalInterface.h:127
@ BC_C_POS_ID
BC Id for edge/face on cell where is fixed the concentration.
Definition gmpChemicalInterface.h:129
virtual void fillStorageCompMatrix(const GmElement *e, const GmVector *coord, int ip, GmMatrix &Sc, const GmVector &N, double phi, double k, double c) const
Calculates the compressibility matrix inside the fracture.
Definition gmpChemicalInterface.cpp:771
virtual void fillDiffusionMatrix(const GmElement *e, GmMatrix &Kc, const GmMatrix &Bp, const GmMatrix &D, const GmVector &v, const GmVector &N, double phi, double c, int ns)
Calculates the flow stiffness matrix according to the cubic law.
Definition gmpChemicalInterface.cpp:857
virtual ~GmpChemicalInterface()
Destructor.
Definition gmpChemicalInterface.cpp:49
GmCellType
arma::mat GmMatrix
#define S_TRACE()
arma::vec GmVector
Declaration of the GmpChemicalFemPhysics classes.