OOFEM 3.0
Loading...
Searching...
No Matches
newtonianfluid.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
36#include "domain.h"
37#include "floatmatrix.h"
38#include "gausspoint.h"
39#include "engngm.h"
40#include "dynamicinputrecord.h"
41#include "classfactory.h"
42
43namespace oofem {
45
46void
47NewtonianFluidMaterial :: initializeFrom(InputRecord &ir)
48{
49 FluidDynamicMaterial :: initializeFrom(ir);
51
52}
53
54
55void
56NewtonianFluidMaterial :: giveInputRecord(DynamicInputRecord &input)
57{
58 FluidDynamicMaterial :: giveInputRecord(input);
60}
61
62
63double
64NewtonianFluidMaterial :: giveEffectiveViscosity(GaussPoint *gp, TimeStep *tStep) const
65{
66 return this->viscosity;
67}
68
69
70double
71NewtonianFluidMaterial :: give(int aProperty, GaussPoint *gp) const
72{
73 if ( aProperty == Viscosity ) {
74 return viscosity;
75 } else if ( aProperty == YieldStress ) {
76 return 0.0;
77 } else {
78 return FluidDynamicMaterial :: give(aProperty, gp);
79 }
80}
81
82
83std::unique_ptr<MaterialStatus>
84NewtonianFluidMaterial :: CreateStatus(GaussPoint *gp) const
85{
86 return std::make_unique<FluidDynamicMaterialStatus>(gp);
87}
88
89
91NewtonianFluidMaterial :: computeDeviatoricStress3D(const FloatArrayF<6> &eps, GaussPoint *gp, TimeStep *tStep) const
92{
93 double ekk = eps.at(1) + eps.at(2) + eps.at(3);
94
95 FloatArrayF<6> stress = {
96 2.0 * viscosity * ( eps.at(1) - ekk / 3.0 ),
97 2.0 * viscosity * ( eps.at(2) - ekk / 3.0 ),
98 2.0 * viscosity * ( eps.at(3) - ekk / 3.0 ),
99 eps.at(4) * viscosity,
100 eps.at(5) * viscosity,
101 eps.at(6) * viscosity
102 };
103
104 static_cast< FluidDynamicMaterialStatus * >( this->giveStatus(gp) )->letDeviatoricStressVectorBe(stress);
105 static_cast< FluidDynamicMaterialStatus * >( this->giveStatus(gp) )->letDeviatoricStrainRateVectorBe(eps);
106
107 return stress;
108}
109
111NewtonianFluidMaterial :: computeTangent3D(MatResponseMode mode, GaussPoint *gp, TimeStep *tStep) const
112{
113 return 2 * viscosity * I_dev6;
114}
115
116
117int
118NewtonianFluidMaterial :: checkConsistency()
119{
121 if ( domain->giveEngngModel()->giveEquationScalingFlag() ) {
122 double scale;
123 scale = domain->giveEngngModel()->giveVariableScale(VST_Density);
124 propertyDictionary.at('d') /= scale;
125
126 scale = domain->giveEngngModel()->giveVariableScale(VST_Viscosity);
127 this->viscosity /= scale;
128 }
129
130 return 1;
131}
132} // 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)
virtual MaterialStatus * giveStatus(GaussPoint *gp) const
Definition material.C:206
Dictionary propertyDictionary
Definition material.h:107
#define IR_GIVE_FIELD(__ir, __value, __id)
Definition inputrecord.h:67
#define Viscosity
Definition matconst.h:79
#define YieldStress
Definition matconst.h:80
@ VST_Viscosity
@ VST_Density
const FloatMatrixF< 6, 6 > I_dev6
I_dev matrix in Voigt (stress) form.
#define _IFT_NewtonianFluidMaterial_mu

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