OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
isoheatmat.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 "isoheatmat.h"
36 #include "floatmatrix.h"
37 #include "function.h"
38 #include "gausspoint.h"
39 #include "classfactory.h"
40 #include "engngm.h"
41 
42 namespace oofem {
43 REGISTER_Material(IsotropicHeatTransferMaterial);
44 
46 {
47  // constructor
48  maturityT0 = 0.;
49 }
50 
52  // destructor
53 }
54 
57 {
58  IRResultType result; // Required by IR_GIVE_FIELD macro
59 
64 
65  return Material :: initializeFrom(ir);
66 }
67 
68 double
70 //
71 // Returns the value of the property aProperty (e.g. 'k' the conductivity of the receiver).
72 //
73 {
74  if ( aProperty == 'k' ) { //thermal conductivity [W/m/K]
75  return conductivity.eval( { { "te", giveTemperature(gp) }, { "t", tStep->giveIntrinsicTime() } }, this->giveDomain(), gp, giveTemperature(gp) );
76  } else if ( aProperty == 'c' ) { //mass-specific heat capacity [J/kg/K]
77  return capacity.eval( { { "te", giveTemperature(gp) }, { "t", tStep->giveIntrinsicTime() } }, this->giveDomain(), gp, giveTemperature(gp) );
78  } else if ( aProperty == 'd' && density.isDefined() ) { //density [kg/m3]
79  return density.eval( { { "te", giveTemperature(gp) }, { "t", tStep->giveIntrinsicTime() } }, this->giveDomain(), gp, giveTemperature(gp) );
80  } else if ( aProperty == HeatCapaCoeff ) { //volume-specific heat capacity [J/m3/K]
81  return ( this->give('c', gp, tStep) * this->give('d', gp, tStep) );
82  }
83 
84  return this->Material :: give(aProperty, gp);
85 }
86 
87 
88 void
90 {
91  TransportMaterialStatus *ms = static_cast< TransportMaterialStatus * >( this->giveStatus(gp) );
92 
93  ms->setTempField(field);
94  ms->setTempGradient(grad);
95 
97  answer.beScaled(-this->giveIsotropicConductivity(gp, tStep), grad);
98 
99  ms->setTempFlux(answer);
100 }
101 
102 
103 void
105  MatResponseMode mode,
106  GaussPoint *gp,
107  TimeStep *tStep)
108 {
109  /*
110  * returns constitutive (conductivity) matrix of receiver
111  */
112  MaterialMode mMode = gp->giveMaterialMode();
113  double cond = this->giveIsotropicConductivity(gp, tStep);
114 
115  switch ( mMode ) {
116  case _1dHeat:
117  answer.resize(1, 1);
118  answer.at(1, 1) = cond;
119  case _2dHeat:
120  answer.resize(2, 2);
121  answer.at(1, 1) = cond;
122  answer.at(2, 2) = cond;
123  return;
124 
125  case _3dHeat:
126  answer.resize(3, 3);
127  answer.at(1, 1) = cond;
128  answer.at(2, 2) = cond;
129  answer.at(3, 3) = cond;
130  return;
131 
132  default:
133  OOFEM_ERROR("unknown mode (%s)", __MaterialModeToString(mMode) );
134  }
135 }
136 
137 double
139  return give('k', gp, tStep);
140 }
141 
142 double
144  GaussPoint *gp,
145  TimeStep *tStep)
146 {
147  if ( mode == Capacity ) {
148  return ( this->give('c', gp, tStep) * this->give('d', gp, tStep) );
149  } else {
150  OOFEM_ERROR("unknown mode (%s)", __MatResponseModeToString(mode) );
151  }
152 
153  return 0.;
154 }
155 
156 
157 int
159 {
160  if ( type == IST_HydrationDegree ) {
161  answer.resize(1);
162  answer.at(1) = 0.;
163  return 1;
164  }
165 
166  if ( type == IST_Temperature ) {
167  answer = FloatArray{ this->giveTemperature(gp) };
168  return 1;
169  } else if ( type == IST_Density ) {
170  answer = FloatArray{ this->give('d', gp, tStep) };
171  return 1;
172  } else if ( type == IST_HeatCapacity ) {
173  answer = FloatArray{ this->give('c', gp, tStep) };
174  return 1;
175  } else if ( type == IST_ThermalConductivityIsotropic ) {
176  answer = FloatArray{ this->give('k', gp, tStep) };
177  return 1;
178  } else if ( type == IST_EnergyMassCapacity ) {
179  answer = FloatArray{ this->give('c', gp, tStep) * this->give('d', gp, tStep) * this->giveTemperature(gp) };
180  return 1;
181  }
182 
183  return TransportMaterial :: giveIPValue(answer, gp, type, tStep);
184 }
185 
186 
187 
188 
189 
190 
193 {
194  return new IsotropicHeatTransferMaterialStatus(1, domain, gp);
195 }
196 
198 {
199  //constructor
200 }
201 
202 
204 {
205  //destructor
206 }
207 
208 void
210 {
212 }
213 
215 {
216  IsotropicHeatTransferMaterialStatus *ms = static_cast< IsotropicHeatTransferMaterialStatus * >( this->giveStatus(gp) );
217  if ( ms->giveTempField().isEmpty() ) return 0;
218  return ms->giveTempField().at(1);
219 }
220 
221 } // end namespace oofem
ScalarFunction conductivity
Conductivity (k in input file).
Definition: isoheatmat.h:61
InternalStateType
Type representing the physical meaning of element or constitutive model internal variable.
virtual double giveIsotropicConductivity(GaussPoint *gp, TimeStep *tStep)
Definition: isoheatmat.C:138
MaterialMode giveMaterialMode()
Returns corresponding material mode of receiver.
Definition: gausspoint.h:191
const FloatArray & giveTempField()
Return last field.
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
virtual MaterialStatus * giveStatus(GaussPoint *gp) const
Returns material status of receiver in given integration point.
Definition: material.C:244
double eval(const std::map< std::string, FunctionArgument >valDict, Domain *d, GaussPoint *gp=NULL, double param=0.) const
Evaluates the receiver.
GaussPoint * gp
Associated integration point.
Class and object Domain.
Definition: domain.h:115
virtual MaterialStatus * CreateStatus(GaussPoint *gp) const
Creates new copy of associated status and inserts it into given integration point.
Definition: isoheatmat.C:192
Domain * domain
Link to domain object, useful for communicating with other FEM components.
Definition: femcmpnn.h:82
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
Definition: isoheatmat.C:209
const char * __MatResponseModeToString(MatResponseMode _value)
Definition: cltypes.C:326
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in Reduced form.
This class implements a transport material status information.
bool isDefined() const
True if receiver is defined.
IsotropicHeatTransferMaterial(int n, Domain *d)
Definition: isoheatmat.C:45
MaterialMode
Type representing material mode of integration point.
Definition: materialmode.h:89
MatResponseMode
Describes the character of characteristic material matrix.
virtual double giveCharacteristicValue(MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Computes the characteristic value of receiver in given integration point, respecting its history...
Definition: isoheatmat.C:143
void beScaled(double s, const FloatArray &b)
Sets receiver to be .
Definition: floatarray.C:146
const char * __MaterialModeToString(MaterialMode _value)
Definition: cltypes.C:314
virtual double give(int aProperty, GaussPoint *gp)
Returns the value of material property &#39;aProperty&#39;.
Definition: material.C:52
virtual void giveFluxVector(FloatArray &answer, GaussPoint *gp, const FloatArray &grad, const FloatArray &field, TimeStep *tStep)
Returns the flux for the field and its gradient.
Definition: isoheatmat.C:89
#define _IFT_IsotropicHeatTransferMaterial_k
Conductivity.
Definition: isoheatmat.h:46
ScalarFunction capacity
Capacity (c in input file).
Definition: isoheatmat.h:62
#define OOFEM_ERROR(...)
Definition: error.h:61
IsotropicHeatTransferMaterialStatus(int n, Domain *d, GaussPoint *g)
Definition: isoheatmat.C:197
void setTempField(FloatArray newField)
Set field.
#define _IFT_IsotropicHeatTransferMaterial_d
Definition: isoheatmat.h:49
double maturityT0
Baseline for maturity mathod.
Definition: isoheatmat.h:64
bool isEmpty() const
Returns true if receiver is empty.
Definition: floatarray.h:222
double at(int i, int j) const
Coefficient access function.
Definition: floatmatrix.h:176
double giveIntrinsicTime()
Returns intrinsic time, e.g. time in which constitutive model is evaluated.
Definition: timestep.h:148
void setTempGradient(FloatArray grad)
Set gradient.
Abstract base class representing a material status information.
Definition: matstatus.h:84
Class representing vector of real numbers.
Definition: floatarray.h:82
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: isoheatmat.C:56
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
#define _IFT_IsotropicHeatTransferMaterial_c
Specific heat.
Definition: isoheatmat.h:47
double giveTemperature(GaussPoint *gp)
Definition: isoheatmat.C:214
void setTempFlux(FloatArray w)
Set flux.
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 int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in Reduced form.
Definition: isoheatmat.C:158
Abstract base class for all constitutive models for transport problems.
#define _IFT_IsotropicHeatTransferMaterial_maturityT0
Baseline for maturity method.
Definition: isoheatmat.h:48
virtual double give(int aProperty, GaussPoint *gp, TimeStep *tStep)
Definition: isoheatmat.C:69
Domain * giveDomain() const
Definition: femcmpnn.h:100
REGISTER_Material(DummyMaterial)
#define IR_GIVE_OPTIONAL_FIELD(__ir, __value, __id)
Macro facilitating the use of input record reading methods.
Definition: inputrecord.h:78
the oofem namespace is to define a context or scope in which all oofem names are defined.
#define HeatCapaCoeff
Definition: matconst.h:75
#define IR_GIVE_FIELD(__ir, __value, __id)
Macro facilitating the use of input record reading methods.
Definition: inputrecord.h:69
ScalarFunction density
Density (td in input file).
Definition: isoheatmat.h:63
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 giveCharacteristicMatrix(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Computes characteristic matrix of receiver in given integration point.
Definition: isoheatmat.C:104
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