OOFEM 3.0
Loading...
Searching...
No Matches
cemhydmat.h
Go to the documentation of this file.
1/*
2 *
3 * ##### ##### ###### ###### ### ###
4 * ## ## ## ## ## ## ## ### ##
5 * ## ## ## ## #### #### ## # ##
6 * ## ## ## ## ## ## ## ##
7 * ## ## ## ## ## ## ## ##
8 * ##### ##### ## ###### ## ##
9 *
10 *
11 * OOFEM : Object Oriented Finite Element Code
12 *
13 * Copyright (C) 1993 - 2025 Borek Patzak
14 *
15 *
16 *
17 * Czech Technical University, Faculty of Civil Engineering,
18 * Department of Structural Mechanics, 166 29 Prague, Czech Republic
19 *
20 * This library is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU Lesser General Public
22 * License as published by the Free Software Foundation; either
23 * version 2.1 of the License, or (at your option) any later version.
24 *
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28 * Lesser General Public License for more details.
29 *
30 * You should have received a copy of the GNU Lesser General Public
31 * License along with this library; if not, write to the Free Software
32 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
33 */
34
35#ifndef CemhydMat_h
36#define CemhydMat_h
37
38/*CEMHYD3D v 3.0 has been developed at NIST, programmed by D.P.Bentz*/
39/*modified to an object-oriented version by smilauer@cml.fsv.cvut.cz*/
40
41#include "mathfem.h"
42#include <cstdio>
43#include <string>
44#include <cstring>
45
46#include <tinyxml2.h>
47
48using namespace tinyxml2;
49
50#define TINYXML //read CEMHYD3D input file through tinyXML library
51
52#ifdef __TM_MODULE //OOFEM transport module
53 #include "domain.h"
55#endif
56
58
59#define _IFT_CemhydMat_Name "cemhydmat"
60#define _IFT_CemhydMat_conductivitytype "conductivitytype"
61#define _IFT_CemhydMat_capacitytype "capacitytype"
62#define _IFT_CemhydMat_densitytype "densitytype"
63#define _IFT_CemhydMat_eachgp "eachgp"
64#define _IFT_CemhydMat_nowarnings "nowarnings"
65#define _IFT_CemhydMat_scaling "scaling"
66#define _IFT_CemhydMat_reinforcementDegree "reinforcementdegree"
67#define _IFT_CemhydMat_inputFileName "file"
69
70namespace oofem {
71typedef struct FCOMPLEX {
72 float r, i;
74
89class CemhydMatStatus;
90
91#ifdef __TM_MODULE //OOFEM transport module
93{
94public:
96 CemhydMat(int n, Domain * d);
98 const char *giveInputRecordName() const override { return _IFT_CemhydMat_Name; }
99 const char *giveClassName() const override { return "CemhydMat"; }
100
101 bool hasInternalSource() const override { return true; }
102 void computeInternalSourceVector(FloatArray &val, GaussPoint *gp, TimeStep *tStep, ValueModeType mode) const override;
104 virtual int giveCycleNumber(GaussPoint *gp);
106 virtual double giveTimeOfCycle(GaussPoint *gp);
108 virtual double giveDoHActual(GaussPoint *gp);
110 double giveIsotropicConductivity(GaussPoint *gp, TimeStep *tStep) const override;
112 virtual double giveConcreteCapacity(GaussPoint *gp, TimeStep *tStep) const;
114 virtual double giveConcreteDensity(GaussPoint *gp, TimeStep *tStep) const;
115
117 double giveCharacteristicValue(MatResponseMode mode, GaussPoint *gp, TimeStep *tStep) const override;
118
119 int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep) override;
120 int initMaterial(Element *element) override;
122 virtual void clearWeightTemperatureProductVolume(Element *element);
124 virtual void storeWeightTemperatureProductVolume(Element *element, TimeStep *tStep);
126 virtual void averageTemperature();
127
128 void initializeFrom(InputRecord &ir) override;
140 std :: string XMLfileName;
141 MaterialStatus *CreateStatus(GaussPoint *gp) const override;
147};
148#endif
149
150
151#ifdef __TM_MODULE //OOFEM transport module
153{
154public:
164 CemhydMatStatus(GaussPoint * gp, CemhydMatStatus * CemStat, CemhydMat * cemhydmat, bool withMicrostructure);
165 virtual ~CemhydMatStatus();
166 //Interface *giveInterface(InterfaceType) override;
167 const char *giveClassName() const override { return "CemhydMatStatus"; }
168 void updateYourself(TimeStep *tStep) override;
169 void printOutputAt(FILE *file, TimeStep *tStep) const override;
170#elif CEMPY
171 #define OUTFILES
172 #define IMAGEFILES
173 #define PRINTF
174class CemhydMatStatus
175{
176public:
179 void InitializePy(const char *inp);
180#endif
181 FILE *in;
182 void initializeMicrostructure(void);
183 void read(char *inp);
184 double GivePower(double GiveTemp, double TargTime);
185 double MoveCycles(double GiveTemp, int cycles);
186 int MoveToDoH(double GiveTemp, double DesiredDoH, int maxcyc);
187 int MoveToTime(double GiveTemp, double TargTime);
188 double GiveTotCemHeat(void);
189 double GiveTotHeat(void);
190 double GiveCp(void);
191 double computeConcreteCapacityBentz(void);
192 double GiveDensity(void);
193 double GiveDoHLastCyc(void);
195 double GiveDoHActual(void);
196 int GiveCycNum(void);
197 double GiveCycTime(void);
198 void CreateHDCSH(void);
199 void PercolateForOutput(void);
200 double GiveWcr(void);
201 void GetInputParams(char *my_string);
203 void AnalyticHomogenizationPaste(double &E, double &nu, int perc_unperc_flag);
204 void AnalyticHomogenizationConcrete(double E_paste_inp, double nu_paste_inp, double *E_paste, double *nu_paste, double *E_mortar, double *nu_mortar, double &E_concrete, double &nu_concrete);
205 void GetInitClinkerPhases(double &c3s, double &c2s, double &c3a, double &c4af, double &gypsum, double &hemi, double &anh);
206
210 double IPVolume;
213
215 void setAverageTemperatureVolume(double temperature, double volume) {
216 averageTemperature = temperature;
218 }
219 // Auxiliary function
220 double giveAverageTemperature(void);
221 // Auxiliary function
222 double giveTotalVolume(void) { return IPVolume; }
223
224 int readInputFileAndInitialize(const char *inp, bool generateMicrostructure);
227
228 //disrealnew_30, burn3d, burnset, hydreal, burn_phases, nrutils, complex
229 int ***mic_CSH;
230 int ***ArrPerc;
232 double *PhaseFrac;
233 //double E_CSH_hmg,nu_CSH_hmg;
234 //double E_CSH_hmg;
235 //double SH_hmg_1;
239 double PartHeat;
240 /* Parameters for kinetic modelling ---- maturity approach */
243 int icyc;
245 double *last_values;
248private:
249#ifdef __TM_MODULE //OOFEM transport module
251 GaussPoint * gp;
252#endif
254 /*define dimension size for image reconstruction and hydration*/
255 /*Following parameters may be changed if you know what they are for*/
256 int NEIGHBORS; /* number of neighbors to consider (6, 18, or 26) in dissolution */
257
258 int BoxSize; /*int describing vicinity of CSH*/
259 int SolidLimit; /*how many solid phase voxels must be in a box (max. <=(2*BoxSize+1)^3)*/
260 long MAXTRIES; /* maximum number of random tries for sphere placement */
261 long int MAXCYC_SEAL; /* Maximum number of cycles of sealed hydration (originally MAXCYC in disrealnew.c */
262
263 /*Following parameters should not be changed*/
265
266 /* Note that each particle must have a separate ID to allow for flocculation */
267 int CEM; /* and greater */
268 int CEMID; /* phase identifier for cement */
269 int C2SID; /* phase identified for C2S cement */
270 int GYPID; /* phase identifier for gypsum */
271 int HEMIHYDRATE; /* phase identifier for hemihydrate */
272 int POZZID; /* phase identifier for pozzolanic material */
273 int INERTID; /* phase identifier for inert material */
274 int SLAGID; /* phase identifier for slag */
275 int AGG; /* phase identifier for flat aggregate */
276 int FLYASH; /* phase identifier for all fly ash components */
277
278 long NPARTC;
279 long BURNTG; /* this value must be at least 100 > NPARTC */
280 int NUMSIZES; /* maximum number of different particle sizes */
281
282 //+distrib3d
283 long MAXSPH; /* maximum number of elements in a spherical template */
284
285 /*define heat capacities for all components in J/g/C*/
286 /*including free and bound water*/
287 double Cp_pozz;
288 double Cp_CH;
289 double Cp_h2o; /* Cp for free water */
290 double Cp_bh2o; /* Cp for bound water */
291 double WN; /* water bound per gram of cement during hydration */
292 double WCHSH; /* water imbibed per gram of cement during chemical shrinkage (estimate) */
293
295 int CUBEMIN; /* Minimum cube size for checking pore size */
296 long SYSIZEM1; /* System size -1 */
297
298 double DISBIAS; /* Dissolution bias- to change all dissolution rates */
299 double DISMIN; /* Minimum dissolution for C3S dissolution */
300 double DISMIN2; /* Minimum dissolution for C2S dissolution */
301 double DISMINSLAG; /* Minimum dissolution for SLAG dissolution */
302 double DISMINASG; /* Minimum dissolution for ASG dissolution */
303 double DISMINCAS2; /* Minimum dissolution for CAS2 dissolution */
304 double DISMIN_C3A_0; /* Minimum dissolution for C3A dissolution */
305 double DISMIN_C4AF_0; /* Minimum dissolution for C4AF dissolution */
306 double DETTRMAX;
307 double DGYPMAX;
308 double DCACO3MAX;
309 double DCACL2MAX;
310 double DCAS2MAX;
311 double CHCRIT;
312 double C3AH6CRIT;
313 double C3AH6GROW; /* Probability for C3AH6 growth */
314 double CHGROW; /* Probability for CH growth */
315 double CHGROWAGG; /* Probability for CH growth on aggregate surface */
316 double ETTRGROW; /* Probability for ettringite growth */
317 double C3AETTR; /* Probability for reaction of diffusing C3A with ettringite */
318 double C3AGYP; /* Probability for diffusing C3A to react with diffusing gypsum */
319 /* diffusing anhydrite, and diffusing hemihydrate */
320 double SOLIDC3AGYP; /* Probability of solid C3A to react with diffusing sulfate */
321 double SOLIDC4AFGYP; /* Probability of solid C4AF to react with diffusing sulfate */
322 double PPOZZ; /* base probability for pozzolanic reaction */
323 double PCSH2CSH; /* probability for CSH dissolution */
324 /* for conversion of C-S-H to pozz. C-S-H */
325 double A0_CHSOL; /* Parameters for variation of CH solubility with */
326 double A1_CHSOL; /* temperature (data from Taylor- Cement Chemistry) */
327 /* changed CSHSCALE to 70000 6/15/01 to better model induction CS */
328 double CSHSCALE; /*scale factor for CSH controlling induction */
329 double C3AH6_SCALE; /*scale factor for C3AH6 controlling induction of aluminates */
330
331 int BURNT; /* label for a burnt pixel <255 (in char type arrays) */
332 long SIZE2D; /* size of matrices for holding burning locations */
333 /* functions defining coordinates for burning in any of three directions */
334 // definition of general equation of plane xy, yz, xz through cube
335 long cx(int x, int y, int z, int a, int b, int c);
336 long cy(int x, int y, int z, int a, int b, int c);
337 long cz(int x, int y, int z, int a, int b, int c);
338
340 double AGRATE; /* Probability of gypsum absorption by CSH */
341 double VOLFACTOR; /* dm per pixel Note- dm*dm*dm = Liters */
342 double MASSFACTOR; /* cm per pixel - specific gravities in g/cm^3 */
343 double MMNa;
344 double MMK;
345 double MMNa2O;
346 double MMK2O;
347 double BNa; /* From Taylor paper in liters (31 mL/1000/ 100 g) */
348 double BK; /* From Taylor paper in liters (20 mL/1000/ 100 g) */
349 double BprimeNa; /* From Taylor paper in liters (3 mL/1000/ 1 g POZZ) */
350 double BprimeK; /* From Taylor paper in liters (3.3 mL/1000/ 1 g POZZ) */
351 double KspCH25C;
352 double KspGypsum;
354 double SpecgravSyngenite; /* Source Taylor, H.F.W., Cement Chemistry */
355 double KperSyn; /* moles of K+ per mole of syngenite */
356
357 double activeA0; /* A at 295 K (from Ken) */
358 double activeB0; /* B at 295 K (from Ken) */
359 /* z are the absolute charges (valences) per ion */
360 double zCa;
361 double zSO4;
362 double zOH;
363 double zNa;
364 double zK;
365 /* a is similar to an ionic radius (in Angstroms) */
366 double aK;
367 double aCa;
368 double aOH;
369 double aNa;
370 double aSO4; /* Estimate as S ionic radii + O ionic diameter */
371 /* Ionic conductivities (From Snyder, Feng, Keen, and Mason) */
372 /* and from CRC Hanbook of Chemistry and Physics (1983) pp. D-175 */
373 /* pore solution conductivity = sum (zi * [i]*lambdai) */
374 /* lambdai = (lambdai_0/(1.+Gi*(Istrength^0.5))) */
375 /* where Istrength is in units of M (mol/L) */
376 double lambdaOH_0; /* Units: S cm-cm eq.^(-1) */
378 double lambdaK_0;
380 double lambdaCa_0; /* Note that CRC has 60./2 for this */
381 double GOH; /* Units: (eq.^2 mol/L)^(-0.5) */
382 double GK;
383 double GNa;
384 double GCa;
385 double GSO4;
386 double cm2perL2m; /* Conversion from cm2/Liter to 1/m */
387 double EPSS;
388 double MAXIT;
389 double EPSP;
390 int MAXM;
391
392 int xoff [ 27 ];
393 int yoff [ 27 ];
394 int zoff [ 27 ];
395
396 //random generator
397 long IA;
398 long IM;
399 long IQ;
400 int IR;
401 int NTAB;
402 double EPS;
403 double NDIV; //= 1.0/(1.0+(IM-1.0)/NTAB);
404 double RNMX; // = (1.0-EPS);
405 double AM; //= (1.0/IM);
406 int iy;
407 int *iv;
408
409 //phases
411 int C3S;
412 int C2S;
413 int C3A;
414 int C4AF;
418 int POZZ;
419 int INERT;
420 int SLAG;
421 int ASG; /* aluminosilicate glass */
422 int CAS2;
423 int CH;
424 int CSH;
425 int C3AH6;
426 int ETTR;
427 int ETTRC4AF; /* Iron-rich stable ettringite phase */
428 int AFM;
429 int FH3;
431 int SLAGCSH; /* Slag gel-hydration product */
432 int CACL2;
433 int FREIDEL; /* Freidel's salt */
434 int STRAT; /* stratlingite (C2ASH8) */
435 int GYPSUMS; /* Gypsum formed from hemihydrate and anhydrite */
436 int CACO3;
437 int AFMC;
453 int EMPTYP; /*Empty porosity due to self desiccation*/
454 int HDCSH;
455 int OFFSET; /*Offset for highlighted potentially soluble pixel*/
456
457 //genpartnew
458 /* Note that each particle must have a separate ID to allow for flocculation */
459 //+distrib3d
460 char ***mic; //char mic [SYSIZE] [SYSIZE] [SYSIZE];
461
462#ifdef TINYXML
463 XMLDocument *xmlFile;
464 void QueryNumAttributeExt(XMLDocument *xmlFile, const char *elementName, int position, int &val);
465 void QueryNumAttributeExt(XMLDocument *xmlFile, const char *elementName, int position, long int &val);
466 void QueryNumAttributeExt(XMLDocument *xmlFile, const char *elementName, const char *key, int &val);
467 void QueryNumAttributeExt(XMLDocument *xmlFile, const char *elementName, int position, double &val);
468 void QueryNumAttributeExt(XMLDocument *xmlFile, const char *elementName, const char *key, double &val);
469 void QueryStringAttributeExt(XMLDocument *xmlFile, const char *elementName, int position, char *chars);
470 int countKey; //counter for many keys in the XML element
471#elif CMLFILE
472 cmlfile *F;
473#endif
474 double ran1(int *idum);
475 void addagg(void);
476 int chksph(int xin, int yin, int zin, int radd, int wflg, int phasein, int phase2);
477 int gsphere(int numgen, long int *numeach, int *sizeeach, int *pheach);
478 int create(void);
479 void drawfloc(int xin, int yin, int zin, int radd, int phasein, int phase2);
480 int chkfloc(int xin, int yin, int zin, int radd);
481 void makefloc(void);
482 void measure(void);
483 void measagg(void);
484 void connect(void);
485 void outmic(void);
486 int genpartnew(void);
487 void alloc_char_3D(char ***( &mic ), long SYSIZE);
488 void dealloc_char_3D(char ***( &mic ), long SYSIZE);
489 void alloc_long_3D(long ***( &mic ), long SYSIZE);
490 void dealloc_long_3D(long ***( &mic ), long SYSIZE);
491 void alloc_int_3D(int ***( &mask ), long SYSIZE);
492 void dealloc_int_3D(int ***( &mask ), long SYSIZE);
493 void alloc_shortint_3D(short int ***( &mic ), long SYSIZE);
494 void dealloc_shortint_3D(short int ***( &mic ), long SYSIZE);
495 void alloc_double_3D(double ***( &mic ), long SYSIZE);
496 void dealloc_double_3D(double ***( &mic ), long SYSIZE);
497
498 char ***micorig; //char micorig [SYSIZE] [SYSIZE] [SYSIZE];
499 long int ***micpart; //long int micpart [SYSIZE] [SYSIZE] [SYSIZE];
500
501 //genpartnew
502 /* data structure for clusters to be used in flocculation */
503 struct cluster {
504 int partid; /* index for particle */
505 int clustid; /* ID for cluster to which this particle belongs */
506 int partphase; /* phase identifier for this particle */
507 int x, y, z, r; /* particle centroid and radius in pixels */
508 struct cluster *nextpart; /* pointer to next particle in cluster */
509 };
510
511 /* 3-D particle structure (each particle has own ID) stored in array cement */
512 /* 3-D microstructure is stored in 3-D array cemreal */
513
514 //define long int cement [SYSSIZE+1] [SYSSIZE+1] [SYSSIZE+1];
515 long int ***cement;
516 //define long int cemreal [SYSSIZE+1] [SYSSIZE+1] [SYSSIZE+1];
517 long int ***cemreal;
518
519 int npart, aggsize; /* global number of particles and size of aggregate */
520 int iseed, nseed, *seed; /* random number seed- global */
521 int dispdist; /* dispersion distance in pixels */
522 int clusleft; /* number of clusters in system */
523 /* parameters to aid in obtaining correct sulfate content */
526 double probgyp, probhem, probanh; /* probability of gypsum particle instead of cement */
527 /* and probabilities of anhydrite and hemihydrate */
528 /* relative to total sulfate */
529 // struct cluster *clust[NPARTC];/* limit of NPARTC particles/clusters */
530 struct cluster **clust;
531
532 //distrib3d
533 int maketemp(int size);
534 void phcount(void);
535 int surfpix(int xin, int yin, int zin);
536 float rhcalc(int phin);
537 int countem(int xp, int yp, int zp, int phin);
538 void sysinit(int ph1, int ph2);
539 void sysscan(int ph1, int ph2);
540 int procsol(int nsearch);
541 int procair(int nsearch);
542 int movepix(int ntomove, int ph1, int ph2);
543 void sinter3d(int ph1id, int ph2id, float rhtarget);
544 void stat3d(void);
545 void rand3d(int phasein, int phaseout, float xpt);
546 void distrib3d(void);
547
548 //int mask[SYSIZE+1][SYSIZE+1][SYSIZE+1];
549 int ***mask;
550 //unsigned short int curvature [SYSSIZE+1] [SYSSIZE+1] [SYSSIZE+1];
551 int ***curvature;
552 long int volume [ 50 ], surface [ 50 ];
553 int nsph;
554 int *xsph, *ysph, *zsph;
555 long int nsolid [ 1500 ], nair [ 1500 ];
556
557 void init(void);
558 int chckedge(int xck, int yck, int zck);
559 void passone(int low, int high, int cycid, int cshexflag);
560 int loccsh(int xcur, int ycur, int zcur, int extent);
561 int countbox(int boxsize, int qx, int qy, int qz);
562 int countboxc(int boxsize, int qx, int qy, int qz);
563 void makeinert(long int ndesire);
564 void extslagcsh(int xpres, int ypres, int zpres);
565 void dissolve(int cycle);
566 void addrand(int randid, long int nneed);
567 void measuresurf(void);
568 void resaturate(void);
569 void outputImageFileUnperc(char ***m);
570 void readhydrparam(void);
571 void disrealnew_init(void);
572 void disrealnew(double GiveTemp, double TargTime, int flag);
573 int burn3d(int npix, int d1, int d2, int d3);
574 int burnset(int d1, int d2, int d3);
575 void parthyd(void);
576 int moveone(int *xloc, int *yloc, int *zloc, int *act, int sumold);
577 int edgecnt(int xck, int yck, int zck, int ph1, int ph2, int ph3);
578 void extcsh(void);
579 int movecsh(int xcur, int ycur, int zcur, int finalstep, int cycorig);
580 void extfh3(int xpres, int ypres, int zpres);
581 int extettr(int xpres, int ypres, int zpres, int etype);
582 void extch(void);
583 void extgyps(int xpres, int ypres, int zpres);
584 int moveanh(int xcur, int ycur, int zcur, int finalstep, float nucprgyp);
585 int movehem(int xcur, int ycur, int zcur, int finalstep, float nucprgyp);
586 int extfreidel(int xpres, int ypres, int zpres);
587 int extstrat(int xpres, int ypres, int zpres);
588 int movegyp(int xcur, int ycur, int zcur, int finalstep);
589 int movecacl2(int xcur, int ycur, int zcur, int finalstep);
590 int movecas2(int xcur, int ycur, int zcur, int finalstep);
591 int moveas(int xcur, int ycur, int zcur, int finalstep);
592 int movecaco3(int xcur, int ycur, int zcur, int finalstep);
593 void extafm(int xpres, int ypres, int zpres);
594 int moveettr(int xcur, int ycur, int zcur, int finalstep);
595 void extpozz(int xpres, int ypres, int zpres);
596 int movefh3(int xcur, int ycur, int zcur, int finalstep, float nucprob);
597 int movech(int xcur, int ycur, int zcur, int finalstep, float nucprob);
598 void extc3ah6(int xpres, int ypres, int zpres);
599 int movec3a(int xcur, int ycur, int zcur, int finalstep, float nucprob);
600 int movec4a(int xcur, int ycur, int zcur, int finalstep, float nucprob);
601 void hydrate(int fincyc, int stepmax, float chpar1, float chpar2, float hgpar1, float hgpar2, float fhpar1, float fhpar2, float gypar1, float gypar2);
602 void laguer(fcomplex_cem a[], int m, fcomplex_cem *x, float eps, int polish);
603 void zroots(fcomplex_cem a[], int m, fcomplex_cem roots[], int polish);
604 void pHpred(void);
605
606 int IsSolidPhase(int phase);
607 void burn_phases(int d1, int d2, int d3);
608 int IsConnected(int cx, int cy, int cz, int dx, int dy, int dz);
609 void GenerateConnNumbers(void);
610 void outputImageFilePerc(void);
611 void WriteUnsortedList(int px, int py, int pz);
612 void CountPercolation(int &tot_perc, int &tot_unperc);
613 inline int AdjCoord(int coord);
614 int NumSol(int cx, int cy, int cz);
615 void CSHbox(unsigned int *CSH_vicinity);
616 void nrerror(const char *error_text);
617 float *vector(int nl, int nh);
618 int *ivector(int nl, int nh);
619 double *dvector(int nl, int nh);
620 //float** matrix(int nrl,int nrh,int ncl,int nch);
621 float **matrix_cem(int nrl, int nrh, int ncl, int nch);
622 double **dmatrix(int nrl, int nrh, int ncl, int nch);
623 int **imatrix(int nrl, int nrh, int ncl, int nch);
624 float **submatrix(float **a, int oldrl, int oldrh, int oldcl, int oldch, int newrl, int newcl);
625 void free_vector(float *v, int nl);
626 void free_ivector(int *v, int nl);
627 void free_dvector(double *v, int nl);
628 void free_matrix(float **m, int nrl, int nrh, int ncl);
629 void free_dmatrix(double **m, int nrl, int nrh, int ncl);
630 void free_imatrix(int **m, int nrl, int nrh, int ncl);
631 void free_submatrix(float *b, int nrl);
632 float **convert_matrix(float *a, int nrl, int nrh, int ncl, int nch);
633 void free_convert_matrix(float **b, int nrl);
634 long int *phase;
635
639 fcomplex_cem ComplexCemhyd(float re, float im);
642 float Cabs(fcomplex_cem z);
644 fcomplex_cem RCmul(float x, fcomplex_cem a);
645
646 /* data structure for diffusing species - to be dynamically allocated */
647 /* Use of a doubly linked list to allow for easy maintenance */
648 /* (i.e. insertion and deletion) */
649 /* Added 11/94 */
650 /* Note that if SYSIZE exceeds 256, need to change x, y, and z to */
651 /* int variables */
652 struct ants {
653 unsigned char x, y, z, id;
655 struct ants *nextant;
656 struct ants *prevant;
657 };
658
659 /* data structure for elements to remove to simulate self-desiccation */
660 /* once again a doubly linked list */
661 struct togo {
662 int x, y, z, npore;
663 struct togo *nexttogo;
664 struct togo *prevtogo;
665 };
666 //short int cshage [SYSIZE] [SYSIZE] [SYSIZE];
667 short int ***cshage;
668 //short int faces [SYSIZE] [SYSIZE] [SYSIZE];
669 short int ***faces;
670 unsigned int *CSH_vicinity; //[(2*BoxSize+1)*(2*BoxSize+1)*(2*BoxSize+1)+1];
671 /* counts for dissolved and solid species */
672 long int *discount, *count;
674 /* Counts for pozzolan reacted, initial pozzolan, gypsum, ettringite,
675 * initial porosity, and aluminosilicate reacted */
677 /* Initial clinker phase counts */
683 /*define heat conversion factor for the cement mixture, includes all solids as
684 * count[INERT]+count[SLAG]+count[POZZ]+count[CACL2]+count[ASG]+count[CAS2]*/
685 double heat_cf;
696 /* Arrays for variable CSH molar volume and water consumption */
699 /* Arrays for dissolution probabilities for each phase */
700 float *disprob, *disbase;
702 /* Arrays for specific gravities, molar volumes, heats of formation, and */
703 /* molar water consumption for each phase */
705 /* Solubility flags and diffusing species created for each phase */
706 /* Also flag for C1.7SH4.0 to C1.1SH3.9 conversion */
709 float cs_acc; /* increases disprob[C3S] and disprob[C2S] if gypsum is present */
710 float ca_acc; /* increases disprob[C3A] and disprob[C4AF] if gypsum is present */
714 /* Slag probabilities */
715 float p1slag; /* probability SLAG is converted to SLAGCSH */
716 float p2slag; /* probability SLAG is converted to POROSITY or EMPTYP */
717 float p3slag; /* probability adjoining pixel is converted to SLAGCSH */
718 float p4slag; /* probability CH is consumed during SLAG reaction */
719 float p5slag; /* probability a C3A diffusing species is created */
720 double slagcasi, slaghydcasi; /* Ca/Si ratios for SLAG and SLAGCSH */
721 float slagh2osi; /* H/S ratio of SLAGCSH */
722 double slagc3a; /* C3A/slag molar ratio */
723 double siperslag; /* S ratio of SLAG (per mole) */
724 double slagreact; /* Base dissolution reactivity factor for SLAG */
725 long int DIFFCHdeficit, slaginit; /* Deficit in CH due to SLAG reaction */
726 long int slagcum, chgone;
727 long int nch_slag; /* number of CH consumed by SLAG reaction */
728 long int sulf_cur;
729 long int sulf_solid;
730 char heatname [ 80 ], adianame [ 80 ], phasname [ 80 ], ppsname [ 80 ], ptsaname [ 80 ], phrname [ 80 ];
731 char chshrname [ 80 ], micname [ 80 ];
732 char cmdnew [ 120 ], pHname [ 80 ], fileroot [ 80 ];
735 //fileperc used in burn3d.cpp, percfile in burnset.cpp
736 /* Variables for alkali predictions */
738 /* Array for whether pH influences phase solubility -- added 2/12/02 */
739 float *pHeffect;
740 float pHfactor;
742 /* Make conccaplus global to speed up execution and moles_syn_precip */
743 /* global to accumulate properly */
745 int primevalues [ 6 ];
746 int cshboxsize; /* Box size for addition of extra diffusing C-S-H */
747 //int newmat [SYSIZE][SYSIZE][SYSIZE]; moved to burn_phases and burnset
748
750 int x, y, z;
753 };
754
756
757 //disrealnew
762 double InitTime;
768
769 long int LastCycCnt;
771};
772} //end of namespace
773
774#endif //CEMHYDMAT_H
#define _IFT_CemhydMat_Name
Definition cemhydmat.h:59
#define E(a, b)
void QueryNumAttributeExt(XMLDocument *xmlFile, const char *elementName, int position, int &val)
Definition cemhydmat.C:1127
int movech(int xcur, int ycur, int zcur, int finalstep, float nucprob)
double GiveDensity(void)
Definition cemhydmat.C:7552
double Vol_cement_clinker_gypsum
Definition cemhydmat.h:770
int extfreidel(int xpres, int ypres, int zpres)
Definition cemhydmat.C:9471
double GiveTotHeat(void)
Definition cemhydmat.C:7529
double GiveTotCemHeat(void)
Definition cemhydmat.C:7523
float ** matrix_cem(int nrl, int nrh, int ncl, int nch)
const char * giveClassName() const override
Definition cemhydmat.h:167
void dissolve(int cycle)
Definition cemhydmat.C:4869
float ** convert_matrix(float *a, int nrl, int nrh, int ncl, int nch)
long int volume[50]
Definition cemhydmat.h:552
void free_matrix(float **m, int nrl, int nrh, int ncl)
unsigned int * CSH_vicinity
Definition cemhydmat.h:670
short int *** faces
Definition cemhydmat.h:669
void free_dvector(double *v, int nl)
int IsConnected(int cx, int cy, int cz, int dx, int dy, int dz)
int movefh3(int xcur, int ycur, int zcur, int finalstep, float nucprob)
CemhydMatStatus(GaussPoint *gp, CemhydMatStatus *CemStat, CemhydMat *cemhydmat, bool withMicrostructure)
Definition cemhydmat.C:453
int edgecnt(int xck, int yck, int zck, int ph1, int ph2, int ph3)
Definition cemhydmat.C:8303
void rand3d(int phasein, int phaseout, float xpt)
Definition cemhydmat.C:3361
void makeinert(long int ndesire)
Definition cemhydmat.C:4652
void zroots(fcomplex_cem a[], int m, fcomplex_cem roots[], int polish)
int IsSolidPhase(int phase)
int countem(int xp, int yp, int zp, int phin)
Definition cemhydmat.C:2848
long cy(int x, int y, int z, int a, int b, int c)
void laguer(fcomplex_cem a[], int m, fcomplex_cem *x, float eps, int polish)
void nrerror(const char *error_text)
int burn3d(int npix, int d1, int d2, int d3)
Definition cemhydmat.C:7599
int movecacl2(int xcur, int ycur, int zcur, int finalstep)
Definition cemhydmat.C:9918
void addrand(int randid, long int nneed)
Definition cemhydmat.C:6211
long int *** micpart
Definition cemhydmat.h:499
void free_ivector(int *v, int nl)
GaussPoint * gp
Stores GP of the CemhydMatStatus.
Definition cemhydmat.h:251
void hydrate(int fincyc, int stepmax, float chpar1, float chpar2, float hgpar1, float hgpar2, float fhpar1, float fhpar2, float gypar1, float gypar2)
long int *** cement
Definition cemhydmat.h:515
double GiveCycTime(void)
Definition cemhydmat.C:7587
double GivePower(double GiveTemp, double TargTime)
Definition cemhydmat.C:7367
int movec3a(int xcur, int ycur, int zcur, int finalstep, float nucprob)
void alloc_int_3D(int ***(&mask), long SYSIZE)
Definition cemhydmat.C:1035
int chksph(int xin, int yin, int zin, int radd, int wflg, int phasein, int phase2)
Definition cemhydmat.C:1534
int movecaco3(int xcur, int ycur, int zcur, int finalstep)
fcomplex_cem Csub(fcomplex_cem a, fcomplex_cem b)
int loccsh(int xcur, int ycur, int zcur, int extent)
Definition cemhydmat.C:4464
fcomplex_cem Conjg(fcomplex_cem z)
fcomplex_cem Csqrt(fcomplex_cem z)
void drawfloc(int xin, int yin, int zin, int radd, int phasein, int phase2)
Definition cemhydmat.C:1896
void free_dmatrix(double **m, int nrl, int nrh, int ncl)
int Calculate_elastic_homogenization
Flag to proceed percolation filtering and elastic homogenization.
Definition cemhydmat.h:247
fcomplex_cem ComplexCemhyd(float re, float im)
int movegyp(int xcur, int ycur, int zcur, int finalstep)
Definition cemhydmat.C:9633
double IPVolume
Volume associated to master IP of one CemhydMat.
Definition cemhydmat.h:210
int movec4a(int xcur, int ycur, int zcur, int finalstep, float nucprob)
double giveAverageTemperature(void)
double ** dmatrix(int nrl, int nrh, int ncl, int nch)
void QueryStringAttributeExt(XMLDocument *xmlFile, const char *elementName, int position, char *chars)
Definition cemhydmat.C:1207
void WriteUnsortedList(int px, int py, int pz)
double ran1(int *idum)
Definition cemhydmat.C:1447
void extc3ah6(int xpres, int ypres, int zpres)
int surfpix(int xin, int yin, int zin)
Definition cemhydmat.C:2749
void GenerateConnNumbers(void)
float rhcalc(int phin)
Definition cemhydmat.C:2817
double GiveDoHActual(void)
Return degree of hydration of the receiver.
Definition cemhydmat.C:7564
void setAverageTemperatureVolume(double temperature, double volume)
Auxiliary function for temperature averaging over GPs.
Definition cemhydmat.h:215
void outputImageFilePerc(void)
int gsphere(int numgen, long int *numeach, int *sizeeach, int *pheach)
Definition cemhydmat.C:1611
long cz(int x, int y, int z, int a, int b, int c)
void disrealnew(double GiveTemp, double TargTime, int flag)
Definition cemhydmat.C:7124
void alloc_shortint_3D(short int ***(&mic), long SYSIZE)
Definition cemhydmat.C:1065
float * vector(int nl, int nh)
float Cabs(fcomplex_cem z)
short int *** cshage
Definition cemhydmat.h:667
struct percolatedpath * current
Definition cemhydmat.h:755
fcomplex_cem Cdiv(fcomplex_cem a, fcomplex_cem b)
struct ants * tailant
Definition cemhydmat.h:733
void dealloc_shortint_3D(short int ***(&mic), long SYSIZE)
Definition cemhydmat.C:1080
double * last_values
Array for storing temporary values (elastic properties etc.).
Definition cemhydmat.h:245
int icyc
Cycle of celular automata.
Definition cemhydmat.h:243
void free_convert_matrix(float **b, int nrl)
void free_submatrix(float *b, int nrl)
void outputImageFileUnperc(char ***m)
Definition cemhydmat.C:6369
long int nsolid[1500]
Definition cemhydmat.h:555
void alloc_long_3D(long ***(&mic), long SYSIZE)
Definition cemhydmat.C:1005
int MoveToTime(double GiveTemp, double TargTime)
Definition cemhydmat.C:7515
void updateYourself(TimeStep *tStep) override
int maketemp(int size)
Definition cemhydmat.C:2679
void PercolateForOutput(void)
double averageTemperature
Average temperature through integration points.
Definition cemhydmat.h:208
double init_material_time
Inital material time for growing problems.
Definition cemhydmat.h:212
double PartHeat
The last incremental heat returned from a GP.
Definition cemhydmat.h:239
int chckedge(int xck, int yck, int zck)
Definition cemhydmat.C:4317
void extfh3(int xpres, int ypres, int zpres)
Definition cemhydmat.C:8553
void extgyps(int xpres, int ypres, int zpres)
Definition cemhydmat.C:8821
int burnset(int d1, int d2, int d3)
Definition cemhydmat.C:7824
void AnalyticHomogenizationPaste(double &E, double &nu, int perc_unperc_flag)
int procair(int nsearch)
Definition cemhydmat.C:2995
void sinter3d(int ph1id, int ph2id, float rhtarget)
Definition cemhydmat.C:3166
struct percolatedpath * last
Definition cemhydmat.h:755
void passone(int low, int high, int cycid, int cshexflag)
Definition cemhydmat.C:4366
int moveanh(int xcur, int ycur, int zcur, int finalstep, float nucprgyp)
Definition cemhydmat.C:8900
int movecas2(int xcur, int ycur, int zcur, int finalstep)
void extafm(int xpres, int ypres, int zpres)
int procsol(int nsearch)
Definition cemhydmat.C:2968
void dealloc_int_3D(int ***(&mask), long SYSIZE)
Definition cemhydmat.C:1050
void disrealnew_init(void)
Definition cemhydmat.C:6966
double Vol_entrained_entrapped_air
Definition cemhydmat.h:770
void extslagcsh(int xpres, int ypres, int zpres)
Definition cemhydmat.C:4776
int * ivector(int nl, int nh)
double Concrete_thermal_conductivity
Definition cemhydmat.h:691
int movehem(int xcur, int ycur, int zcur, int finalstep, float nucprgyp)
Definition cemhydmat.C:9186
void GetInitClinkerPhases(double &c3s, double &c2s, double &c3a, double &c4af, double &gypsum, double &hemi, double &anh)
void dealloc_long_3D(long ***(&mic), long SYSIZE)
Definition cemhydmat.C:1020
void CSHbox(unsigned int *CSH_vicinity)
void GetInputParams(char *my_string)
void CountPercolation(int &tot_perc, int &tot_unperc)
int extstrat(int xpres, int ypres, int zpres)
Definition cemhydmat.C:9552
int moveettr(int xcur, int ycur, int zcur, int finalstep)
fcomplex_cem Cmul(fcomplex_cem a, fcomplex_cem b)
int countbox(int boxsize, int qx, int qy, int qz)
Definition cemhydmat.C:4538
void free_vector(float *v, int nl)
float ** submatrix(float **a, int oldrl, int oldrh, int oldcl, int oldch, int newrl, int newcl)
int movepix(int ntomove, int ph1, int ph2)
Definition cemhydmat.C:3020
long int surface[50]
Definition cemhydmat.h:552
double * dvector(int nl, int nh)
long int *** cemreal
Definition cemhydmat.h:517
int moveone(int *xloc, int *yloc, int *zloc, int *act, int sumold)
Definition cemhydmat.C:8192
void sysinit(int ph1, int ph2)
Definition cemhydmat.C:2891
double MoveCycles(double GiveTemp, int cycles)
Definition cemhydmat.C:7455
void alloc_double_3D(double ***(&mic), long SYSIZE)
Definition cemhydmat.C:1095
long int volpart[47]
Definition cemhydmat.h:524
long int nair[1500]
Definition cemhydmat.h:555
struct ants * headant
Definition cemhydmat.h:733
void printOutputAt(FILE *file, TimeStep *tStep) const override
Print receiver's output to given stream.
void initializeMicrostructure(void)
Definition cemhydmat.C:558
int movecsh(int xcur, int ycur, int zcur, int finalstep, int cycorig)
Definition cemhydmat.C:8415
virtual ~CemhydMatStatus()
Definition cemhydmat.C:860
int chkfloc(int xin, int yin, int zin, int radd)
Definition cemhydmat.C:1954
double computeConcreteCapacityBentz(void)
Definition cemhydmat.C:7542
double GiveDoHLastCyc(void)
Definition cemhydmat.C:7558
void AnalyticHomogenizationConcrete(double E_paste_inp, double nu_paste_inp, double *E_paste, double *nu_paste, double *E_mortar, double *nu_mortar, double &E_concrete, double &nu_concrete)
struct cluster ** clust
Definition cemhydmat.h:530
int MoveToDoH(double GiveTemp, double DesiredDoH, int maxcyc)
Definition cemhydmat.C:7493
void alloc_char_3D(char ***(&mic), long SYSIZE)
Definition cemhydmat.C:976
XMLDocument * xmlFile
Definition cemhydmat.h:463
void dealloc_double_3D(double ***(&mic), long SYSIZE)
Definition cemhydmat.C:1110
void dealloc_char_3D(char ***(&mic), long SYSIZE)
Definition cemhydmat.C:990
int readInputFileAndInitialize(const char *inp, bool generateMicrostructure)
Definition cemhydmat.C:1243
fcomplex_cem Cadd(fcomplex_cem a, fcomplex_cem b)
int ** imatrix(int nrl, int nrh, int ncl, int nch)
int AdjCoord(int coord)
void burn_phases(int d1, int d2, int d3)
fcomplex_cem RCmul(float x, fcomplex_cem a)
void free_imatrix(int **m, int nrl, int nrh, int ncl)
void extpozz(int xpres, int ypres, int zpres)
void sysscan(int ph1, int ph2)
Definition cemhydmat.C:2943
double giveTotalVolume(void)
Definition cemhydmat.h:222
void read(char *inp)
void constructor_init(void)
int NumSol(int cx, int cy, int cz)
int countboxc(int boxsize, int qx, int qy, int qz)
Definition cemhydmat.C:4594
int extettr(int xpres, int ypres, int zpres, int etype)
Definition cemhydmat.C:8634
long cx(int x, int y, int z, int a, int b, int c)
int moveas(int xcur, int ycur, int zcur, int finalstep)
FloatArray scaling
Array containing scaling factors for density, conductivity and capacity.
Definition cemhydmat.h:134
virtual int giveCycleNumber(GaussPoint *gp)
Returns cycle number at the closest cycle after the target time.
Definition cemhydmat.C:133
const char * giveClassName() const override
Definition cemhydmat.h:99
int conductivityType
Use different methods to evaluate material parameters.
Definition cemhydmat.h:130
virtual double giveConcreteCapacity(GaussPoint *gp, TimeStep *tStep) const
Returns concrete thermal capacity depending on chosen type.
Definition cemhydmat.C:197
double giveCharacteristicValue(MatResponseMode mode, GaussPoint *gp, TimeStep *tStep) const override
Compute heat thermal capacity per volume.
Definition cemhydmat.C:258
MaterialStatus * CreateStatus(GaussPoint *gp) const override
Definition cemhydmat.C:444
virtual double giveConcreteDensity(GaussPoint *gp, TimeStep *tStep) const
Returns concrete density depending on chosen type.
Definition cemhydmat.C:228
int eachGP
Assign a separate microstructure in each integration point.
Definition cemhydmat.h:138
virtual void storeWeightTemperatureProductVolume(Element *element, TimeStep *tStep)
Store temperatures multiplied with volume around GPs - need before temperature averaging.
Definition cemhydmat.C:383
CemhydMat(int n, Domain *d)
Constructor.
Definition cemhydmat.C:96
void computeInternalSourceVector(FloatArray &val, GaussPoint *gp, TimeStep *tStep, ValueModeType mode) const override
Definition cemhydmat.C:103
virtual double giveTimeOfCycle(GaussPoint *gp)
Returns time of the CEMHYD3D at the first cycle after the target time.
Definition cemhydmat.C:143
int initMaterial(Element *element) override
Definition cemhydmat.C:352
void initializeFrom(InputRecord &ir) override
Definition cemhydmat.C:405
std::string XMLfileName
XML input file name for CEMHYD3D.
Definition cemhydmat.h:140
double giveIsotropicConductivity(GaussPoint *gp, TimeStep *tStep) const override
Returns concrete heat conductivity depending on chosen type.
Definition cemhydmat.C:166
bool hasInternalSource() const override
Definition cemhydmat.h:101
virtual double giveDoHActual(GaussPoint *gp)
Returns DoH of the closest CEMHYD3D cycle after the target time.
Definition cemhydmat.C:155
virtual void clearWeightTemperatureProductVolume(Element *element)
Clear temperatures multiplied with volume around GPs - need before temperature averaging.
Definition cemhydmat.C:373
int reinforcementDegree
Degree of reinforcement, if defined, reinforcement effect for conductivity and capacity is accounted ...
Definition cemhydmat.h:136
const char * giveInputRecordName() const override
Returns input record name of the receiver.
Definition cemhydmat.h:98
virtual void averageTemperature()
Perform averaging on a master CemhydMatStatus.
Definition cemhydmat.C:397
int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep) override
Definition cemhydmat.C:301
IntArray nowarnings
Array containing warnings supression for density, conductivity, capacity, high temperature.
Definition cemhydmat.h:132
CemhydMatStatus * MasterCemhydMatStatus
Definition cemhydmat.h:146
IsotropicHeatTransferMaterial(int n, Domain *d)
Definition isoheatmat.C:45
struct oofem::FCOMPLEX fcomplex_cem

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