OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
kelvinChSolM.C
Go to the documentation of this file.
1 /*
2  *
3  * ##### ##### ###### ###### ### ###
4  * ## ## ## ## ## ## ## ### ##
5  * ## ## ## ## ## ## ## ##
6  * ## ## ## ## ## ## ## ##
7  * ##### ##### ## ###### ## ##
8  *
9  *
10  * OOFEM : Object Oriented Finite Element Code
11  *
12  * Copyright (C) 1993 - 2013 Borek Patzak
13  *
14  *
15  *
16  * Czech Technical University, Faculty of Civil Engineering,
17  * Department of Structural Mechanics, 166 29 Prague, Czech Republic
18  *
19  * This library is free software; you can redistribute it and/or
20  * modify it under the terms of the GNU Lesser General Public
21  * License as published by the Free Software Foundation; either
22  * version 2.1 of the License, or (at your option) any later version.
23  *
24  * This program is distributed in the hope that it will be useful,
25  * but WITHOUT ANY WARRANTY; without even the implied warranty of
26  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27  * Lesser General Public License for more details.
28  *
29  * You should have received a copy of the GNU Lesser General Public
30  * License along with this library; if not, write to the Free Software
31  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
32  */
33 
34 #include "mathfem.h"
35 #include "kelvinChSolM.h"
36 #include "floatarray.h"
37 #include "floatmatrix.h"
38 #include "gausspoint.h"
39 #include "timestep.h"
40 #include "contextioerr.h"
41 
42 
43 namespace oofem {
45 { }
46 
47 double
49 {
50  /*
51  * This function returns the incremental modulus for the given time increment.
52  * Return value is the incremental E modulus of non-aging Kelvin chain without the first unit (elastic spring)
53  * The modulus may also depend on the specimen geometry (gp - dependence).
54  *
55  * It is stored as "Einc" for further expected requests from other gaussPoints that correspond to the same material.
56  *
57  * Note: time -1 refers to the previous time.
58  */
59 
60  int mu;
61  double v;
62  double lambdaMu, Emu;
63  double sum = 0.0;
64 
65  if ( (tStep->giveIntrinsicTime() < this->castingTime) ) {
66  OOFEM_ERROR("Attempted to evaluate E modulus at time lower than casting time");
67  }
68 
69  if ( this->EparVal.isEmpty() ) {
70  this->updateEparModuli(0., gp, tStep); // stiffnesses are time independent (evaluated at time t = 0.)
71  }
72 
73 
74  for ( mu = 1; mu <= nUnits; mu++ ) {
75  lambdaMu = this->computeLambdaMu(gp, tStep, mu);
76  Emu = this->giveEparModulus(mu);
77  sum += ( 1 - lambdaMu ) / Emu;
78  }
79 
80  v = this->computeSolidifiedVolume(gp, tStep);
81  return sum / v;
82 }
83 
84 void
86 //
87 // computes the strain due to creep at constant stress during the increment
88 // (in fact, the INCREMENT of creep strain is computed for mode == VM_Incremental)
89 //
90 {
91  int mu;
92  double betaMu;
93  double v;
94  FloatArray *sigmaVMu = NULL, reducedAnswer, help;
95  FloatMatrix C;
96  KelvinChainSolidMaterialStatus *status = static_cast< KelvinChainSolidMaterialStatus * >( this->giveStatus(gp) );
97 
98  if ( (tStep->giveIntrinsicTime() < this->castingTime) ) {
99  OOFEM_ERROR("Attempted to evaluate creep strain for time lower than casting time");
100  }
101 
102  if ( this->EparVal.isEmpty() ) {
103  this->updateEparModuli(0., gp, tStep); // stiffnesses are time independent (evaluated at time t = 0.)
104  }
105 
106 
107  if ( mode == VM_Incremental ) {
108  for ( mu = 1; mu <= nUnits; mu++ ) {
109  betaMu = this->computeBetaMu(gp, tStep, mu);
110  sigmaVMu = & status->giveHiddenVarsVector(mu); // JB
111 
112  if ( sigmaVMu->isNotEmpty() ) {
113  help.zero();
114  help.add(* sigmaVMu);
115  help.times( ( 1.0 - betaMu ) / this->giveEparModulus(mu) );
116  reducedAnswer.add(help);
117  }
118  }
119 
120  if ( sigmaVMu->isNotEmpty() ) {
121  help = reducedAnswer;
122  this->giveUnitComplianceMatrix(C, gp, tStep);
123  reducedAnswer.beProductOf(C, help);
124  v = this->computeSolidifiedVolume(gp, tStep);
125  reducedAnswer.times(1. / v);
126  }
127 
128  answer = reducedAnswer;
129  } else {
130  /* error - total mode not implemented yet */
131  OOFEM_ERROR("mode is not supported");
132  }
133 }
134 
135 double
137 {
138  double betaMu;
139  double deltaT;
140  double tauMu;
141 
142  deltaT = tStep->giveTimeIncrement();
143  tauMu = this->giveCharTime(Mu);
144 
145  if ( deltaT / tauMu > 30 ) {
146  betaMu = 0;
147  } else {
148  betaMu = exp(-( deltaT ) / tauMu);
149  }
150 
151  return betaMu;
152 }
153 
154 double
156 {
157  double lambdaMu;
158  double deltaT;
159  double tauMu;
160 
161  deltaT = tStep->giveTimeIncrement();
162  tauMu = this->giveCharTime(Mu);
163 
164  if ( deltaT / tauMu < 1.e-5 ) {
165  lambdaMu = 1 - 0.5 * ( deltaT / tauMu ) + 1 / 6 * ( pow(deltaT / tauMu, 2) ) - 1 / 24 * ( pow(deltaT / tauMu, 3) );
166  } else if ( deltaT / tauMu > 30 ) {
167  lambdaMu = tauMu / deltaT;
168  } else {
169  lambdaMu = ( 1.0 - exp(-( deltaT ) / tauMu) ) * tauMu / deltaT;
170  }
171 
172  return lambdaMu;
173 }
174 
175 
176 void
178 {
179  RheoChainMaterial :: giveRealStressVector(answer, gp, reducedStrain, tStep);
180 
181  // Computes hidden variables and stores them as temporary
182  this->computeHiddenVars(gp, tStep);
183 }
184 
185 
186 void
188 {
189  /*
190  * Updates hidden variables used to effectively trace the load history
191  */
192 
193  double betaMu;
194  double lambdaMu;
195 
196  FloatArray help, SigmaVMu, deltaEps0, deltaSigma;
197  FloatMatrix D;
198  KelvinChainSolidMaterialStatus *status = static_cast< KelvinChainSolidMaterialStatus * >( this->giveStatus(gp) );
199 
200  if ( ( !this->isActivated(tStep) ) || ( tStep->giveIntrinsicTime() < this->castingTime ) ) {
202  help.zero();
203  for ( int mu = 1; mu <= nUnits; mu++ ) {
204  status->letTempHiddenVarsVectorBe(mu, help);
205  }
206  return;
207  }
208 
209  help = status->giveTempStrainVector(); // gives updated strain vector (at the end of time-step)
210  help.subtract( status->giveStrainVector() ); // strain increment in current time-step
211 
212  // Subtract the stress-independent part of strain
213  this->computeStressIndependentStrainVector(deltaEps0, gp, tStep, VM_Incremental);
214  if ( deltaEps0.giveSize() ) {
215  help.subtract(deltaEps0); // should be equal to zero if there is no stress change during the time-step
216  }
217 
218  this->giveUnitStiffnessMatrix(D, gp, tStep);
219 
220  help.times( this->giveEModulus(gp, tStep) );
221  // help.times( this->giveIncrementalModulus(gp, tStep) );
222  deltaSigma.beProductOf(D, help);
223 
224  for ( int mu = 1; mu <= nUnits; mu++ ) {
225  betaMu = this->computeBetaMu(gp, tStep, mu);
226  lambdaMu = this->computeLambdaMu(gp, tStep, mu);
227 
228  help = deltaSigma;
229  help.times(lambdaMu);
230 
231  SigmaVMu = status->giveHiddenVarsVector(mu);
232 
233  if ( SigmaVMu.giveSize() ) {
234  SigmaVMu.times(betaMu);
235  SigmaVMu.add(help);
236  status->letTempHiddenVarsVectorBe(mu, SigmaVMu);
237  } else {
238  status->letTempHiddenVarsVectorBe(mu, help);
239  }
240  }
241 }
242 
243 
246 /*
247  * creates a new material status corresponding to this class
248  */
249 {
250  return new KelvinChainSolidMaterialStatus(1, this->giveDomain(), gp, nUnits);
251 }
252 
255 {
257 }
258 
259 // useless here
260 double
262 {
263  OOFEM_ERROR("function has not been yet implemented to KelvinChainSolidMaterialStatus.C");
264  return 0.;
265 }
266 
267 
268 /****************************************************************************************/
269 
271  GaussPoint *g, int nunits) :
272  RheoChainMaterialStatus(n, d, g, nunits) { }
273 
274 void
276 {
278 }
279 
280 
281 void
283 {
285 }
286 
287 void
289 {
291 }
292 
295 {
296  contextIOResultType iores;
297 
298  if ( ( iores = RheoChainMaterialStatus :: saveContext(stream, mode, obj) ) != CIO_OK ) {
299  THROW_CIOERR(iores);
300  }
301 
302  return CIO_OK;
303 }
304 
305 
308 {
309  contextIOResultType iores;
310 
311  if ( ( iores = RheoChainMaterialStatus :: restoreContext(stream, mode, obj) ) != CIO_OK ) {
312  THROW_CIOERR(iores);
313  }
314 
315  return CIO_OK;
316 }
317 } // end namespace oofem
static int giveSizeOfVoigtSymVector(MaterialMode mmode)
Returns the size of symmetric part of a reduced stress/strain vector according to given mode...
MaterialMode giveMaterialMode()
Returns corresponding material mode of receiver.
Definition: gausspoint.h:191
void subtract(const FloatArray &src)
Subtracts array src to receiver.
Definition: floatarray.C:258
virtual MaterialStatus * giveStatus(GaussPoint *gp) const
Returns material status of receiver in given integration point.
Definition: material.C:244
virtual bool isActivated(TimeStep *tStep)
Definition: rheoChM.h:292
double giveCharTime(int) const
Access to the characteristic time of a given unit.
Definition: rheoChM.C:397
Class and object Domain.
Definition: domain.h:115
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: kelvinChSolM.C:254
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
Definition: rheoChM.C:781
virtual void initTempStatus()
Initializes the temporary internal variables, describing the current state according to previously re...
Definition: kelvinChSolM.C:288
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Print receiver&#39;s output to given stream.
Definition: rheoChM.C:751
The purpose of DataStream abstract class is to allow to store/restore context to different streams...
Definition: datastream.h:54
void computeHiddenVars(GaussPoint *gp, TimeStep *tStep)
Definition: kelvinChSolM.C:187
ValueModeType
Type representing the mode of UnknownType or CharType, or similar types.
Definition: valuemodetype.h:78
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: rheoChM.C:81
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
Definition: rheoChM.C:802
This class implements associated Material Status to RheoChainMaterial.
Definition: rheoChM.h:71
FloatArray EparVal
Partial moduli of individual units.
Definition: rheoChM.h:155
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Print receiver&#39;s output to given stream.
Definition: kelvinChSolM.C:275
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
Definition: rheoChM.C:829
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: kelvinChSolM.C:177
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
Definition: kelvinChSolM.C:307
This class implements a rheologic chain model describing a viscoelastic material. ...
Definition: rheoChM.h:130
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: kelvinChSolM.C:85
#define THROW_CIOERR(e)
Definition: contextioerr.h:61
KelvinChainSolidMaterial(int n, Domain *d)
Definition: kelvinChSolM.C:44
double giveEparModulus(int iChain)
Access to partial modulus of a given unit.
Definition: rheoChM.C:303
void letTempHiddenVarsVectorBe(int i, FloatArray &valueArray)
Definition: rheoChM.C:739
double giveTimeIncrement()
Returns solution step associated time increment.
Definition: timestep.h:150
void giveUnitStiffnessMatrix(FloatMatrix &answer, GaussPoint *gp, TimeStep *tStep)
Evaluation of elastic stiffness matrix for unit Young&#39;s modulus.
Definition: rheoChM.C:267
virtual MaterialStatus * CreateStatus(GaussPoint *gp) const
Creates new copy of associated status and inserts it into given integration point.
Definition: kelvinChSolM.C:245
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
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix and anArray.
Definition: floatarray.C:676
virtual double giveEModulus(GaussPoint *gp, TimeStep *tStep)
Evaluation of the incremental modulus.
Definition: kelvinChSolM.C:48
const FloatArray & giveTempStrainVector() const
Returns the const pointer to receiver&#39;s temporary strain vector.
Definition: structuralms.h:115
virtual double computeBetaMu(GaussPoint *gp, TimeStep *tStep, int Mu)
factors for exponential algorithm
Definition: kelvinChSolM.C:136
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
Definition: kelvinChSolM.C:294
bool isEmpty() const
Returns true if receiver is empty.
Definition: floatarray.h:222
KelvinChainSolidMaterialStatus(int n, Domain *d, GaussPoint *g, int nunits)
Definition: kelvinChSolM.C:270
double giveIntrinsicTime()
Returns intrinsic time, e.g. time in which constitutive model is evaluated.
Definition: timestep.h:148
FloatArray & giveHiddenVarsVector(int i)
Definition: rheoChM.h:99
virtual double computeCreepFunction(double ofAge, double tPrime, GaussPoint *gp, TimeStep *tStep)
Evaluation of the creep compliance function - function useless here.
Definition: kelvinChSolM.C:261
Abstract base class representing a material status information.
Definition: matstatus.h:84
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
Implementation of matrix containing floating point numbers.
Definition: floatmatrix.h:94
virtual void computeStressIndependentStrainVector(FloatArray &answer, GaussPoint *gp, TimeStep *tStep, ValueModeType mode)
Computes reduced strain vector in given integration point, generated by internal processes in materia...
Definition: rheoChM.C:371
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
Class representing the general Input Record.
Definition: inputrecord.h:101
This class implements associated Material Status to KelvinChainSolidMaterial, which corresponds to a ...
Definition: kelvinChSolM.h:45
void zero()
Zeroes all coefficients of receiver.
Definition: floatarray.C:658
virtual void initTempStatus()
Initializes the temporary internal variables, describing the current state according to previously re...
Definition: rheoChM.C:796
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
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: rheoChM.C:583
Domain * giveDomain() const
Definition: femcmpnn.h:100
virtual double computeSolidifiedVolume(GaussPoint *gp, TimeStep *tStep)=0
Evaluation of the relative volume of the solidified material.
double castingTime
Casting time.
Definition: material.h:113
int giveSize() const
Returns the size of receiver.
Definition: floatarray.h:218
the oofem namespace is to define a context or scope in which all oofem names are defined.
bool isNotEmpty() const
Returns true if receiver is not empty.
Definition: floatarray.h:220
const FloatArray & giveStrainVector() const
Returns the const pointer to receiver&#39;s strain vector.
Definition: structuralms.h:105
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
Definition: kelvinChSolM.C:282
int nUnits
Number of (Maxwell or Kelvin) units in the rheologic chain.
Definition: rheoChM.h:136
virtual double computeLambdaMu(GaussPoint *gp, TimeStep *tStep, int Mu)
Definition: kelvinChSolM.C:155
Class representing integration point in finite element program.
Definition: gausspoint.h:93
Class representing solution step.
Definition: timestep.h:80
void add(const FloatArray &src)
Adds array src to receiver.
Definition: floatarray.C:156
void resize(int s)
Resizes receiver towards requested size.
Definition: floatarray.C:631

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