12#ifndef DUMUX_MINDLIN_REISSNER_PLATE_LOCAL_RESIDUAL_HH
13#define DUMUX_MINDLIN_REISSNER_PLATE_LOCAL_RESIDUAL_HH
15#include <dune/common/fvector.hh>
16#include <dune/common/fmatrix.hh>
29template<
class TypeTag>
41 using FVElementGeometry =
typename GridGeometry::LocalView;
42 using SubControlVolume =
typename GridGeometry::SubControlVolume;
43 using SubControlVolumeFace =
typename GridGeometry::SubControlVolumeFace;
44 using GridView =
typename GridGeometry::GridView;
45 using Element =
typename GridView::template Codim<0>::Entity;
47 using Indices =
typename ModelTraits::Indices;
48 static constexpr int dimWorld = GridView::dimensionworld;
50 using ParentType::ParentType;
57 const SubControlVolume& scv,
58 const VolumeVariables& volVars)
const
61 return NumEqVector(0.0);
68 const Element& element,
69 const FVElementGeometry& fvGeometry,
70 const ElementVolumeVariables& elemVolVars,
71 const SubControlVolumeFace& scvf,
72 const ElementFluxVariablesCache& elemFluxVarsCache)
const
75 DUNE_THROW(Dune::InvalidStateException,
"Calling computeFlux for boundary scvf");
77 const auto& fluxVarCache = elemFluxVarsCache[scvf];
78 Dune::FieldVector<Scalar, dimWorld> gradShearGradPotential(0.0);
79 Dune::FieldVector<Scalar, dimWorld> gradShearCurlPotential(0.0);
80 Dune::FieldVector<Scalar, dimWorld> gradDeformation(0.0);
81 for (
const auto& localDof :
localDofs(fvGeometry))
83 const auto& volVars = elemVolVars[localDof];
84 const auto& gradN = fluxVarCache.gradN(localDof.index());
85 gradShearGradPotential.axpy(volVars.shearGradPotential(), gradN);
86 gradShearCurlPotential.axpy(volVars.shearCurlPotential(), gradN);
87 gradDeformation.axpy(volVars.verticalDeformation(), gradN);
90 const auto rotation = problem.couplingManager().rotation(fvGeometry, scvf);
93 const auto tangent = [&](){
94 auto tangent = scvf.unitOuterNormal();
95 std::swap(tangent[0], tangent[1]);
96 tangent[1] = -tangent[1];
100 const auto thickness = problem.thickness();
101 const auto shearCorrectionFactor = problem.shearCorrectionFactor();
102 const auto shearModulus = problem.shearModulus();
103 std::swap(gradShearCurlPotential[0], gradShearCurlPotential[1]);
104 gradShearCurlPotential[1] = -gradShearCurlPotential[1];
105 gradShearCurlPotential /= shearModulus*thickness*shearCorrectionFactor;
107 NumEqVector flux(0.0);
108 flux[Indices::shearGradPotentialEqIdx] = 1.0*
vtmv(scvf.unitOuterNormal(), 1.0, gradShearGradPotential)*scvf.area();
109 gradShearGradPotential /= shearModulus*thickness*shearCorrectionFactor;
111 flux[Indices::deformationEqIdx] = -1.0*
vtmv(scvf.unitOuterNormal(), 1.0, gradDeformation-rotation-gradShearGradPotential)*scvf.area();
112 flux[Indices::shearCurlPotentialEqIdx] = -1.0*
vtmv(tangent, 1.0, rotation+gradShearCurlPotential)*scvf.area();
121template<
class TypeTag>
133 using FVElementGeometry =
typename GridGeometry::LocalView;
134 using SubControlVolume =
typename GridGeometry::SubControlVolume;
135 using SubControlVolumeFace =
typename GridGeometry::SubControlVolumeFace;
136 using GridView =
typename GridGeometry::GridView;
137 using Element =
typename GridView::template Codim<0>::Entity;
140 using Indices =
typename ModelTraits::Indices;
141 static constexpr int dimWorld = GridView::dimensionworld;
143 using ParentType::ParentType;
150 const SubControlVolume& scv,
151 const VolumeVariables& volVars)
const
154 return NumEqVector(0.0);
161 const Element& element,
162 const FVElementGeometry& fvGeometry,
163 const ElementVolumeVariables& elemVolVars,
164 const SubControlVolumeFace& scvf,
165 const ElementFluxVariablesCache& elemFluxVarsCache)
const
168 DUNE_THROW(Dune::InvalidStateException,
"Calling computeFlux for boundary scvf");
170 const auto& cm = problem.couplingManager();
171 const auto vars = cm.deformationAndPotentials(fvGeometry, scvf);
172 const auto psi = vars[cm.shearCurlPotentialIdx()];
173 const auto phi = vars[cm.shearGradPotentialIdx()];
175 Dune::FieldMatrix<Scalar, dimWorld, dimWorld> Q(0.0);
176 Q[0][0] = phi; Q[0][1] = psi;
180 const auto& fluxVarCache = elemFluxVarsCache[scvf];
181 Dune::FieldMatrix<Scalar, dimWorld, dimWorld> gradRotations(0.0);
182 for (
const auto& localDof :
localDofs(fvGeometry))
184 const auto& volVars = elemVolVars[localDof];
185 const auto& gradN = fluxVarCache.gradN(localDof.index());
186 for (
int dir = 0; dir < dimWorld; ++dir)
187 gradRotations[dir].axpy(volVars.rotation(dir), gradN);
190 const auto& globalPos = scvf.ipGlobal();
191 const auto poissonRatio = problem.poissonRatio(globalPos);
192 const auto D = problem.D(globalPos);
193 Dune::FieldMatrix<Scalar, dimWorld, dimWorld> M(0.0);
194 M[0][0] = -D*(gradRotations[0][0] + poissonRatio*gradRotations[1][1]);
195 M[1][1] = -D*(gradRotations[1][1] + poissonRatio*gradRotations[0][0]);
196 M[0][1] = -D*(1.0-poissonRatio)*0.5*(gradRotations[0][1] + gradRotations[1][0]);
200 NumEqVector flux(0.0);
201 M.mv(scvf.unitOuterNormal(), flux);
202 flux *= -scvf.area();
Local residual for the Mindlin-Reissner model (rotations)
Definition: solidmechanics/plate/mindlin_reissner/localresidual.hh:124
typename ParentType::ElementResidualVector ElementResidualVector
Definition: solidmechanics/plate/mindlin_reissner/localresidual.hh:144
NumEqVector computeFlux(const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolumeFace &scvf, const ElementFluxVariablesCache &elemFluxVarsCache) const
Evaluate the fluxes over a face of a sub control volume.
Definition: solidmechanics/plate/mindlin_reissner/localresidual.hh:160
NumEqVector computeStorage(const Problem &problem, const SubControlVolume &scv, const VolumeVariables &volVars) const
Evaluate the rate of change of all conserved quantities.
Definition: solidmechanics/plate/mindlin_reissner/localresidual.hh:149
Defines all properties used in Dumux.
The default local operator than can be specialized for each discretization scheme.
Dune::DenseMatrix< MAT >::value_type vtmv(const Dune::DenseVector< V1 > &v1, const Dune::DenseMatrix< MAT > &M, const Dune::DenseVector< V2 > &v2)
Evaluates the scalar product of a vector v2, projected by a matrix M, with a vector v1.
Definition: math.hh:880
typename NumEqVectorTraits< PrimaryVariables >::type NumEqVector
A vector with the same size as numbers of equations This is the default implementation and has to be ...
Definition: numeqvector.hh:34
typename GetProp< TypeTag, Property >::type GetPropType
get the type alias defined in the property
Definition: propertysystem.hh:296
Define some often used mathematical functions.
typename Detail::DiscretizationDefaultLocalOperator< TypeTag >::type DiscretizationDefaultLocalOperator
Definition: defaultlocaloperator.hh:27
auto localDofs(const FVElementGeometry &fvGeometry)
range over local dofs
Definition: localdof.hh:50
A helper to deduce a vector with the same size as numbers of equations.