OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
hydram.h
Go to the documentation of this file.
1 /* TODO:
2  * 4/2/2004
3  * need to return a matrix of derivatives
4  * dHeat/dT, dHeat/dw
5  * dWater/dT, dWater/dw
6  * (or something like that) to enable quadratic convergence of the global iteration with respect to the heat and water internal source.
7  * now I have only double dHeatdT(ksi, T, dt) - internal, no water dependence. To master material, the hydration model must provide the derivatives based on the internal state of hydration.
8  *
9  * 12/1:
10  * - track versions - save intermediate versions of modified files in separate folders!
11  * 11/1:
12  * - where to choose, which HydrationModel to create? HydrationModelInterface->constructor can't know the type of hydram
13  * but HydrationModelInterface->initializeFrom(ir) can select and create the appropriate hydration model
14  * maybe it should be added to usrdefsub.C
15  * x try to eliminate HydrationModelStatusInterface, to enable use of different status classes without redefining (sm / tm)
16  * will not do, master status must have reference to HydrationModelStatus
17  * tm status will be defined by simply inheriting from TransportMaterialStatus && HydrationModelStatusInterface
18  * - where to put gp hydration degree access routines? Master material->hmInterface->giveTempKsi or hydrationModel->giveTempHydrationDegree(gp)
19  * 10/1:
20  * - cleanly: base class HydrationModelStatus + HydrationModel, defining interface data and services, derive HellmichHydrationModel etc.
21  * - water content influence on hydration -
22  * moisture consumption (stoichiometry of c-s-h?) -> computeInternalSourceVector(+heat,-water content)
23  * - affinity function from CEMHYD3D results: ksi(t)-> dksidt(ksi)->A(ksi) - \
24  * - real-time from CEMHYD3D (better not all IP, only selected range) -/ needs CEMHYD3D input preprocessor for generating microstructure (VCCTL?) or input microstructure data
25  * - or add alcali reaction
26  * - hydration interpolated from CEMHYD3D with moisture and temperature
27  * needs several hydration model / master material managed statuses and services for interpolating hydration degree for given coordinates
28  */
29 
30 /*
31  * USAGE:
32  *
33  * use multiple inheritance from HydrationModelInterface and HydrationModelStatusInterface.
34  *
35  * add HydrationModelInterface to material:
36  * constructor
37  * initializeFrom
38  * saveContext / restoreContext
39  * TransportMaterial::giveCharacteristicValue
40  * use HMI::updateInternalState(tempStateVector, GaussPoint, TimeStep) to update the hydration status
41  *
42  * add HydrationModelStatusInterface to status:
43  * constructor
44  * updateYourself
45  * printOutputAt
46  * add giveInterface
47  *
48  * then the following services are available:
49  * giveHydrationDegree(GaussPoint, TimeStep, ValueModeType)
50  * computeInternalSourceVector(sourceVector, GaussPoint, TimeStep, ValueModeType)
51  * computeIntSourceLHSCoeff(MAtResponseMode, GaussPoint, TimeStep)
52  *
53  * missing - consistent tangent, see TODO
54  *
55  */
56 
57 // class HydrationModel - returns hydration degree ... dksi(ksi, dt, T) ... localResidual, Affinity
58 // ( - for non-isothermal analysis hydrationHeat, capacitycoeff(ksi, dt, T) ... dksidT, dksidh, dAdksi
59 
60 // Concrete hydration model - Hellmich
61 // Material extension, derived from Material to use MateriaStatus services
62 
63 // material->computeInternalSourceVector(val, gp, tStep, mode)
64 // answer, chartypemode - total, velocity, acceleration, incremental
65 // = le*dksi
66 
67 // capacity ... material->giveCharacteristicValue(rmode, gp, tStep)
68 // rmode: material responsemode = capacity
69 // = rc - le*dksidT
70 
71 
72 #ifndef hydram_h
73 #define hydram_h
74 
75 #include "floatarray.h"
76 #include "floatmatrix.h"
77 #include "timestep.h"
78 #include "material.h"
79 #include "interface.h"
80 #include "valuemodetype.h"
81 
82 #include <memory>
83 
85 
86 #define _IFT_HydrationModel_Name "hydrationmodel"
87 #define _IFT_HydrationModel_hydration "hydration"
88 #define _IFT_HydrationModel_c60mix "c60mix"
89 #define _IFT_HydrationModel_timeScale "timescale"
90 #define _IFT_HydrationModel_hheat "hheat"
91 #define _IFT_HydrationModel_cv "cv"
92 #define _IFT_HydrationModel_water "water"
93 
94 
96 
97 #define _IFT_HydrationModelInterface_hydration "hydration"
98 #define _IFT_HydrationModelInterface_castAt "castat"
99 
100 
101 namespace oofem {
102 #define ROOT_PRECISION_DKSI 1e-14
103 #define BINARY_TREE_STEPS 2
104 
105 // default time steps for evaluating the hydration degree increment
106 #define HYDRATION_MAXSTEP0 3600 //600
107 #define HYDRATION_MAXSTEP1 86400 //3600
108 
109 
110 // =========== Hydration Model Status class ============
117 {
118 protected:
119  // hydration degree at beginning of current time step
121  // hydration degree at end of current time step (or during equilibrium iteration)
123 
124 public:
125  HydrationModelStatus(int n, Domain * d, GaussPoint * g);
126  virtual ~HydrationModelStatus() { }
127 
132  void setHydrationDegree(double v) { hydrationDegree = v; }
133  void setTempHydrationDegree(double v) { tempHydrationDegree = v; }
134 
135  virtual void initTempStatus();
136  virtual void updateYourself(TimeStep *tStep);
137 
138  virtual void printOutputAt(FILE *file, TimeStep *tStep);
139  virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj = NULL);
140  virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj = NULL);
141 
142  // --- identification and auxiliary functions ---
143  virtual const char *giveClassName() const { return "HydrationModelStatus"; }
144 };
145 
146 
147 // =========== Hydration Model class ============
148 
149 enum FindRootMethod { frRegula = 1, frBinTree = 2, frMixed = 3 };
151 
152 // derived from material to use status services
153 class HydrationModel : public Material
154 {
155 protected:
159  double hydrationStartMaxStep, hydrationEndMaxStep;
163  double timeScale;
164 
165  // === Material parameters ===
166  double aa,
167  ba,
168  ca,
169  da,
170 
171  e0,
172  ear,
173  le,
174  cv,
175  we;
176 
177  // === Hydration degree increment evaluation ===
178  // auxiliary values to enable external root finding method without passing them as parameters in each call
180  double auxksi, auxdt, auxT, auxh;
181  double localResidual(double dks); // G(dksi) 4.12
182 
183  // Auxiliary functions - root finding
185  double regulafindroot();
186  double bintreefindroot();
187  double mixedfindroot();
188 
189  // === Material functions ===
191  double affinity(double ksi);
193  double dAdksi(double ksi);
194  double dksidT(double ksi, double T, double h, double dt);
195  double dksidh(double ksi, double T, double h, double dt);
196 
198  double computeIntSource(const FloatArray &vec, GaussPoint *gp, TimeStep *tStep, MatResponseMode rmode);
204  double computeHydrationDegreeIncrement(double ksi, double T, double h, double dt);
205 
206 public:
209  HydrationModel();
213  virtual ~HydrationModel() { }
214 
215 
216  // === Hydration model services ===
217 
219  void setMixture(MixtureType mix);
220 
229 
238  double giveHydrationDegree(GaussPoint *gp, TimeStep *tStep, ValueModeType mode);
239 
240  // how to determine whether hydration degree is uptodate?
241  // - in tm, this can be ensured by calling computeHydrationDegreeIncrement when updateInternalState is used
242  // - in sm, the tm state changes only at the start of each step (now updateAuxState - 'auxiliary', because the data is copied from tm analysis)
243  // where to get temperature / moisture? from gp->status->giveTempStateVector(val) => val[T,w]
244  // => implement updateInternalState here, that is called from master material updateInternalState/updateAuxState
245  // use giveTempStateVector in HellmichMaterial
252  virtual void updateInternalState(const FloatArray &vec, GaussPoint *gp, TimeStep *tStep);
253 
262  virtual MaterialStatus *giveStatus(GaussPoint *gp) const;
263 
265  void computeInternalSourceVector(FloatArray &val, GaussPoint *gp, TimeStep *tStep, ValueModeType mode);
266  // } end new 5.1.2004
268  virtual double giveCharacteristicValue(const FloatArray &vec, MatResponseMode rmode, GaussPoint *gp, TimeStep *tStep);
269  // --- identification and auxiliary functions ---
270  virtual const char *giveInputRecordName() const { return _IFT_HydrationModel_Name; }
271  virtual const char *giveClassName() const { return "HydrationModel"; }
272 
273 protected:
275  virtual MaterialStatus *CreateStatus(GaussPoint *gp) const;
276 };
277 
278 // =========== Interfaces for materials using the hydration model ============
280 {
281 protected:
283  std :: unique_ptr< HydrationModelStatus > hydrationModelStatus;
284 public:
289 
291  HydrationModelStatus *giveHydrationModelStatus() { return hydrationModelStatus.get(); }
293  void setHydrationModelStatus(HydrationModelStatus *s) { hydrationModelStatus.reset(s); }
294 
296  void updateYourself(TimeStep *tStep);
298  void printOutputAt(FILE *file, TimeStep *tStep);
299 };
300 
302 {
303  // interface for material access to HydrationModel
304 protected:
306  std :: unique_ptr< HydrationModel > hydrationModel;
308  double castAt;
311 
312 public:
314  HydrationModel *giveHydrationModel() { return hydrationModel.get(); }
322 
323  contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj = NULL)
324  {
325  if ( hydrationModel ) {
326  hydrationModel->saveContext(stream, mode, obj);
327  }
328 
329  return CIO_OK;
330  }
331  contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj = NULL)
332  {
333  if ( hydrationModel ) {
334  hydrationModel->restoreContext(stream, mode, obj);
335  }
336 
337  return CIO_OK;
338  }
339 
347  virtual void updateInternalState(const FloatArray &vec, GaussPoint *gp, TimeStep *tStep);
356  double giveHydrationDegree(GaussPoint *gp, TimeStep *tStep, ValueModeType mode);
357 };
358 } // end namespace oofem
359 #endif // hydram_h
HydrationModelStatus * giveHydrationModelStatus()
Returns the associated hydration model status.
Definition: hydram.h:291
contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Definition: hydram.h:331
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Print receiver&#39;s output to given stream.
Definition: hydram.C:45
GaussPoint * gp
Associated integration point.
Class and object Domain.
Definition: domain.h:115
The purpose of DataStream abstract class is to allow to store/restore context to different streams...
Definition: datastream.h:54
ValueModeType
Type representing the mode of UnknownType or CharType, or similar types.
Definition: valuemodetype.h:78
virtual const char * giveClassName() const
Definition: hydram.h:271
virtual void initTempStatus()
Initializes the temporary internal variables, describing the current state according to previously re...
Definition: hydram.C:51
void setTempHydrationDegree(double v)
Definition: hydram.h:133
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
Definition: hydram.C:76
#define _IFT_HydrationModel_Name
Definition: hydram.h:86
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
Definition: hydram.C:88
virtual ~HydrationModelInterface()
Destructor. Deletes the associated hydration model.
Definition: hydram.h:316
MatResponseMode
Describes the character of characteristic material matrix.
contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Definition: hydram.h:323
MixtureType
Definition: hydram.h:150
double constantHydrationDegree
Constant hydration degree for analysis without hydration model.
Definition: hydram.h:310
virtual ~HydrationModel()
Destructor.
Definition: hydram.h:213
std::unique_ptr< HydrationModelStatus > hydrationModelStatus
Reference to associated hydration model status.
Definition: hydram.h:283
HydrationModelStatusInterface()
Constructor. Nulls the hydrationModelStatus pointer.
Definition: hydram.h:286
HydrationModel * giveHydrationModel()
Returns the associated hydration model.
Definition: hydram.h:314
void setHydrationModelStatus(HydrationModelStatus *s)
Sets the associated hydration model status. Analogue to gp->setMaterialStatus.
Definition: hydram.h:293
std::unique_ptr< HydrationModel > hydrationModel
Reference to the associated hydrationModel instance.
Definition: hydram.h:306
double giveTempHydrationDegree()
Returns the temp hydration degree.
Definition: hydram.h:129
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: matstatus.h:140
double giveHydrationDegree()
Returns the non-temp hydration degree. Used for step restart and postprocessing.
Definition: hydram.h:131
FindRootMethod useFindRoot
Definition: hydram.h:207
Abstract base class for all material models.
Definition: material.h:95
Abstract base class representing a material status information.
Definition: matstatus.h:84
double initialHydrationDegree
!! initial hydration degree - set in initialize From, but not used
Definition: hydram.h:161
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
Definition: hydram.C:68
Class representing vector of real numbers.
Definition: floatarray.h:82
MixtureType mixture
Used concrete mixture.
Definition: hydram.h:157
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
virtual const char * giveClassName() const
Definition: hydram.h:143
Class representing the general Input Record.
Definition: inputrecord.h:101
virtual ~HydrationModelStatusInterface()
Destructor. Deletes the associated hydration model status.
Definition: hydram.h:288
Class Interface.
Definition: interface.h:82
This class implements associated Status to HydrationModel.
Definition: hydram.h:116
long ContextMode
Context mode (mask), defining the type of information written/read to/from context.
Definition: contextmode.h:43
HydrationModelStatus(int n, Domain *d, GaussPoint *g)
Definition: hydram.C:38
void setHydrationDegree(double v)
Definition: hydram.h:132
the oofem namespace is to define a context or scope in which all oofem names are defined.
double castAt
Material cast time - start of hydration.
Definition: hydram.h:308
double we
Total water consumption for hydration [kg/m3].
Definition: hydram.h:166
virtual ~HydrationModelStatus()
Definition: hydram.h:126
Class representing integration point in finite element program.
Definition: gausspoint.h:93
Class representing solution step.
Definition: timestep.h:80
FindRootMethod
Definition: hydram.h:149
double hydrationStartMaxStep
Time step lenghts at zero and complete hydration.
Definition: hydram.h:159
virtual const char * giveInputRecordName() const
Definition: hydram.h:270
double timeScale
time scale - used for time input in other units than seconds
Definition: hydram.h:163

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:29 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011