OOFEM 3.0
Loading...
Searching...
No Matches
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 - 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
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
48namespace oofem {
50
51
52void
53NonlinearFluidMaterial :: initializeFrom(InputRecord &ir)
54{
55 FluidDynamicMaterial :: initializeFrom(ir);
59}
60
61
62void
63NonlinearFluidMaterial :: giveInputRecord(DynamicInputRecord &input)
64{
65 FluidDynamicMaterial :: giveInputRecord(input);
69}
70
71
72double
73NonlinearFluidMaterial :: giveEffectiveViscosity(GaussPoint *gp, TimeStep *tStep) const
74{
75 return this->viscosity;
76}
77
78
79double
80NonlinearFluidMaterial :: give(int aProperty, GaussPoint *gp) const
81{
82 if ( aProperty == Viscosity ) {
83 return viscosity;
84 } else {
85 return FluidDynamicMaterial :: give(aProperty, gp);
86 }
87}
88
89
90std::unique_ptr<MaterialStatus>
91NonlinearFluidMaterial :: CreateStatus(GaussPoint *gp) const
92{
93 return std::make_unique<NonlinearFluidMaterialStatus>(gp);
94}
95
96
98NonlinearFluidMaterial :: computeDeviatoricStress3D(const FloatArrayF<6> &eps, GaussPoint *gp, TimeStep *tStep) const
99{
100 NonlinearFluidMaterialStatus *status = static_cast< NonlinearFluidMaterialStatus * >( this->giveStatus(gp) );
101
103 double normeps2 = eps[0] * eps[0] + eps[1] * eps[1] + eps[2] * eps[2] + 0.5 * ( eps[3] * eps[3] + eps[4] * eps[4] + eps[5] * eps[5] );
104
105 auto answer = eps;
106 answer[3] *= 0.5;
107 answer[4] *= 0.5;
108 answer[5] *= 0.5;
109 answer *= 2.0 * viscosity * ( 1.0 + c * pow(normeps2, alpha * 0.5) );
110
111 status->letTempDeviatoricStressVectorBe(answer);
113 status->letTempStrainNorm2Be(normeps2);
114 return answer;
115}
116
118NonlinearFluidMaterial :: computeTangent3D(MatResponseMode mode, GaussPoint *gp, TimeStep *tStep) const
119{
120 NonlinearFluidMaterialStatus *status = static_cast< NonlinearFluidMaterialStatus * >( this->giveStatus(gp) );
121 double normeps2 = status->giveTempStrainNorm2();
122
123 auto answer = eye<6>();
124 answer.at(4, 4) *= 0.5;
125 answer.at(5, 5) *= 0.5;
126 answer.at(6, 6) *= 0.5;
127
128 if ( normeps2 != 0 ) {
129 auto eps = status->giveTempDeviatoricStrainVector();
130
131 eps.at(4) *= 0.5;
132 eps.at(5) *= 0.5;
133 eps.at(6) *= 0.5;
134
135 auto op = dyad(eps, eps);
136 answer *= 2 * viscosity * ( 1 + c * pow(normeps2, alpha * 0.5) );
137 answer += (2 * viscosity * c * alpha * pow(normeps2, alpha * 0.5 - 1)) * op;
138 } else {
139 answer *= 2 * viscosity;
140 }
141 return answer;
142}
143
144int
145NonlinearFluidMaterial :: checkConsistency()
146{
147 if ( domain->giveEngngModel()->giveEquationScalingFlag() ) {
148 double scale = domain->giveEngngModel()->giveVariableScale(VST_Density);
149 propertyDictionary.at('d') /= scale;
150
151 scale = domain->giveEngngModel()->giveVariableScale(VST_Viscosity);
152 this->viscosity /= scale;
153 }
154
155 return 1;
156}
157
158NonlinearFluidMaterialStatus :: NonlinearFluidMaterialStatus(GaussPoint *g) :
160{ }
161
162void
163NonlinearFluidMaterialStatus :: initTempStatus()
164{
165 FluidDynamicMaterialStatus :: initTempStatus();
166
169}
170
171void
172NonlinearFluidMaterialStatus :: updateYourself(TimeStep *tStep)
173{
174 FluidDynamicMaterialStatus :: updateYourself(tStep);
175
178}
179} // end namespace oofem
#define REGISTER_Material(class)
void setField(int item, InputFieldType id)
Domain * domain
Link to domain object, useful for communicating with other FEM components.
Definition femcmpnn.h:79
double & at(std::size_t i)
FluidDynamicMaterialStatus(GaussPoint *g)
Constructor - creates new TransportMaterialStatus with number n, belonging to domain d and integratio...
FloatArrayF< 6 > deviatoricStrainRateVector
Strain vector in reduced form.
FloatArrayF< 6 > deviatoricStressVector
Stress vector in reduced form.
virtual MaterialStatus * giveStatus(GaussPoint *gp) const
Definition material.C:206
Dictionary propertyDictionary
Definition material.h:107
void letTempDeviatoricStressVectorBe(const FloatArrayF< 6 > &v)
const FloatArrayF< 6 > & giveTempDeviatoricStrainVector()
void letTempDeviatoricStrainVectorBe(const FloatArrayF< 6 > &v)
double viscosity
Viscosity of material.
#define IR_GIVE_FIELD(__ir, __value, __id)
Definition inputrecord.h:67
#define Viscosity
Definition matconst.h:79
@ VST_Viscosity
@ VST_Density
FloatMatrixF< N, M > dyad(const FloatArrayF< N > &a, const FloatArrayF< M > &b)
Computes the dyadic product .
FloatMatrixF< N, N > eye()
Constructs an identity matrix.
#define _IFT_NonlinearFluidMaterial_mu
#define _IFT_NonlinearFluidMaterial_alpha
#define _IFT_NonlinearFluidMaterial_C

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