26 #ifndef EWOMS_BLACK_OIL_NEWTON_METHOD_HH
27 #define EWOMS_BLACK_OIL_NEWTON_METHOD_HH
38 template <
class TypeTag>
41 typedef typename GET_PROP_TYPE(TypeTag, DiscNewtonMethod) ParentType;
43 typedef typename GET_PROP_TYPE(TypeTag, SolutionVector) SolutionVector;
44 typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
45 typedef typename GET_PROP_TYPE(TypeTag, EqVector) EqVector;
46 typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
47 typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
48 typedef typename GET_PROP_TYPE(TypeTag, Linearizer) Linearizer;
54 { numChoppedIterations_ =
EWOMS_GET_PARAM(TypeTag,
int, BlackoilNumChoppedIterations); }
61 ParentType::registerParameters();
64 "Number of Newton-Raphson iterations for which the update gets"
81 const SolutionVector &uLastIter)
83 ParentType::endIteration_(uCurrentIter, uLastIter);
84 this->problem().model().switchPrimaryVars_();
91 PrimaryVariables& nextValue,
92 const PrimaryVariables& currentValue,
93 const EqVector& update,
94 const EqVector& currentResidual)
96 for (
int eqIdx = 0; eqIdx < numEq; ++eqIdx) {
101 Scalar delta = update[eqIdx];
102 if (this->numIterations_ < numChoppedIterations_) {
105 if (eqIdx == Indices::gasPressureIdx
106 && std::abs(delta/currentValue[eqIdx]) > 0.2)
108 delta /= std::abs(delta/(0.2*currentValue[eqIdx]));
111 else if ((eqIdx == Indices::waterSaturationIdx ||
112 (eqIdx == Indices::switchIdx
113 && currentValue.switchingVarMeaning() == PrimaryVariables::GasSaturation))
114 && std::abs(delta) > 0.2)
116 delta /= std::abs(delta/0.2);
122 nextValue[eqIdx] = currentValue[eqIdx] - delta;
127 int numChoppedIterations_;
void updatePrimaryVariables_(int globalDofIdx, PrimaryVariables &nextValue, const PrimaryVariables ¤tValue, const EqVector &update, const EqVector ¤tResidual)
Update a single primary variables object.
Definition: blackoilnewtonmethod.hh:90
#define GET_PROP_VALUE(TypeTag, PropTagName)
Access the value attribute of a property for a type tag.
Definition: propertysystem.hh:468
#define GET_PROP_TYPE(TypeTag, PropTagName)
Access the type attribute of a property for a type tag.
Definition: propertysystem.hh:485
static void registerParameters()
Register all run-time parameters for the immiscible model.
Definition: blackoilnewtonmethod.hh:59
Declares the properties required by the black oil model.
Manages the initializing and running of time dependent problems.
Definition: simulator.hh:73
void endIteration_(SolutionVector &uCurrentIter, const SolutionVector &uLastIter)
Indicates that one Newton iteration was finished.
Definition: blackoilnewtonmethod.hh:80
Definition: baseauxiliarymodule.hh:35
#define EWOMS_REGISTER_PARAM(TypeTag, ParamType, ParamName, Description)
Register a run-time parameter.
Definition: parametersystem.hh:64
A newton solver which is specific to the black oil model.
Definition: blackoilnewtonmethod.hh:39
BlackOilNewtonMethod(Simulator &simulator)
Definition: blackoilnewtonmethod.hh:53
#define EWOMS_GET_PARAM(TypeTag, ParamType, ParamName)
Retrieve a runtime parameter.
Definition: parametersystem.hh:95