1#ifndef __DUNE_ACFEM_MODELS_MODULES_FLUIDSELFTRANSPORTMODEL_HH__
2#define __DUNE_ACFEM_MODELS_MODULES_FLUIDSELFTRANSPORTMODEL_HH__
4#include "../operatorparts/modeladapter.hh"
48 template<
class FunctionSpace>
50 :
public OperatorPartsExpression<FluidSelfTransportOperatorParts<FunctionSpace> >
57 typedef FunctionSpace FunctionSpaceType;
59 typedef typename FunctionSpaceType::DomainType DomainType;
60 typedef typename FunctionSpaceType::RangeType RangeType;
61 typedef typename FunctionSpaceType::JacobianRangeType JacobianRangeType;
62 typedef typename FunctionSpaceType::HessianRangeType HessianRangeType;
65 dimDomain = FunctionSpaceType::dimDomain,
66 dimRange = FunctionSpaceType::dimRange,
70 static_assert(dimDomain == dimRange && dimDomain == dimWorld,
71 "This is meant for dimensionworld vector-fields, "
72 "like fluids, deformations etc.");
74 typedef typename FunctionSpaceType::DomainFieldType DomainFieldType;
75 typedef typename FunctionSpaceType::RangeFieldType RangeFieldType;
80 : name_(name ==
"" ?
"(-U_iU_jD_iPhi_j+Bndry)" : name)
83 std::string name()
const
89 template<
class Intersection>
101 template<
class Entity,
class Po
int>
102 void flux (
const Entity& entity,
104 const RangeType& value,
105 const JacobianRangeType& jacobian,
106 JacobianRangeType&
flux)
const
110 for (
int i = 0; i < dimWorld; ++i) {
111 flux[i][i] = value[i] * value[i];
112 for (
int j = i+1; j < dimWorld; ++j) {
113 flux[i][j] =
flux[j][i] = - (value[i] * value[j]);
119 template<
class Entity,
class Po
int>
121 const JacobianRangeType& DuBar,
122 const Entity& entity,
124 const RangeType& value,
125 const JacobianRangeType& jacobian,
126 JacobianRangeType&
flux)
const
130 for (
int i = 0; i < dimWorld; ++i) {
131 flux[i][i] = 2.0 * uBar[i] * value[i];
132 for (
int j = i+1; j < dimWorld; ++j) {
133 flux[i][j] =
flux[j][i] = - (uBar[i] * value[j] + uBar[j] * value[i]);
140 template<
class Entity,
class Po
int>
143 const RangeType& value,
144 const JacobianRangeType& jacobian,
145 const HessianRangeType& hessian,
146 RangeType& result)
const
149 jacobian.mv(value, result);
152 template<
class Intersection,
class Po
int>
153 void robinFlux(
const Intersection& intersection,
155 const DomainType& unitOuterNormal,
156 const RangeType& value,
157 RangeType& result)
const
160 result *= (value * unitOuterNormal);
163 template<
class Intersection,
class Po
int>
164 void linearizedRobinFlux(
const RangeType& uBar,
165 const Intersection& intersection,
167 const DomainType& unitOuterNormal,
168 const RangeType& value,
169 RangeType& result)
const
171 RangeFieldType flowBar(0), flow(0);
172 for (
int i = 0; i < dimWorld; ++i) {
173 flowBar += unitOuterNormal[i] * uBar[i];
174 flow += unitOuterNormal[i] * value[i];
176 for (
int i = 0; i < dimWorld; ++i) {
177 result[i] = flow * uBar[i] + flowBar * value[i];
182 const std::string name_;
185 template<
class FunctionSpace>
186 struct OperatorPartsTraits<FluidSelfTransportOperatorParts<FunctionSpace> >
187 :
public DefaultOperatorPartsTraits<FunctionSpace>
194 isSemiDefinite =
false,
216 template<
class Object>
218 FluidSelfTransportOperatorParts<typename Object::FunctionSpaceType>
229 template<
class Object>
231 OperatorPartsAdapterModel<FluidSelfTransportOperatorParts<typename Object::FunctionSpaceType>,
232 typename Object::GridPartType>
236 typedef typename Object::GridPartType GridPartType;
237 return OperatorPartsAdapterModel<OperatorPartsType, GridPartType>(OperatorPartsType(name));
Default model implementation.
Definition: operatorparts.hh:387
Define a model for the "Navier-Stokes" non-lineariry.
Definition: fluidselftransportmodel.hh:51
Interface class for second order elliptic models.
Definition: operatorparts.hh:92
bool setIntersection(const Intersection &intersection) const
Per-intersection initialization for the boundary contributions.
Definition: fluidselftransportmodel.hh:90
void linearizedFlux(const RangeType &uBar, const JacobianRangeType &DuBar, const Entity &entity, const Point &x, const RangeType &value, const JacobianRangeType &jacobian, JacobianRangeType &flux) const
Evaluate the linearized flux in local coordinates.
Definition: fluidselftransportmodel.hh:120
static FluidSelfTransportOperatorParts< typename Object::FunctionSpaceType > fluidSelfTransportOperatorParts(const Object &object, const std::string &name="")
Generate a Navier-Stokes non-linearity fitting the given object.
Definition: fluidselftransportmodel.hh:219
ConstituentFlags
Provide information about the constituents of the model.
Definition: fluidselftransportmodel.hh:198
void flux(const Entity &entity, const Point &x, const RangeType &value, const JacobianRangeType &jacobian, JacobianRangeType &flux) const
Evaluate in local coordinates.
Definition: fluidselftransportmodel.hh:102
void fluxDivergence(const Entity &entity, const Point &x, const RangeType &value, const JacobianRangeType &jacobian, const HessianRangeType &hessian, RangeType &result) const
Compute the point-wise value of the flux-part of the operator, meaning the part of the differential o...
Definition: fluidselftransportmodel.hh:141
StructureFlags
Static flags for the overall structure of the operator.
Definition: fluidselftransportmodel.hh:191
static OperatorPartsAdapterModel< FluidSelfTransportOperatorParts< typename Object::FunctionSpaceType >, typename Object::GridPartType > fluidSelfTransportModel(const Object &object, const std::string &name="")
Generate a Navier-Stokes non-linearity fitting the given object.
Definition: fluidselftransportmodel.hh:233
Traits-template which has to be specialized for each individual model.
Definition: operatorparts.hh:36