OOFEM 3.0
Loading...
Searching...
No Matches
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"
94
96
97#define _IFT_HydrationModelInterface_hydration "hydration"
98#define _IFT_HydrationModelInterface_castAt "castat"
100
101namespace 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{
118protected:
119 // hydration degree at beginning of current time step
120 double hydrationDegree = 0.;
121 // hydration degree at end of current time step (or during equilibrium iteration)
123
124public:
126
130 double giveHydrationDegree() const { return hydrationDegree; }
131 void setHydrationDegree(double v) { hydrationDegree = v; }
133
134 void initTempStatus() override;
135 void updateYourself(TimeStep *tStep) override;
136
137 void printOutputAt(FILE *file, TimeStep *tStep) const override;
138 void saveContext(DataStream &stream, ContextMode mode) override;
139 void restoreContext(DataStream &stream, ContextMode mode) override;
140
141 const char *giveClassName() const override { return "HydrationModelStatus"; }
142};
143
144
145// =========== Hydration Model class ============
146
149
150// derived from material to use status services
152{
153protected:
161 double timeScale = 0.;
162
163 // === Material parameters ===
164 double aa = 0.,
165 ba = 0.,
166 ca = 0.,
167 da = 0.,
168
169 e0 = 0.,
170 ear = 0.,
171 le = 0.,
172 cv = 0.,
173 we = 0.;
174
175 // === Hydration degree increment evaluation ===
176 // auxiliary values to enable external root finding method without passing them as parameters in each call
179 double localResidual(double dks) const; // G(dksi) 4.12
180
181 // Auxiliary functions - root finding
183 double regulafindroot() const;
184 double bintreefindroot() const;
185 double mixedfindroot() const;
186
187 // === Material functions ===
189 double affinity(double ksi) const;
191 double dAdksi(double ksi) const;
192 double dksidT(double ksi, double T, double h, double dt) const;
193 double dksidh(double ksi, double T, double h, double dt) const;
194
196 double computeIntSource(double T, double h, GaussPoint *gp, TimeStep *tStep, MatResponseMode rmode) const;
202 double computeHydrationDegreeIncrement(double ksi, double T, double h, double dt);
203
204public:
210
211 // === Hydration model services ===
212
214 void setMixture(MixtureType mix);
215
223 void initializeFrom(InputRecord &ir) override;
224
233 double giveHydrationDegree(GaussPoint *gp, TimeStep *tStep, ValueModeType mode) const;
234
235 // how to determine whether hydration degree is uptodate?
236 // - in tm, this can be ensured by calling computeHydrationDegreeIncrement when updateInternalState is used
237 // - in sm, the tm state changes only at the start of each step (now updateAuxState - 'auxiliary', because the data is copied from tm analysis)
238 // where to get temperature / moisture? from gp->status->giveTempStateVector(val) => val[T,w]
239 // => implement updateInternalState here, that is called from master material updateInternalState/updateAuxState
240 // use giveTempStateVector in HellmichMaterial
247 virtual void updateInternalState(const FloatArray &vec, GaussPoint *gp, TimeStep *tStep);
248
257 MaterialStatus *giveStatus(GaussPoint *gp) const override;
258
260 void computeInternalSourceVector(FloatArray &val, GaussPoint *gp, TimeStep *tStep, ValueModeType mode) const;
261 // } end new 5.1.2004
263 virtual double _giveCharacteristicValue(double T, double h, MatResponseMode rmode, GaussPoint *gp, TimeStep *tStep) const;
264 // --- identification and auxiliary functions ---
265 const char *giveInputRecordName() const override { return _IFT_HydrationModel_Name; }
266 const char *giveClassName() const override { return "HydrationModel"; }
267
269 std::unique_ptr<MaterialStatus> CreateStatus(GaussPoint *gp) const override;
270};
271
272// =========== Interfaces for materials using the hydration model ============
274{
275protected:
277 std :: unique_ptr< MaterialStatus > hydrationModelStatus;
278
279public:
282
286 HydrationModelStatus* setHydrationModelStatus(std::unique_ptr<MaterialStatus> s) { hydrationModelStatus = std::move(s); return static_cast<HydrationModelStatus*> (hydrationModelStatus.get()); }
287
289 void updateYourself(TimeStep *tStep);
291 void printOutputAt(FILE *file, TimeStep *tStep) const;
292};
293
295{
296 // interface for material access to HydrationModel
297protected:
299 std :: unique_ptr< HydrationModel > hydrationModel;
301 double castAt = 0.;
304
305public:
312 virtual void initializeFrom(InputRecord &ir);
313
315 {
316 if ( hydrationModel ) {
317 hydrationModel->saveContext(stream, mode);
318 }
319 }
321 {
322 if ( hydrationModel ) {
323 hydrationModel->restoreContext(stream, mode);
324 }
325 }
326
334 virtual void updateInternalState(const FloatArray &vec, GaussPoint *gp, TimeStep *tStep);
343 double giveHydrationDegree(GaussPoint *gp, TimeStep *tStep, ValueModeType mode) const;
344};
345} // end namespace oofem
346#endif // hydram_h
HydrationModel * giveHydrationModel()
Returns the associated hydration model.
Definition hydram.h:307
virtual void initializeFrom(InputRecord &ir)
Definition hydram.C:570
std ::unique_ptr< HydrationModel > hydrationModel
Reference to the associated hydrationModel instance.
Definition hydram.h:299
double giveHydrationDegree(GaussPoint *gp, TimeStep *tStep, ValueModeType mode) const
Definition hydram.C:626
double castAt
Material cast time - start of hydration.
Definition hydram.h:301
double constantHydrationDegree
Constant hydration degree for analysis without hydration model.
Definition hydram.h:303
void restoreContext(DataStream &stream, ContextMode mode)
Definition hydram.h:320
void saveContext(DataStream &stream, ContextMode mode)
Definition hydram.h:314
virtual void updateInternalState(const FloatArray &vec, GaussPoint *gp, TimeStep *tStep)
Definition hydram.C:606
void printOutputAt(FILE *file, TimeStep *tStep) const
Outputs the status variables.
Definition hydram.C:560
void updateYourself(TimeStep *tStep)
Updates the equilibrium variables to temporary values.
Definition hydram.C:552
HydrationModelStatusInterface()
Constructor. Nulls the hydrationModelStatus pointer.
Definition hydram.h:281
HydrationModelStatus * giveHydrationModelStatus()
Returns the associated hydration model status.
Definition hydram.h:284
std ::unique_ptr< MaterialStatus > hydrationModelStatus
Reference to associated hydration model status.
Definition hydram.h:277
HydrationModelStatus * setHydrationModelStatus(std::unique_ptr< MaterialStatus > s)
Sets the associated hydration model status. Analogue to gp->setMaterialStatus.
Definition hydram.h:286
void printOutputAt(FILE *file, TimeStep *tStep) const override
Print receiver's output to given stream.
Definition hydram.C:41
HydrationModelStatus(GaussPoint *g)
Definition hydram.C:38
void setTempHydrationDegree(double v)
Definition hydram.h:132
void initTempStatus() override
Definition hydram.C:47
void updateYourself(TimeStep *tStep) override
Definition hydram.C:64
void restoreContext(DataStream &stream, ContextMode mode) override
Definition hydram.C:81
double giveHydrationDegree() const
Returns the non-temp hydration degree. Used for step restart and postprocessing.
Definition hydram.h:130
void setHydrationDegree(double v)
Definition hydram.h:131
void saveContext(DataStream &stream, ContextMode mode) override
Definition hydram.C:72
double giveTempHydrationDegree() const
Returns the temp hydration degree.
Definition hydram.h:128
const char * giveClassName() const override
Definition hydram.h:141
double dAdksi(double ksi) const
Returns the derivation of chemical affinity dA~/dksi(ksi).
Definition hydram.C:222
void setMixture(MixtureType mix)
Sets the mixture type and appropriate material parameters.
Definition hydram.C:165
FindRootMethod useFindRoot
Definition hydram.h:205
void initializeFrom(InputRecord &ir) override
Definition hydram.C:110
double computeHydrationDegreeIncrement(double ksi, double T, double h, double dt)
Definition hydram.C:322
double we
Total water consumption for hydration [kg/m3].
Definition hydram.h:173
void computeInternalSourceVector(FloatArray &val, GaussPoint *gp, TimeStep *tStep, ValueModeType mode) const
Returns generated heat for given gp [kJ/m3], eventually water consumption.
Definition hydram.C:294
virtual double _giveCharacteristicValue(double T, double h, MatResponseMode rmode, GaussPoint *gp, TimeStep *tStep) const
Returns coefficients for LHS contribution from internal sources (dHeat/dT, dWaterSource/dw) for given...
Definition hydram.C:308
double initialHydrationDegree
!! initial hydration degree - set in initialize From, but not used
Definition hydram.h:159
double mixedfindroot() const
Definition hydram.C:501
double ear
Activation term [K].
Definition hydram.h:170
std::unique_ptr< MaterialStatus > CreateStatus(GaussPoint *gp) const override
Creates and returns new HydrationModelStatus instance.
Definition hydram.C:545
double hydrationStartMaxStep
Time step lenghts at zero and complete hydration.
Definition hydram.h:157
double regulafindroot() const
Definition hydram.C:454
double e0
ksi_0.
Definition hydram.h:169
double bintreefindroot() const
Definition hydram.C:477
double le
Latent heat [kJ/m3].
Definition hydram.h:171
double giveHydrationDegree(GaussPoint *gp, TimeStep *tStep, ValueModeType mode) const
Definition hydram.C:400
double auxksi
!! possible problem for parallel computation, performance???
Definition hydram.h:178
MixtureType mixture
Used concrete mixture.
Definition hydram.h:155
double timeScale
time scale - used for time input in other units than seconds
Definition hydram.h:161
double affinity(double ksi) const
Returns the normalized chemical affinity A~(ksi) [1/s].
Definition hydram.C:211
double computeIntSource(double T, double h, GaussPoint *gp, TimeStep *tStep, MatResponseMode rmode) const
Computes and returns the derivatives of the material-generated Internal Source with respect to the tm...
Definition hydram.C:361
double aa
Normalized chemical affinity regression function coefficients.
Definition hydram.h:164
virtual void updateInternalState(const FloatArray &vec, GaussPoint *gp, TimeStep *tStep)
Definition hydram.C:413
MaterialStatus * giveStatus(GaussPoint *gp) const override
Definition hydram.C:270
const char * giveInputRecordName() const override
Definition hydram.h:265
double cv
Input cement content kg/m3 for evaluation of total water consumption.
Definition hydram.h:172
double dksidT(double ksi, double T, double h, double dt) const
Definition hydram.C:243
double localResidual(double dks) const
Definition hydram.C:236
double dksidh(double ksi, double T, double h, double dt) const
Definition hydram.C:258
double hydrationEndMaxStep
Definition hydram.h:157
const char * giveClassName() const override
Definition hydram.h:266
HydrationModel()
Constructor.
Definition hydram.C:93
Interface()
Constructor.
Definition interface.h:86
MaterialStatus(GaussPoint *g)
Definition matstatus.h:91
Material(int n, Domain *d)
Definition material.C:46
#define _IFT_HydrationModel_Name
Definition hydram.h:86
long ContextMode
Definition contextmode.h:43
FindRootMethod
Definition hydram.h:147
@ frRegula
Definition hydram.h:147
@ frMixed
Definition hydram.h:147
@ frBinTree
Definition hydram.h:147
MixtureType
Definition hydram.h:148
@ mtC100
Definition hydram.h:148
@ mtLafarge
Definition hydram.h:148
@ mtC60
Definition hydram.h:148
@ mtHuber
Definition hydram.h:148

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011