OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
b3solidmat.C
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 - 2013 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 #include "b3solidmat.h"
36 #include "mathfem.h"
37 #include "gausspoint.h"
38 #include "timestep.h"
39 #include "contextioerr.h"
40 #include "datastream.h"
41 #include "classfactory.h"
42 #include "engngm.h"
43 #include "b3mat.h"
44 
45 namespace oofem {
46 REGISTER_Material(B3SolidMaterial);
47 
50 {
51  IRResultType result; // Required by IR_GIVE_FIELD macro
52 
53  //
54  // NOTE
55  //
56  // this material model is unit-dependent!
57  // units must be in MPa, m???, MN.
58  //
59 
60  double fc = -1.0, c = -1.0, wc = -1.0, ac = -1.0, alpha1 = 1.0, alpha2 = 1.0;
61  double initHum; //MPS shrinkage parameter - initial value of humidity (range 0.2-0.98)
62  double finalHum; //MPS shrinkage parameter - final value of humidity (range 0.2-0.98)
63 
64  // EmoduliMode has to be set first because characteristic times are computed from RheoChM initialization
65  this->EmoduliMode = 0;
66  // retardation spectrum or least square method is used. Retardation spectrum is default (EmoduliMode==0)
68 
69  // characteristic time, usually 1 for analysis running in days
70  this->lambda0 = 1.;
72 
74 
75  int mode = 0;
77 
78  if ( mode == 0 ) { // default - estimate model parameters q1,..,q5 from composition
79  IR_GIVE_FIELD(ir, fc, _IFT_B3Material_fc); // 28-day standard cylinder compression strength [MPa]
80  IR_GIVE_FIELD(ir, c, _IFT_B3Material_cc); // cement content of concrete [kg/m^3]
81  IR_GIVE_FIELD(ir, wc, _IFT_B3Material_wc); // ratio (by weight) of water to cementitious material
82  IR_GIVE_FIELD(ir, ac, _IFT_B3Material_ac); // ratio (by weight) of aggregate to cement
83  IR_GIVE_FIELD(ir, t0, _IFT_B3Material_t0); // age when drying begins [days]
84  } else { // read model parameters for creep
89  }
90 
91  // default value = 0; it can be used for basic creep without any external fields
92  this->MicroPrestress = 0; //if = 1 computation exploiting Microprestress solidification theory is done;
94 
95  // is MPS theory used?
96  if ( this->MicroPrestress == 1 ) {
97  // microprestress-sol-theory: read data for microprestress evaluation
98  // constant c0 [MPa^-1 * day^-1]
100  // constant c1 (=C1*R*T/M)
102  // t0- necessary for the initial value of microprestress = S0 (age when drying begins)
104 
105  // microprestress-sol-theory: read data for inverse desorption isotherm
109  }
110 
111  // read shrinkage mode
112  int shm = 0;
114  this->shMode = ( b3ShModeType ) shm;
115 
116  if ( this->shMode == B3_PointShrinkage ) { // #2 in enumerator
117 
118  if ( this->MicroPrestress == 0 ) {
119  OOFEM_WARNING("to use B3_PointShrinkageMPS - MicroPrestress must be = 1"); //or else no external fiels would be found
120  return IRRT_BAD_FORMAT;
121  }
122 
123  kSh = -1;
124  initHum = -1;
125  finalHum = -1;
126 
130 
131  // either kSh or initHum and finalHum must be given in input record
132  if ( !( ( this->kSh != -1 ) || ( ( initHum != -1 ) && ( finalHum != -1 ) ) ) ) {
133  OOFEM_WARNING("either kSh or initHum and finalHum must be given in input record");
134  return IRRT_BAD_FORMAT;
135  }
136 
137  if ( ( ( initHum < 0.2 ) || ( initHum > 0.98 ) || ( finalHum < 0.2 ) || ( finalHum > 0.98 ) ) && ( this->kSh == -1 ) ) {
138  OOFEM_ERROR("initital humidity or final humidity out of range (0.2 - 0.98)");
139  }
140 
141 
142  if ( this->kSh == -1 ) { // predict kSh from composition
143  IR_GIVE_OPTIONAL_FIELD(ir, alpha1, _IFT_B3Material_alpha1); // influence of cement type
144  IR_GIVE_OPTIONAL_FIELD(ir, alpha2, _IFT_B3Material_alpha2); // influence of curing type
145  this->kSh = alpha1 * alpha2 * ( 1 - pow(finalHum, 3.) ) * ( 0.019 * pow(wc * c, 2.1) * pow(fc, -0.28) + 270 ) * 1.e-6 / fabs(initHum - finalHum);
146  }
147 
148  } else if ( this->shMode == B3_AverageShrinkage ) {
149  IR_GIVE_FIELD(ir, ks, _IFT_B3Material_ks); // cross-section shape factor
150  /*
151  * use ks = 1.0 for an infinite slab
152  * = 1.15 for an infinite cylinder
153  * = 1.25 for an infinite square prism
154  * = 1.30 for a sphere
155  * = 1.55 for a cube
156  */
157  IR_GIVE_FIELD(ir, hum, _IFT_B3Material_hum); // relative humidity of the environment
158  IR_GIVE_FIELD(ir, vs, _IFT_B3Material_vs); // volume-to-surface ratio (in m???)
159  if ( mode == 0 ) { // default mode - estimate model parameters kt, EpsSinf, q5 from composition
160  IR_GIVE_OPTIONAL_FIELD(ir, alpha1, _IFT_B3Material_alpha1); // influence of cement type
161  IR_GIVE_OPTIONAL_FIELD(ir, alpha2, _IFT_B3Material_alpha2); // influence of curing type
162  } else { // read model parameters
163  IR_GIVE_FIELD(ir, t0, _IFT_B3Material_t0); // age when drying begins [days]
167  }
168  }
169 
170  // evaluate the total water content [kg/m^3]
171  w = wc * c;
172  // estimate the conventional modulus ??? what if fc is not given ???
173  E28 = 4733. * sqrt(fc);
174  // estimate parameters from composition
175  if ( mode == 0 ) {
176  this->predictParametersFrom(fc, c, wc, ac, t0, alpha1, alpha2);
177  }
178 
179  // ph!!!
180  //return KelvinChainMaterial :: initializeFrom(ir);
181  return IRRT_OK;
182 }
183 
184 void
185 B3SolidMaterial :: predictParametersFrom(double fc, double c, double wc, double ac,
186  double t0, double alpha1, double alpha2)
187 {
188  /*
189  * Prediction of model parameters - estimation from concrete composition
190  * and strength
191  *
192  * fc - 28-day standard cylinder compression strength in MPa
193  * c - cement content of concrete in kg/m^3
194  * wc - ratio (by weight) of water to cementitious material
195  * ac - ratio (by weight) of aggregate to cement
196  * t0 - age when drying begins (in days)
197  * alpha1, alpha2 - influence of cement type and curing
198  *
199  * The prediction of the material parameters of the present model
200  * is restricted to Portland cement concretes with the following
201  * parameter ranges:
202  *
203  * 2500 <= fc <= 10000 [psi] (psi = 6895 Pa)
204  * 10 <= c <= 45 [lb ft-3] (lb ft-3 = 16.03 kg m-3)
205  * 0.3 <= wc <= 0.85
206  * 2.5 <= ac <= 13.5
207  *
208  *
209  * alpha1 = 1.0 for type I cement;
210  * = 0.85 for type II cement;
211  * = 1.1 for type III cement;
212  *
213  * alpha2 = 0.75 for steam-cured specimens;
214  * = 1.2 for specimens sealed during curing;
215  * = 1.0 for specimens cured in water or 100% relative humidity.
216  *
217  */
218 
219  // Basic creep parameters
220 
221  // q1 = 0.6e6 / E28; // replaced by the formula dependent on fc
222  q1 = 126.74271 / sqrt(fc) * 1e-6;
223  q2 = 185.4 * pow(c, 0.5) * pow(fc, -0.9) * 1.e-6;
224  q3 = 0.29 * pow(wc, 4.) * q2;
225  q4 = 20.3 * pow(ac, -0.7) * 1.e-6;
226 
227  // Shrinkage parameters
228 
229  if ( this->shMode == B3_AverageShrinkage ) {
230  kt = 85000 * pow(t0, -0.08) * pow(fc, -0.25); // 85000-> result in [days/m^2] or 8.5-> result in [days/cm^2]
231  EpsSinf = alpha1 * alpha2 * ( 1.9e-2 * pow(w, 2.1) * pow(fc, -0.28) + 270. ); // exponent corrected: -0.25 -> -0.28
232 
233  // Drying creep parameter
234  q5 = 7.57e5 * ( 1. / fc ) * pow(EpsSinf, -0.6);
235  }
236 
237  char buff [ 1024 ];
238  sprintf(buff, "q1=%lf q2=%lf q3=%lf q4=%lf q5=%lf kt=%lf EpsSinf=%lf", q1, q2, q3, q4, q5, kt, EpsSinf);
239  OOFEM_LOG_DEBUG("B3mat[%d]: estimated params: %s\n", this->number, buff);
240 }
241 
242 
243 double
245 {
246  /*
247  * This function returns the incremental modulus for the given time increment.
248  * The modulus may also depend on the specimen geometry (gp - dependence).
249  *
250  * It is stored as "Einc" for further expected requests from other gaussPoints that correspond to the same material.
251  *
252  * Note: time -1 refers to the previous time.
253  */
254 
255  // !!! chartime exponents are assumed to be equal to 1 !!!
256 
257  double v, eta;
258  double t_halfstep;
259  double chainStiffness = 0.;
260 
261  v = computeSolidifiedVolume(tStep);
262  eta = this->computeFlowTermViscosity(gp, tStep); //evaluated in the middle of the time-step
263 
265  t_halfstep = relMatAge + ( tStep->giveTargetTime() - 0.5 * tStep->giveTimeIncrement() ) / timeFactor;
266  this->updateEparModuli( t_halfstep, gp, tStep );
267 
268  if ( this->EmoduliMode == 0 ) { //retardation spectrum used
269  double sum;
270  // compute compliance of the Kelvin chain
271  sum = 1. / KelvinChainMaterial :: giveEModulus(gp, tStep);
272  // add compliance of non-aging spring
273  sum += 1. / EspringVal;
274  // convert to stiffness
275  chainStiffness = 1. / sum;
276 
277  } else { //least-squares method used
278  chainStiffness = KelvinChainMaterial :: giveEModulus(gp, tStep);
279  }
280 
281  return 1. / ( q1 + 1. / (chainStiffness * v) + 0.5 * ( tStep->giveTimeIncrement() / timeFactor ) / eta );
282 }
283 
284 
285 void
287 {
288  /*
289  * Since the elastic moduli are constant in time it is necessary to update them only once
290  * on the beginning of the computation
291  */
292  if (this->EparVal.isEmpty()) {
293  RheoChainMaterial :: updateEparModuli(tPrime, gp, tStep);
294  }
295 }
296 
297 void
299 {
300  /*
301  * This function generates discrete characteristic times
302  * according to rules which guarantee a good approximation
303  * of the relaxation or creep function by the Dirichlet series
304  */
305 
306  double Tau1;
307  int j;
308 
309  if ( this->begOfTimeOfInterest == -1. ) {
310  this->begOfTimeOfInterest = 0.001 * lambda0;
311  }
312 
313  if ( this->endOfTimeOfInterest == -1. ) {
314  this->endOfTimeOfInterest = 10000. * lambda0;
315  }
316 
317 
318  // perhaps different values should be used for moduli computed by the least-squares method
319  // this gives really big mistakes for times near the interest boundary
320 
321  //first retardation time found in given by formula 0.3 * begOfTimeOfInterest
322  Tau1 = 0.3 * this->begOfTimeOfInterest;
323 
324  //last retardation time has to be bigger than 0.5 * endOfTimeOfInterest
326 
327  j = 1;
328  while ( 0.5 * this->endOfTimeOfInterest >= Tau1 * pow( 10.0, ( double ) ( j - 1 ) ) ) {
329  j++;
330  }
331 
332 
333  this->nUnits = j;
334 
335  this->charTimes.resize(this->nUnits);
336  this->charTimes.zero();
337 
338  for ( int mu = 1; mu <= this->nUnits; mu++ ) {
339  charTimes.at(mu) = Tau1 * pow(10., mu - 1);
340  }
341 }
342 
343 
344 void
346 {
347  /*
348  * If EmoduliMode == 0 then analysis of continuous retardation spectrum is used for
349  * computing characteristic coefficients (moduli) of Kelvin chain
350  * Else least-squares method is used
351  */
352  if ( this->EmoduliMode == 0 ) {
353 
354  int mu;
355  double tau0, tauMu;
356 
357  // constant "n" is assumed to be equal to 0.1 (typical value)
358 
359  // modulus of elasticity of the first unit of Kelvin chain.
360  // (aging elastic spring with retardation time = 0)
361  double lambda0ToPowN = pow(lambda0, 0.1);
362  tau0 = pow(2 * this->giveCharTime(1) / sqrt(10.0), 0.1);
363  EspringVal = 1. / ( q2 * log(1.0 + tau0 / lambda0ToPowN) - q2 * tau0 / ( 10.0 * lambda0ToPowN + 10.0 * tau0 ) );
364 
365  // evaluation of moduli of elasticity for the remaining units
366  // (Solidifying kelvin units with retardation times tauMu)
367  answer.resize(nUnits);
368  answer.zero();
369  for ( mu = 1; mu <= this->nUnits; mu++ ) {
370  tauMu = pow(2 * this->giveCharTime(mu), 0.1);
371  answer.at(mu) = 10. * pow(1 + tauMu / lambda0ToPowN, 2) / ( log(10.0) * q2 * ( tauMu / lambda0ToPowN ) * ( 0.9 + tauMu / lambda0ToPowN ) );
372  this->charTimes.at(mu) *= 1.35;
373  }
374 
375  answer.at(nUnits) /= 1.2; // modulus of the last unit is reduced
376 
377  } else { // moduli computed using the least-squares method
378 
379  KelvinChainMaterial :: computeCharCoefficients(answer, tPrime, gp, tStep);
380 
381  }
382 }
383 
384 double
385 B3SolidMaterial :: computeCreepFunction(double t, double t_prime, GaussPoint *gp, TimeStep *tStep)
386 // compute the value of the creep function of the non-aging solidifying constituent
387 // corresponding to the given load duration (in days)
388 // t-t_prime = duration of loading
389 
390 {
391  double Phi; //return value
392  //double lambda0 = 1.0; // standard value [day]
393  double n = 0.1; // standard value
394 
395  Phi = q2 * log( 1 + pow( (t-t_prime) / lambda0, n) );
396 
397  return Phi;
398 }
399 
400 
401 void
403  GaussPoint *gp,
404  TimeStep *tStep,
405  ValueModeType mode)
406 {
407  FloatArray prevAnswer;
408 
409  if ( this->shMode == B3_NoShrinkage ) {
411  answer.zero();
412  return;
413  }
414 
415  if ( ( mode != VM_Total ) && ( mode != VM_Incremental ) ) {
416  OOFEM_ERROR("unsupported mode");
417  }
418 
419  if ( this->shMode == B3_AverageShrinkage ) {
420  this->computeTotalAverageShrinkageStrainVector(answer, gp, tStep);
421 
422  if ( ( mode == VM_Incremental ) && ( !tStep->isTheFirstStep() ) ) {
423  this->computeTotalAverageShrinkageStrainVector( prevAnswer, gp, tStep->givePreviousStep() );
424  answer.subtract(prevAnswer);
425  }
426  } else {
427  this->computePointShrinkageStrainVector(answer, gp, tStep);
428  }
429 }
430 
431 void
433 {
434  /*
435  * returns average shrinkage strain vector of cross section at drying
436  */
437 
438  double TauSh, St, kh, help, E607, Et0Tau, EpsShInf, EpsSh;
439  double time = relMatAge + tStep->giveTargetTime() / timeFactor;
440  int size;
441  FloatArray fullAnswer;
442  MaterialMode mode = gp->giveMaterialMode();
443 
444  if ( ( mode == _3dShell ) || ( mode == _3dBeam ) || ( mode == _2dPlate ) || ( mode == _2dBeam ) ) {
445  size = 12;
446  } else {
447  size = 6;
448  }
449 
450  fullAnswer.resize(size);
451  fullAnswer.zero();
452 
453  // size dependence
454  TauSh = kt * pow(ks * 2.0 * vs, 2.);
455  // time curve
456  St = tanh( pow( ( time - t0 ) / TauSh, 1. / 2. ) );
457  // humidity dependence
458  if ( hum <= 0.98 ) {
459  kh = 1. - pow(hum, 3);
460  } else if ( hum == 1 ) {
461  kh = -0.2; // swelling in water
462  } else {
463  // linear interpolation for 0.98 <= h <= 1.
464  help = 1. - pow(0.98, 3);
465  kh = help + ( -0.2 - help ) / ( 1. - 0.98 ) * ( hum - 0.98 );
466  }
467 
468  // time dependence of ultimate shrinkage
469  E607 = E28 * pow(607 / ( 4. + 0.85 * 607 ), 0.5);
470  Et0Tau = E28 * pow( ( t0 + TauSh ) / ( 4. + 0.85 * ( t0 + TauSh ) ), 0.5 );
471 
472  EpsShInf = EpsSinf * E607 / Et0Tau;
473  // mean shrinkage in the cross section:
474  EpsSh = -EpsShInf * kh * St;
475 
476  fullAnswer.at(1) = fullAnswer.at(2) = fullAnswer.at(3) = EpsSh * 1.e-6;
477 
479 }
480 
481 
482 void
484 {
485  /* dEpsSh/dt = kSh * dh/dt (h = humidity)
486  * ->> EpsSh = kSh * h_difference
487  */
488  double humDiff, EpsSh;
489  int size;
490  FloatArray fullAnswer;
491  MaterialMode mode = gp->giveMaterialMode();
492 
493  if ( ( mode == _3dShell ) || ( mode == _3dBeam ) || ( mode == _2dPlate ) || ( mode == _2dBeam ) ) {
494  size = 12;
495  } else {
496  size = 6;
497  }
498 
499  humDiff = this->giveHumidityIncrement(gp, tStep);
500  EpsSh = humDiff * kSh;
501 
502  fullAnswer.resize(size);
503  fullAnswer.zero();
504  fullAnswer.at(1) = fullAnswer.at(2) = fullAnswer.at(3) = EpsSh;
505 
507 }
508 
509 
510 double
512 // compute the relative volume of the solidified material at given age (in days)
513 {
514  double m, alpha;
515  double v; //return value
516  double atAge; // (equivalent age)
517 
518  // standard values of exponents - empirical constants
519  m = 0.5;
520  //lambda0 = 1; //[day]
521  alpha = q3 / q2;
522 
523  atAge = relMatAge + ( tStep->giveTargetTime() - 0.5 * tStep->giveTimeIncrement() ) / timeFactor;
524  v = 1 / ( alpha + pow(lambda0 / atAge, m) );
525 
526  return v;
527 }
528 
529 
530 double
532 //used for evaluation of the flow term viscosity (term containing q4)
533 {
534  double eta, S, tHalfStep;
535 
536  if ( this->MicroPrestress == 1 ) {
537  S = this->computeMicroPrestress(gp, tStep, 0); //microprestress in the middle of the time-step
538  eta = 1. / ( q4 * c0 * S );
539  //static_cast< B3SolidMaterialStatus* >( gp->giveMaterialStatus() )->setMPS(S);
540  } else if ( this->MicroPrestress == 0 ) {
541  tHalfStep = relMatAge + ( tStep->giveTargetTime() - 0.5 * tStep->giveTimeIncrement() ) / timeFactor;
542  eta = 1. * tHalfStep / q4;
543  } else {
544  OOFEM_ERROR("mode is not supported");
545  eta = 0.;
546  }
547 
548  return eta;
549 }
550 
551 
552 void
554 //
555 // computes the strain due to creep at constant stress during the increment
556 // (in fact, the INCREMENT of creep strain is computed for mode == VM_Incremental)
557 //
558 {
559  double v, eta;
560  FloatArray help, reducedAnswer, sigma;
561  FloatMatrix C;
562  KelvinChainMaterialStatus *status = static_cast< KelvinChainMaterialStatus * >( this->giveStatus(gp) );
563 
564  // !!! chartime exponents are assumed to be equal to 1 !!!
565  if ( mode == VM_Incremental ) {
566  v = computeSolidifiedVolume(tStep);
567  eta = this->computeFlowTermViscosity(gp, tStep); //evaluated too in the middle of the time-step
568 
569  // sigma = status->giveStressVector(); //stress vector at the beginning of time-step
570  sigma = status->giveViscoelasticStressVector(); //stress vector at the beginning of time-step
571  this->giveUnitComplianceMatrix(C, gp, tStep);
572  reducedAnswer.resize( C.giveNumberOfRows() );
573  reducedAnswer.zero();
574 
575  reducedAnswer.beProductOf(C, sigma);
576  reducedAnswer.times( tStep->giveTimeIncrement() / ( timeFactor * eta ) );
577 
578  //computes non-aging creep component of the Kelvin Chain
579  KelvinChainMaterial :: giveEigenStrainVector(help, gp, tStep, mode);
580 
581  help.times(1 / v);
582  reducedAnswer.add(help);
583 
584  answer = reducedAnswer;
585  } else {
586  /* error - total mode not implemented yet */
587  OOFEM_ERROR("mode is not supported");
588  }
589 }
590 
591 
592 double
594 // Function calculates relative humidity from water content (inverse relation form sorption isotherm).
595 // Relative humidity (phi) is from range 0.2 - 0.98 !!!
596 // sorption isotherm by C. R. Pedersen (1990), Combined heat and moisture transfer in building constructions,
597 // PhD-thesis, Technical University of Denmark, Lyngby.
598 // w (kg/kg) ... water content
599 // phi ... relative humidity
600 // w_h, n, a ... constants obtained from experiments
601 {
602  double phi;
603 
604  // relative humidity
605  phi = exp( a * ( 1.0 - pow( ( w_h / w ), ( n ) ) ) );
606 
607  /*
608  * if ( ( phi < 0.2 ) || ( phi > 0.98 ) ) {
609  * OOFEM_ERROR("Relative humidity h = %e (w=%e) is out of range", phi, w);
610  * }
611  */
612 
613  return phi;
614 }
615 
616 
617 double
619 {
620  //return 1.;//!!!!!!!!!!!!!!!!!!!!!!!!!!
621  /* numerically solves non-linear differential equation in form:
622  * dS/dt + c0*S^2 = -c1/h * dh/dt
623  * where "S" is the microprestress, "c0" and "c1" constants and "h" humidity
624  *
625  * If option == 0, microprestress is evaluated in the middle of the time step (used for stiffnesses)
626  * If option == 1, MPS is evaluated at the end of the time step. (Used for updating)
627  */
628  //UNCOMMENT THIS SECTION TO USE GENERALIZED TRAPEZOIDAL RULE
629  /* new value of S - "Stemp" is computed using the generalized trapezoidal rule
630  * with weights "1-alpha" and "alpha".
631  */
632 
633  /*double S, Stemp; // old and new microprestress
634  * double humOld, humNew; // previous and new value of humidity
635  * double a, b, c, D; // auxiliary parameters used for solving quadratic equation
636  *
637  * double alpha = 0.5; // 0 for forward Euler method, 1 for backward, 0.5 for trapezoidal rule
638  * double deltaT;
639  * deltaT = tStep->giveTimeIncrement()/timeFactor;
640  *
641  * if(tStep->isTheFirstStep()){
642  * // if the time step is the first one, ask for an initial microprestress
643  * S = this->giveInitMicroPrestress();
644  * } else {
645  * B3SolidMaterialStatus *status = static_cast< B3SolidMaterialStatus * >( this->giveStatus(gp) );
646  * S = status->giveMPS();
647  * }
648  *
649  * humOld = this->giveHumidity(gp, tStep) - this->giveHumidityIncrement(gp, tStep);
650  *
651  * if (option == 1) {
652  * humNew = this->giveHumidity(gp, tStep);
653  * } else if (option == 0) {
654  * deltaT /= 2;
655  * humNew = humOld + 0.5*(this->giveHumidityIncrement(gp, tStep)); //linearly approximated
656  * } else {
657  * OOFEM_ERROR("invalid option parameter");
658  * }
659  *
660  * a = c0 * alpha * deltaT;
661  * b = 1.;
662  * c = -S + c1* (1-alpha)*(humNew/humOld -1) + c1*alpha*(1- humOld/humNew) + deltaT*pow(S, 2.)*(1-alpha)*c0;
663  *
664  * D = pow(b, 2.) - 4 * a * c; // discriminant
665  * Stemp = ( -b + sqrt(D) )/ (2 * a); // only positive root of quadr. equation is solved
666  *
667  * return Stemp;*/
668 
669  // THIS SECTION USES PARTICULAR SOLUTION OF THE GOVERNING DIFFERENTIAL EQUATION
670  double S, Stemp; // old and new microprestress
671  double humOld, humNew; // previous and new value of humidity
672  double A; // auxiliary variable
673  double RHS; // constant RHS of the diff equation
674  double dHdt; // first time difference of the humidity
675  double deltaT; // length of the time step
676 
677  deltaT = tStep->giveTimeIncrement() / timeFactor;
678  if ( tStep->isTheFirstStep() ) {
679  // if the time step is the first one, ask for an initial microprestress
680  S = this->giveInitMicroPrestress();
681  } else {
682  B3SolidMaterialStatus *status = static_cast< B3SolidMaterialStatus * >( this->giveStatus(gp) );
683  S = status->giveMPS();
684  }
685 
686  humOld = this->giveHumidity(gp, tStep) - this->giveHumidityIncrement(gp, tStep);
687  if ( option == 1 ) { // hum in the end of the time step
688  humNew = this->giveHumidity(gp, tStep);
689  } else if ( option == 0 ) { // hum in the middle of the time step
690  deltaT /= 2;
691  humNew = humOld + 0.5 * ( this->giveHumidityIncrement(gp, tStep) ); //linearly approximated
692  } else {
693  OOFEM_ERROR("invalid option parameter");
694  humNew = 0.;
695  }
696 
697  //following section is used if humidity remains constant
698  if ( ( humNew - humOld ) == 0. ) {
699  Stemp = 1 / ( 1 / S + c0 * deltaT );
700  } else { // the following section is used only if there is a change in humidity
701  dHdt = ( humNew - humOld ) / deltaT;
702  RHS = fabs(c1 * dHdt / humNew);
703  A = sqrt(RHS / c0);
704  Stemp = A * ( 1 - 2 * ( A - S ) / ( ( A - S ) + ( A + S ) * exp( 2 * deltaT * sqrt(RHS * c0) ) ) );
705  }
706 
707  return Stemp;
708 }
709 
710 
711 double
713 {
714  double S0;
715  S0 = 1 / ( c0 * tS0 );
716  return S0;
717 }
718 
719 
720 double
721 B3SolidMaterial :: giveHumidity(GaussPoint *gp, TimeStep *tStep) //computes humidity at given TimeStep
722 {
723  double humidity = 0.;
724  int err, wflag = 0;
725 
726  /* ask for humidity from external sources, if provided */
728  FieldPtr tf;
729  FloatArray gcoords, et2;
730 
731  if ( ( tf = fm->giveField(FT_HumidityConcentration) ) ) {
732  // humidity field registered
734  if ( ( err = tf->evaluateAt(et2, gcoords, VM_Total, tStep) ) ) {
735  OOFEM_ERROR("tf->evaluateAt failed, error value %d", err);
736  }
737 
738  // convert water mass to relative humidity
739  humidity = this->inverse_sorption_isotherm( et2.at(1) );
740  wflag = 1;
741  }
742 
743  if ( wflag == 0 ) {
744  OOFEM_ERROR("external fields not found");
745  }
746 
747  return humidity;
748 }
749 
750 
751 double
752 B3SolidMaterial :: giveHumidityIncrement(GaussPoint *gp, TimeStep *tStep) //computes humidity increment at given TimeStep
753 {
754  double humIncrement = 0.;
755  int err, wflag = 0;
756 
757  /* ask for humidity from external sources, if provided */
759  FieldPtr tf;
760  FloatArray gcoords, et2, ei2;
761 
762  if ( ( tf = fm->giveField(FT_HumidityConcentration) ) ) {
763  // humidity field registered
765  if ( ( err = tf->evaluateAt(et2, gcoords, VM_Total, tStep) ) ) {
766  OOFEM_ERROR("tf->evaluateAt failed, error value %d", err);
767  }
768 
769  if ( ( err = tf->evaluateAt(ei2, gcoords, VM_Incremental, tStep) ) ) {
770  OOFEM_ERROR("tf->evaluateAt failed, error value %d", err);
771  }
772 
773  // convert water mass to relative humidity
774  humIncrement = this->inverse_sorption_isotherm( et2.at(1) ) - this->inverse_sorption_isotherm( et2.at(1) - ei2.at(1) );
775  wflag = 1;
776  }
777 
778  if ( wflag == 0 ) {
779  OOFEM_ERROR("external fields not found");
780  }
781 
782  return humIncrement;
783 }
784 
785 
788 /*
789  * creates a new material status corresponding to this class
790  */
791 {
792  return new B3SolidMaterialStatus(1, this->giveDomain(), gp, nUnits);
793 }
794 
795 
796 void
798 {
799  KelvinChainMaterial :: giveRealStressVector(answer, gp, reducedStrain, tStep);
800 
801  B3SolidMaterialStatus *status = static_cast< B3SolidMaterialStatus * >( this->giveStatus(gp) );
802  if ( this->MicroPrestress == 1 ) {
803  status->setMPS( this->computeMicroPrestress(gp, tStep, 1) );
804  }
805 }
806 
807 
808 /****************************************************************************************/
809 /********** B3SolidMaterialStatus - HUMIDITY ****************************************/
810 
811 
813  KelvinChainMaterialStatus(n, d, g, nunits) { }
814 
815 void
817 {
819  microprestress_new = 0.;
820 
822 }
823 
824 
827 //
828 // saves full information stored in this Status
829 //
830 {
831  contextIOResultType iores;
832 
833  if ( ( iores = KelvinChainMaterialStatus :: saveContext(stream, mode, obj) ) != CIO_OK ) {
834  THROW_CIOERR(iores);
835  }
836 
837  // write microprestress value
838  if ( !stream.write(microprestress_old) ) {
840  }
841 
842  return CIO_OK;
843 }
844 
847 //
848 // restore the state variables from a stream
849 //
850 {
851  contextIOResultType iores;
852  if ( ( iores = KelvinChainMaterialStatus :: restoreContext(stream, mode, obj) ) != CIO_OK ) {
853  THROW_CIOERR(iores);
854  }
855 
856  // read microprestress value
857  if ( !stream.read(microprestress_old) ) {
858  return CIO_IOERR;
859  }
860 
861  return CIO_OK;
862 }
863 } // end namespace oofem
static int giveSizeOfVoigtSymVector(MaterialMode mmode)
Returns the size of symmetric part of a reduced stress/strain vector according to given mode...
virtual double giveEModulus(GaussPoint *gp, TimeStep *tStep)
Evaluation of the incremental modulus.
Definition: b3solidmat.C:244
MaterialMode giveMaterialMode()
Returns corresponding material mode of receiver.
Definition: gausspoint.h:191
double relMatAge
Physical age of the material at simulation time = 0.
Definition: rheoChM.h:138
void subtract(const FloatArray &src)
Subtracts array src to receiver.
Definition: floatarray.C:258
int number
Component number.
Definition: femcmpnn.h:80
virtual MaterialStatus * giveStatus(GaussPoint *gp) const
Returns material status of receiver in given integration point.
Definition: material.C:244
double giveCharTime(int) const
Access to the characteristic time of a given unit.
Definition: rheoChM.C:397
#define _IFT_B3Material_hum
Definition: b3mat.h:60
std::shared_ptr< Field > FieldPtr
Definition: field.h:72
Class and object Domain.
Definition: domain.h:115
#define _IFT_B3Material_q2
Definition: b3mat.h:63
Domain * domain
Link to domain object, useful for communicating with other FEM components.
Definition: femcmpnn.h:82
#define _IFT_B3Material_EpsSinf
Definition: b3mat.h:68
The purpose of DataStream abstract class is to allow to store/restore context to different streams...
Definition: datastream.h:54
double giveInitMicroPrestress(void)
Computes initial value of the MicroPrestress.
Definition: b3solidmat.C:712
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
void setMPS(double src)
Definition: b3solidmat.h:74
ValueModeType
Type representing the mode of UnknownType or CharType, or similar types.
Definition: valuemodetype.h:78
#define _IFT_B3Material_a
Definition: b3mat.h:56
double begOfTimeOfInterest
Time from which the model should give a good approximation. Optional field. Default value is 0...
Definition: rheoChM.h:149
double microprestress_old
Microprestresses.
Definition: b3solidmat.h:61
double giveMPS() const
Definition: b3solidmat.h:73
#define _IFT_B3SolidMaterial_microprestress
Definition: b3solidmat.h:44
FloatArray EparVal
Partial moduli of individual units.
Definition: rheoChM.h:155
EngngModel * giveEngngModel()
Returns engineering model to which receiver is associated.
Definition: domain.C:433
#define _IFT_B3Material_alpha2
Definition: b3mat.h:58
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: b3solidmat.C:49
int MicroPrestress
If 1, computation exploiting Microprestress solidification theory is done.
Definition: b3solidmat.h:114
double giveTargetTime()
Returns target time.
Definition: timestep.h:146
#define _IFT_B3SolidMaterial_lambda0
Definition: b3solidmat.h:50
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
Definition: b3solidmat.C:846
#define _IFT_B3Material_ks
Definition: b3mat.h:59
Element * giveElement()
Returns corresponding element to receiver.
Definition: gausspoint.h:188
General IO error.
void computePointShrinkageStrainVector(FloatArray &answer, GaussPoint *gp, TimeStep *tStep)
Evaluation of the shrinkageStrainVector. Shrinkage is fully dependent on humidity rate in given GP...
Definition: b3solidmat.C:483
#define S(p)
Definition: mdm.C:481
double c1
MPS constant c1 (=C1*R*T/M)
Definition: b3solidmat.h:116
#define _IFT_B3SolidMaterial_c0
Definition: b3solidmat.h:45
MaterialMode
Type representing material mode of integration point.
Definition: materialmode.h:89
virtual double giveEModulus(GaussPoint *gp, TimeStep *tStep)
Evaluation of the incremental modulus.
Definition: kelvinChM.C:113
FieldManager * giveFieldManager()
Definition: engngm.h:131
#define OOFEM_LOG_DEBUG(...)
Definition: logger.h:128
virtual int read(int *data, int count)=0
Reads count integer values into array pointed by data.
virtual void giveEigenStrainVector(FloatArray &answer, GaussPoint *gp, TimeStep *tStep, ValueModeType mode)
Computes, for the given integration point, the strain vector induced by the stress history (typically...
Definition: b3solidmat.C:553
double giveEndOfTimeOfInterest()
Access to the time up to which the response should be accurate.
Definition: rheoChM.C:647
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
Definition: b3solidmat.C:816
#define THROW_CIOERR(e)
Definition: contextioerr.h:61
int EmoduliMode
If 0, analysis of retardation spectrum is used for evaluation of Kelvin units moduli (default)...
Definition: b3solidmat.h:109
FloatArray charTimes
Characteristic times of individual units (relaxation or retardation times).
Definition: rheoChM.h:158
double giveTimeIncrement()
Returns solution step associated time increment.
Definition: timestep.h:150
bool isTheFirstStep()
Check if receiver is first step.
Definition: timestep.C:134
virtual void computeCharCoefficients(FloatArray &answer, double tPrime, GaussPoint *gp, TimeStep *tStep)
Evaluation of the moduli of individual units.
Definition: kelvinChM.C:48
virtual int write(const int *data, int count)=0
Writes count integer values from array pointed by data.
#define _IFT_B3Material_q1
Definition: b3mat.h:62
double timeFactor
Scaling factor transforming the simulation time units into days (gives the number of simulation time ...
Definition: rheoChM.h:167
#define _IFT_B3Material_mode
Definition: b3mat.h:43
virtual void giveEigenStrainVector(FloatArray &answer, GaussPoint *gp, TimeStep *tStep, ValueModeType mode)
Computes, for the given integration point, the strain vector induced by the stress history (typically...
Definition: kelvinChM.C:158
double endOfTimeOfInterest
Time (age???) up to which the model should give a good approximation.
Definition: rheoChM.h:151
double kSh
MPS shrinkage parameter. Either this or inithum and finalhum must be given in input record...
Definition: b3solidmat.h:118
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
Definition: kelvinChM.C:314
static void giveReducedSymVectorForm(FloatArray &answer, const FloatArray &vec, MaterialMode matMode)
Converts the full unsymmetric Voigt vector (2nd order tensor) to reduced form.
#define _IFT_B3Material_q5
Definition: b3mat.h:66
double EpsSinf
Additional parameters for average cross section shrinkage.
Definition: b3solidmat.h:97
void computeTotalAverageShrinkageStrainVector(FloatArray &answer, GaussPoint *gp, TimeStep *tStep)
Definition: b3solidmat.C:432
void giveUnitComplianceMatrix(FloatMatrix &answer, GaussPoint *gp, TimeStep *tStep)
Evaluation of elastic compliance matrix for unit Young&#39;s modulus.
Definition: rheoChM.C:286
#define OOFEM_ERROR(...)
Definition: error.h:61
#define _IFT_B3Material_q4
Definition: b3mat.h:65
EngngModelContext * giveContext()
Context requesting service.
Definition: engngm.h:1078
#define _IFT_B3Material_t0
Definition: b3mat.h:49
#define _IFT_B3SolidMaterial_ksh
Definition: b3solidmat.h:47
#define _IFT_B3Material_cc
Definition: b3mat.h:46
#define _IFT_B3SolidMaterial_emodulimode
Definition: b3solidmat.h:43
#define _IFT_B3Material_fc
Definition: b3mat.h:45
virtual double computeCreepFunction(double t, double t_prime, GaussPoint *gp, TimeStep *tStep)
Evaluation of the compliance function of the non-aging solidifying constituent.
Definition: b3solidmat.C:385
double a
Constant (obtained from experiments) A [Pedersen, 1990].
Definition: b3solidmat.h:103
double giveHumidity(GaussPoint *gp, TimeStep *tStep)
Computes relative humidity at given time step and GP.
Definition: b3solidmat.C:721
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix and anArray.
Definition: floatarray.C:676
This class implements associated Material Status to KelvinChainMaterial.
Definition: kelvinChM.h:44
#define _IFT_B3Material_wc
Definition: b3mat.h:47
This class implements associated Material Status to B3SolidMaterial.
Definition: b3solidmat.h:57
double computeSolidifiedVolume(TimeStep *tStep)
Evaluation of the relative volume of the solidified material.
Definition: b3solidmat.C:511
void predictParametersFrom(double, double, double, double, double, double, double)
Definition: b3solidmat.C:185
TimeStep * givePreviousStep()
Returns pointer to previous solution step.
Definition: timestep.C:114
bool isEmpty() const
Returns true if receiver is empty.
Definition: floatarray.h:222
double n
Constant-exponent (obtained from experiments) n [Pedersen, 1990].
Definition: b3solidmat.h:102
FieldPtr giveField(FieldType key)
Returns the previously registered field under given key; NULL otherwise.
Definition: fieldmanager.C:63
#define _IFT_B3SolidMaterial_finalhumidity
Definition: b3solidmat.h:48
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
Definition: kelvinChM.C:302
Abstract base class representing a material status information.
Definition: matstatus.h:84
#define _IFT_B3Material_q3
Definition: b3mat.h:64
virtual void updateEparModuli(double tPrime, GaussPoint *gp, TimeStep *tStep)
Update of partial moduli of individual chain units.
Definition: rheoChM.C:313
Class representing vector of real numbers.
Definition: floatarray.h:82
double EspringVal
elastic modulus of the aging spring (first member of Kelvin chain if retardation spectrum is used) ...
Definition: b3solidmat.h:104
Implementation of matrix containing floating point numbers.
Definition: floatmatrix.h:94
#define _IFT_B3Material_kt
Definition: b3mat.h:67
double lambda0
constant equal to one day in time units of analysis (eg. 86400 if the analysis runs in seconds) ...
Definition: b3solidmat.h:93
virtual void computeCharCoefficients(FloatArray &answer, double tPrime, GaussPoint *gp, TimeStep *tStep)
Evaluation of characteristic moduli of the non-aging Kelvin chain.
Definition: b3solidmat.C:345
double giveHumidityIncrement(GaussPoint *gp, TimeStep *tStep)
Computes relative humidity increment at given time step and GP.
Definition: b3solidmat.C:752
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
double c0
MPS constant c0 [MPa^-1 * day^-1].
Definition: b3solidmat.h:115
#define _IFT_B3Material_ac
Definition: b3mat.h:48
virtual MaterialStatus * CreateStatus(GaussPoint *gp) const
Creates new copy of associated status and inserts it into given integration point.
Definition: b3solidmat.C:787
Class representing the general Input Record.
Definition: inputrecord.h:101
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
Definition: kelvinChM.C:327
#define _IFT_B3Material_shmode
Definition: b3mat.h:44
virtual void giveShrinkageStrainVector(FloatArray &answer, GaussPoint *gp, TimeStep *tStep, ValueModeType mode)
Computes, for the given integration point, the strain vector induced by stress-independent shrinkage...
Definition: b3solidmat.C:402
virtual void giveRealStressVector(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedStrain, TimeStep *tStep)
Computes the real stress vector for given total strain and integration point.
Definition: kelvinChM.C:198
void zero()
Zeroes all coefficients of receiver.
Definition: floatarray.C:658
double inverse_sorption_isotherm(double w)
Definition: b3solidmat.C:593
void times(double s)
Multiplies receiver with scalar.
Definition: floatarray.C:818
long ContextMode
Context mode (mask), defining the type of information written/read to/from context.
Definition: contextmode.h:43
#define _IFT_B3Material_vs
Definition: b3mat.h:61
#define _IFT_B3Material_ncoeff
Definition: b3mat.h:55
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: kelvinChM.C:279
Domain * giveDomain() const
Definition: femcmpnn.h:100
#define _IFT_B3Material_alpha1
Definition: b3mat.h:57
REGISTER_Material(DummyMaterial)
#define IR_GIVE_OPTIONAL_FIELD(__ir, __value, __id)
Macro facilitating the use of input record reading methods.
Definition: inputrecord.h:78
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
Definition: b3solidmat.C:826
virtual void computeCharTimes()
Evaluation of characteristic times.
Definition: b3solidmat.C:298
virtual void giveRealStressVector(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedStrain, TimeStep *tStep)
Computes the real stress vector for given total strain and integration point.
Definition: b3solidmat.C:797
virtual const FloatArray & giveViscoelasticStressVector() const
Definition: rheoChM.h:97
double computeFlowTermViscosity(GaussPoint *gp, TimeStep *tStep)
Evaluation of the flow term viscosity.
Definition: b3solidmat.C:531
the oofem namespace is to define a context or scope in which all oofem names are defined.
double computeMicroPrestress(GaussPoint *gp, TimeStep *tStep, int option)
Computes microprestress at given time step and GP.
Definition: b3solidmat.C:618
#define IR_GIVE_FIELD(__ir, __value, __id)
Macro facilitating the use of input record reading methods.
Definition: inputrecord.h:69
#define _IFT_B3Material_wh
Definition: b3mat.h:54
int giveNumberOfRows() const
Returns number of rows of receiver.
Definition: floatmatrix.h:156
int nUnits
Number of (Maxwell or Kelvin) units in the rheologic chain.
Definition: rheoChM.h:136
double w_h
Constant water content (obtained from experiments) w_h [Pedersen, 1990].
Definition: b3solidmat.h:101
virtual void updateEparModuli(double tPrime, GaussPoint *gp, TimeStep *tStep)
Update of partial moduli of individual chain units.
Definition: b3solidmat.C:286
Class representing integration point in finite element program.
Definition: gausspoint.h:93
#define OOFEM_WARNING(...)
Definition: error.h:62
Class representing solution step.
Definition: timestep.h:80
virtual int computeGlobalCoordinates(FloatArray &answer, const FloatArray &lcoords)
Computes the global coordinates from given element&#39;s local coordinates.
Definition: element.C:1207
#define _IFT_B3SolidMaterial_c1
Definition: b3solidmat.h:46
void add(const FloatArray &src)
Adds array src to receiver.
Definition: floatarray.C:156
B3SolidMaterialStatus(int n, Domain *d, GaussPoint *g, int nunits)
Definition: b3solidmat.C:812
double tS0
MPS tS0 - necessary for the initial value of microprestress (age when the load is applied) ...
Definition: b3solidmat.h:117
const FloatArray & giveNaturalCoordinates()
Returns coordinate array of receiver.
Definition: gausspoint.h:138
#define _IFT_B3SolidMaterial_initialhumidity
Definition: b3solidmat.h:49
void resize(int s)
Resizes receiver towards requested size.
Definition: floatarray.C:631
enum oofem::B3SolidMaterial::b3ShModeType shMode

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:27 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011