OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
nonlinearfluidmaterial.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 "fluiddynamicmaterial.h"
36 #include "nonlinearfluidmaterial.h"
37 #include "domain.h"
38 #include "floatmatrix.h"
39 #include "gausspoint.h"
40 #include "contextioerr.h"
41 #include "mathfem.h"
42 #include "dynamicinputrecord.h"
43 #include "classfactory.h"
44 #include "engngm.h"
45 
46 #include <cstdlib>
47 
48 namespace oofem {
49 REGISTER_Material(NonlinearFluidMaterial);
50 
51 
54 {
55  IRResultType result; // Required by IR_GIVE_FIELD macro
56 
60 
62 }
63 
64 
65 void
67 {
72 }
73 
74 
75 double
77 {
78  return this->viscosity;
79 }
80 
81 
82 double
84 {
85  if ( aProperty == Viscosity ) {
86  return viscosity;
87  } else {
88  return FluidDynamicMaterial :: give(aProperty, gp);
89  }
90 }
91 
92 
95 {
96  return new NonlinearFluidMaterialStatus(1, this->giveDomain(), gp);
97 }
98 
99 
100 void
102 {
103  NonlinearFluidMaterialStatus *status = static_cast< NonlinearFluidMaterialStatus * >( this->giveStatus(gp) );
104 
105  double normeps2;
106 
107  answer = eps;
108  if ( eps.giveSize() == 3 ) {
109  normeps2 = eps.at(1) * eps.at(1) + eps.at(2) * eps.at(2) + 0.5 * ( eps.at(3) * eps.at(3) );
110  answer.at(3) *= 0.5;
111  } else if ( eps.giveSize() == 4 ) {
112  normeps2 = eps.at(1) * eps.at(1) + eps.at(2) * eps.at(2) + eps.at(3) * eps.at(3) + 0.5 * ( eps.at(4) * eps.at(4) );
113  answer.at(4) *= 0.5;
114  } else {
115  normeps2 = eps.at(1) * eps.at(1) + eps.at(2) * eps.at(2) + eps.at(3) * eps.at(3) + 0.5 * ( eps.at(4) * eps.at(4) + eps.at(5) * eps.at(5) + eps.at(6) * eps.at(6) );
116  answer.at(4) *= 0.5;
117  answer.at(5) *= 0.5;
118  answer.at(6) *= 0.5;
119  }
120 
121  answer.times( 2.0 * viscosity * ( 1.0 + c * pow(normeps2, alpha * 0.5) ) );
122 
123  status->letTempDeviatoricStressVectorBe(answer);
124  status->letTempDeviatoricStrainVectorBe(eps);
125  status->letTempStrainNorm2Be(normeps2);
126 }
127 
128 void
130  TimeStep *tStep)
131 {
132  FloatArray eps;
133  double normeps2;
134 
135  NonlinearFluidMaterialStatus *status = static_cast< NonlinearFluidMaterialStatus * >( this->giveStatus(gp) );
136  eps = status->giveTempDeviatoricStrainVector();
137  normeps2 = status->giveTempStrainNorm2();
138 
139  answer.resize( eps.giveSize(), eps.giveSize() );
140  answer.zero();
141  for ( int i = 1; i <= answer.giveNumberOfRows(); i++ ) {
142  answer.at(i, i) = 1.;
143  }
144  if ( eps.giveSize() == 3 ) {
145  answer.at(3, 3) *= 0.5;
146  } else if ( eps.giveSize() == 4 ) {
147  answer.at(4, 4) *= 0.5;
148  } else {
149  answer.at(4, 4) *= 0.5;
150  answer.at(5, 5) *= 0.5;
151  answer.at(6, 6) *= 0.5;
152  }
153 
154  if ( normeps2 != 0 ) {
155  FloatMatrix op;
156  if ( eps.giveSize() == 3 ) {
157  eps.at(3) *= 0.5;
158  } else if ( eps.giveSize() == 4 ) {
159  eps.at(4) *= 0.5;
160  } else {
161  eps.at(4) *= 0.5;
162  eps.at(5) *= 0.5;
163  eps.at(6) *= 0.5;
164  }
165  op.beDyadicProductOf(eps, eps);
166  answer.times( 2 * viscosity * ( 1 + c * pow(normeps2, alpha * 0.5) ) );
167  answer.add(2 * viscosity * c * alpha * pow(normeps2, alpha * 0.5 - 1), op);
168  } else {
169  answer.times(2 * viscosity);
170  }
171 }
172 
173 int
175 {
177  double scale;
179  propertyDictionary.at('d') /= scale;
180 
182  this->viscosity /= scale;
183  }
184 
185  return 1;
186 }
187 
190  temp_deviatoricStressVector(),
191  temp_deviatoricStrainVector(),
192  temp_norm2(0)
193 { }
194 
195 void
197 {
199 
202 }
203 
204 void
206 {
208 
211 }
212 } // end namespace oofem
void setField(int item, InputFieldType id)
virtual void updateYourself(TimeStep *)
Update equilibrium history variables according to temp-variables.
Definition: matstatus.h:108
#define Viscosity
Definition: matconst.h:79
virtual MaterialStatus * giveStatus(GaussPoint *gp) const
Returns material status of receiver in given integration point.
Definition: material.C:244
FloatArray deviatoricStressVector
Stress vector in reduced form.
#define _IFT_NonlinearFluidMaterial_alpha
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
Class and object Domain.
Definition: domain.h:115
#define _IFT_NonlinearFluidMaterial_mu
Domain * domain
Link to domain object, useful for communicating with other FEM components.
Definition: femcmpnn.h:82
double & at(int aKey)
Returns the value of the pair which key is aKey.
Definition: dictionary.C:106
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
#define _IFT_NonlinearFluidMaterial_C
virtual double giveEffectiveViscosity(GaussPoint *gp, TimeStep *tStep)
Gives the effective viscosity for the given integration point.
EngngModel * giveEngngModel()
Returns engineering model to which receiver is associated.
Definition: domain.C:433
Dictionary propertyDictionary
Property dictionary.
Definition: material.h:105
virtual void updateYourself(TimeStep *)
Update equilibrium history variables according to temp-variables.
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
Definition: material.C:110
double c
Material constant .
MatResponseMode
Describes the character of characteristic material matrix.
virtual void initTempStatus()
Initializes the temporary internal variables, describing the current state according to previously re...
Material status class for NonlinearFluidMaterial.
virtual double give(int aProperty, GaussPoint *gp)
Returns the value of material property &#39;aProperty&#39;.
Definition: material.C:52
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
virtual void initTempStatus()
Initializes the temporary internal variables, describing the current state according to previously re...
FloatArray deviatoricStrainRateVector
Strain vector in reduced form.
This class implements a transport material status information.
double viscosity
Viscosity of material.
double alpha
Material constant .
virtual double giveVariableScale(VarScaleType varId)
Returns the scale factor for given variable type.
Definition: engngm.h:1087
void times(double f)
Multiplies receiver by factor f.
Definition: floatmatrix.C:1594
virtual MaterialStatus * CreateStatus(GaussPoint *gp) const
Creates new copy of associated status and inserts it into given integration point.
virtual double give(int aProperty, GaussPoint *)
Returns the value of material property &#39;aProperty&#39;.
double at(int i, int j) const
Coefficient access function.
Definition: floatmatrix.h:176
virtual int checkConsistency()
Allows programmer to test some internal data, before computation begins.
Abstract base class representing a material status information.
Definition: matstatus.h:84
Class representing vector of real numbers.
Definition: floatarray.h:82
Implementation of matrix containing floating point numbers.
Definition: floatmatrix.h:94
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
Definition: floatmatrix.C:1358
Class representing the general Input Record.
Definition: inputrecord.h:101
virtual bool giveEquationScalingFlag()
Returns the Equation scaling flag, which is used to indicate that governing equation(s) are scaled...
Definition: engngm.h:1085
void add(const FloatMatrix &a)
Adds matrix to the receiver.
Definition: floatmatrix.C:1023
const FloatArray & giveTempDeviatoricStrainVector()
void beDyadicProductOf(const FloatArray &vec1, const FloatArray &vec2)
Assigns to the receiver the dyadic product .
Definition: floatmatrix.C:492
Class representing the a dynamic Input Record.
void times(double s)
Multiplies receiver with scalar.
Definition: floatarray.C:818
NonlinearFluidMaterialStatus(int n, Domain *d, GaussPoint *g)
void zero()
Zeroes all coefficient of receiver.
Definition: floatmatrix.C:1326
Domain * giveDomain() const
Definition: femcmpnn.h:100
REGISTER_Material(DummyMaterial)
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.
#define IR_GIVE_FIELD(__ir, __value, __id)
Macro facilitating the use of input record reading methods.
Definition: inputrecord.h:69
int giveNumberOfRows() const
Returns number of rows of receiver.
Definition: floatmatrix.h:156
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: material.C:89
Class representing integration point in finite element program.
Definition: gausspoint.h:93
Class representing solution step.
Definition: timestep.h:80
virtual void computeDeviatoricStressVector(FloatArray &answer, GaussPoint *gp, const FloatArray &eps, TimeStep *tStep)
Computes the deviatoric stress vector from given strain.
virtual void giveDeviatoricStiffnessMatrix(FloatMatrix &answer, MatResponseMode, GaussPoint *gp, TimeStep *tStep)
Computes the deviatoric stiffness; .

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