OOFEM 3.0
Loading...
Searching...
No Matches
nonlinearmassmat.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 "floatmatrix.h"
37#include "gausspoint.h"
38#include "mathfem.h"
39#include "classfactory.h"
40#include <floatmatrixf.h>
41
42namespace oofem {
44
45void
46NonlinearMassTransferMaterial :: initializeFrom(InputRecord &ir)
47{
48 Material :: initializeFrom(ir);
49
52}
53
54double
55NonlinearMassTransferMaterial :: giveCharacteristicValue(MatResponseMode mode,
56 GaussPoint *gp,
57 TimeStep *tStep) const
58{
59 return 0.;
60}
61
63NonlinearMassTransferMaterial :: computeFlux3D(const FloatArrayF<3> &grad, double field, GaussPoint *gp, TimeStep *tStep) const
64{
65 auto ms = static_cast< TransportMaterialStatus * >( this->giveStatus(gp) );
66 ms->setTempGradient(grad);
67 ms->setTempField(field);
68
69 double gradPNorm = norm(grad);
70 auto answer = -( 1. + C * pow(gradPNorm, alpha) ) * grad;
71 ms->setTempFlux(answer);
72 return answer;
73}
74
75
77NonlinearMassTransferMaterial :: computeTangent3D(MatResponseMode mode, GaussPoint *gp, TimeStep *tStep) const
78{
79 auto ms = static_cast< TransportMaterialStatus * >( this->giveStatus(gp) );
80 const auto &eps = ms->giveTempGradient();
81 double gradPNorm = norm(eps);
82
83 auto scale = gradPNorm != 0. ? C * alpha * pow(gradPNorm, alpha - 2) : 1.;
84 auto t1 = scale * dyad(eps, eps);
85 return t1 + (1 + C * pow(gradPNorm, alpha)) * eye<3>();
86}
87
88int
89NonlinearMassTransferMaterial :: giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
90{
91 auto ms = static_cast< TransportMaterialStatus * >( this->giveStatus(gp) );
92
93 switch ( type ) {
94 case IST_Velocity:
95 answer = ms->giveFlux();
96 break;
97 case IST_PressureGradient:
98 answer = ms->giveGradient();
99 break;
100 default:
101 return TransportMaterial :: giveIPValue(answer, gp, type, tStep);
102 }
103 return 1;
104}
105} // end namespace oofem
#define REGISTER_Material(class)
virtual MaterialStatus * giveStatus(GaussPoint *gp) const
Definition material.C:206
double alpha
Indicates the level of nonlinearity in the model.
double C
Indicates the level of nonlinearity in the model.
void setTempGradient(const FloatArrayF< 3 > &newGradient)
Set gradient.
const FloatArrayF< 3 > & giveTempGradient() const
Return last gradient.
#define IR_GIVE_FIELD(__ir, __value, __id)
Definition inputrecord.h:67
double norm(const FloatArray &x)
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_NonlinearMassTransferMaterial_c
#define _IFT_NonlinearMassTransferMaterial_alpha

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