version 3.11-dev
solidmechanics/plate/membrane/localresidual.hh
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3//
4// SPDX-FileCopyrightText: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
12#ifndef DUMUX_MEMBRANE_PLATE_LOCAL_RESIDUAL_HH
13#define DUMUX_MEMBRANE_PLATE_LOCAL_RESIDUAL_HH
14
17
19
20namespace Dumux {
21
29template<class TypeTag>
32{
38 using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView;
39 using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView;
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
49public:
50 using ParentType::ParentType;
51 using ElementResidualVector = typename ParentType::ElementResidualVector;
52
53 NumEqVector computeStorage(const Problem& problem,
54 const SubControlVolume& scv,
55 const VolumeVariables& volVars) const
56 {
57 // so far we only implement the equilibrium equation
58 return NumEqVector(0.0);
59 }
60
61 NumEqVector computeFlux(const Problem& problem,
62 const Element& element,
63 const FVElementGeometry& fvGeometry,
64 const ElementVolumeVariables& elemVolVars,
65 const SubControlVolumeFace& scvf,
66 const ElementFluxVariablesCache& elemFluxVarsCache) const
67 {
68 const auto& fluxVarCache = elemFluxVarsCache[scvf];
69 Scalar gradWn = 0.0;
70 for (const auto& scv : scvs(fvGeometry))
71 gradWn += elemVolVars[scv].deformation()
72 * (fluxVarCache.gradN(scv.indexInElement()) * scvf.unitOuterNormal());
73
74 const auto tension = problem.spatialParams().tension(scvf.ipGlobal());
75
76 NumEqVector flux(0.0);
77 flux[Indices::deformationEqIdx] = tension * gradWn * scvf.area();
78 return flux;
79 }
80};
81
82} // end namespace Dumux
83
84#endif
Local residual for the membrane plate model.
Definition: solidmechanics/plate/membrane/localresidual.hh:32
NumEqVector computeStorage(const Problem &problem, const SubControlVolume &scv, const VolumeVariables &volVars) const
Definition: solidmechanics/plate/membrane/localresidual.hh:53
typename ParentType::ElementResidualVector ElementResidualVector
Definition: solidmechanics/plate/membrane/localresidual.hh:51
NumEqVector computeFlux(const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolumeFace &scvf, const ElementFluxVariablesCache &elemFluxVarsCache) const
Definition: solidmechanics/plate/membrane/localresidual.hh:61
Defines all properties used in Dumux.
The default local operator than can be specialized for each discretization scheme.
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
Definition: adapt.hh:17
typename Detail::DiscretizationDefaultLocalOperator< TypeTag >::type DiscretizationDefaultLocalOperator
Definition: defaultlocaloperator.hh:27
std::ranges::range auto scvs(const FVElementGeometry &fvGeometry, const LocalDof &localDof)
Definition: localdof.hh:79
A helper to deduce a vector with the same size as numbers of equations.