From 502a35e16551b1625ed76f77d590a07dcceb74a7 Mon Sep 17 00:00:00 2001 From: Philipp Nuske <philipp.nuske@mailbox.org> Date: Fri, 7 Mar 2014 14:51:47 +0000 Subject: [PATCH] test: mpnc mpnckinetic forchheimer1p forchheimer2p improving documentation of tests, according to 2p2c example and moving methods in appropriate groups git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@12590 2fb0f335-1f38-0410-981e-8018bf24f1b0 --- .../mpnc/evaporationatmosphereproblem.hh | 134 ++++++++++++------ test/implicit/mpnc/forchheimer1pproblem.hh | 72 ++++++---- test/implicit/mpnc/forchheimer2pproblem.hh | 74 ++++++---- test/implicit/mpnc/obstacleproblem.hh | 64 ++++++--- 4 files changed, 222 insertions(+), 122 deletions(-) diff --git a/test/implicit/mpnc/evaporationatmosphereproblem.hh b/test/implicit/mpnc/evaporationatmosphereproblem.hh index f9a75120a5..0d6d714c3b 100644 --- a/test/implicit/mpnc/evaporationatmosphereproblem.hh +++ b/test/implicit/mpnc/evaporationatmosphereproblem.hh @@ -99,6 +99,8 @@ SET_PROP(EvaporationAtmosphereProblem, Grid) //return 77; //#endif +//SET_TYPE_PROP(EvaporationAtmosphereProblem, LinearSolver, Dumux::BoxCGGSSolver<TypeTag> ); + // Set the problem property SET_TYPE_PROP(EvaporationAtmosphereProblem, Problem, @@ -138,7 +140,7 @@ SET_BOOL_PROP(EvaporationAtmosphereProblem, ImplicitEnableSmoothUpwinding, false SET_BOOL_PROP(EvaporationAtmosphereProblem, NewtonEnableChop, false); // use forward differences instead of central ones -SET_INT_PROP(EvaporationAtmosphereProblem, ImplicitNumericDifferenceMethod, +1); +SET_INT_PROP(EvaporationAtmosphereProblem, ImplicitNumericDifferenceMethod, +1 ); // disable partial jacobian matrix reassembly SET_BOOL_PROP(EvaporationAtmosphereProblem, ImplicitEnablePartialReassemble, false); @@ -229,6 +231,7 @@ class EvaporationAtmosphereProblem enum { numEnergyEqs = Indices::numPrimaryEnergyVars}; enum { wPhaseIdx = FluidSystem::wPhaseIdx}; enum { nPhaseIdx = FluidSystem::nPhaseIdx}; + enum { sPhaseIdx = FluidSystem::sPhaseIdx}; enum { wCompIdx = FluidSystem::H2OIdx}; enum { nCompIdx = FluidSystem::N2Idx}; enum { enableKinetic = GET_PROP_VALUE(TypeTag, EnableKinetic)}; @@ -261,6 +264,12 @@ class EvaporationAtmosphereProblem typedef Dune::array<VelocityField, numPhases> PhaseVelocityField; public: + /*! + * \brief The constructor + * + * \param timeManager The time manager + * \param gridView The grid view + */ EvaporationAtmosphereProblem(TimeManager &timeManager, const GridView &gridView) : ParentType(timeManager, gridView) @@ -318,30 +327,9 @@ public: } /*! - * \name Problem Params - */ - // \{ - - /*! - * \brief The problem name. + * \brief User defined output after the time integration * - * This is used as a prefix for files generated by the simulation. - */ - const std::string name() const - { return outputName_ ; } - - /*! - * \brief Returns the temperature within the domain. - */ - Scalar boxTemperature(const Element &element, - const FVElementGeometry &fvGeometry, - const unsigned int scvIdx) const - { return TInitial_; }; - - // \} - - /*! - * \brief Called directly after the time integration. + * Will be called diretly after the time integration. */ void postTimeStep() { @@ -409,6 +397,27 @@ public: } } + /*! + * \name Problem parameters + */ + // \{ + + /*! + * \brief Returns the problem name + * + * This is used as a prefix for files generated by the simulation. + */ + const std::string name() const + { return outputName_ ; } + + /*! + * \brief Returns the temperature \f$ K \f$ + */ + Scalar boxTemperature(const Element &element, + const FVElementGeometry &fvGeometry, + const unsigned int scvIdx) const + { return TInitial_; } + /*! * \brief Write a restart file? * yes of course: @@ -426,27 +435,18 @@ public: bool shouldWriteOutput() const { return true; } + // \} /*! - * \brief Evaluate the source term for all balance equations within a given - * sub-control-volume. - * - * Positive values mean that mass is created, negative ones - * mean that it vanishes. + * \name Boundary conditions */ - void source(PrimaryVariables & priVars, - const Element & element, - const FVElementGeometry & fvGeometry, - const unsigned int scvIdx) const - { - priVars = Scalar(0.0); - } + // \{ /*! * \brief Specifies which kind of boundary condition should be * used for which equation on a given boundary segment. * - * \param bTypes The bounentraldary types for the conservation equations + * \param bTypes The boundarytypes types for the conservation equations * \param vertex The vertex for which the boundary type is set */ void boundaryTypes(BoundaryTypes & bTypes, @@ -487,10 +487,10 @@ public: * \brief Evaluate the boundary conditions for a dirichlet * boundary segment. * - * \param priVars The dirichlet values for the primary variables + * \param priVars Stores the Dirichlet values for the conservation equations in + * \f$ [ \textnormal{unit of primary variable} ] \f$ * \param vertex The vertex for which the boundary type is set * - * For this method, the \a values parameter stores primary variables. */ void dirichlet(PrimaryVariables & priVars, const Vertex & vertex) const @@ -500,12 +500,21 @@ public: } /*! - * \brief Evaluate the boundary conditions for a neumann - * boundary segment. + * \brief Evaluates the boundary conditions for a Neumann + * boundary segment in dependency on the current solution. * - * For this method, the \a values parameter stores the mass flux - * in normal direction of each component. Negative values mean - * influx. + * \param priVars Stores the Neumann values for the conservation equations in + * \f$ [ \textnormal{unit of conserved quantity} / (m^(dim-1) \cdot s )] \f$ + * \param element The finite element + * \param fvGeometry The finite volume geometry of the element + * \param intersection The intersection between element and boundary + * \param scvIdx The local index of the sub-control volume + * \param boundaryFaceIdx The index of the boundary face + * + * This method is used for cases, when the Neumann condition depends on the + * solution and requires some quantities that are specific to the fully-implicit method. + * The \a values store the mass flux of each phase normal to the boundary. + * Negative values indicate an inflow. */ void neumann(PrimaryVariables & priVars, const Element & element, @@ -584,9 +593,22 @@ public: } } + // \} + + + /*! + * \name Volume terms + */ + // \{ + /*! * \brief Evaluate the initial value for a control volume. * + * \param priVars Stores the initial solution for the conservation equations in + * \f$ [ \textnormal{unit of primary variables} ] \f$ + * \param element The finite element + * \param fvGeometry The finite volume geometry of the element + * \param scvIdx The local index of the sub-control volume */ void initial(PrimaryVariables & priVars, const Element & element, @@ -598,6 +620,29 @@ public: initial_(priVars, globalPos); } + /*! + * \brief Evaluate the source term for all balance equations within a given + * sub-control-volume. + * + * \param priVars Stores the solution for the conservation equations in + * \f$ [ \textnormal{unit of primary variable} / (m^\textrm{dim} \cdot s )] \f$ + * \param element The finite element + * \param fvGeometry The finite volume geometry of the element + * \param scvIdx The local index of the sub-control volume + * + * Positive values mean that mass is created, negative ones mean that it vanishes. + */ + void source(PrimaryVariables & priVars, + const Element & element, + const FVElementGeometry & fvGeometry, + const unsigned int scvIdx) const + { + priVars = Scalar(0.0); + } + + // \} + + private: // the internal method for the initial condition void initial_(PrimaryVariables &priVars, @@ -686,7 +731,6 @@ private: for (int energyEqIdx=0; energyEqIdx< numEnergyEqs; ++energyEqIdx) priVars[energyEq0Idx + energyEqIdx] = T; - for (int phaseIdx=0; phaseIdx<numPhases; phaseIdx++) equilibriumFluidState.setPressure(phaseIdx, p[phaseIdx]); diff --git a/test/implicit/mpnc/forchheimer1pproblem.hh b/test/implicit/mpnc/forchheimer1pproblem.hh index f86a58fbe5..44e24f34c9 100644 --- a/test/implicit/mpnc/forchheimer1pproblem.hh +++ b/test/implicit/mpnc/forchheimer1pproblem.hh @@ -169,6 +169,12 @@ class Forchheimer1pProblem typedef typename GET_PROP_TYPE(TypeTag, TimeManager) TimeManager; public: + /*! + * \brief The constructor + * + * \param timeManager The time manager + * \param gridView The grid view + */ Forchheimer1pProblem(TimeManager &timeManager, const GridView &gridView) : ParentType(timeManager, gridView) { @@ -203,7 +209,9 @@ public: } /*! - * \brief Called directly after the time integration. + * \brief User defined output after the time integration + * + * Will be called diretly after the time integration. */ void postTimeStep() { @@ -241,7 +249,7 @@ public: // \{ /*! - * \brief The problem name. + * \brief Returns the problem name * * This is used as a prefix for files generated by the simulation. */ @@ -249,10 +257,18 @@ public: { return outputName_; } /*! - * \brief Returns the temperature [K] within the domain. + * \brief Returns the temperature \f$ K \f$ */ Scalar temperatureAtPos(const GlobalPosition &globalPos) const - { return temperature_; }; + { return temperature_; } + + /*! + * \brief Write a restart file? + */ + bool shouldWriteRestartFile() const + { + return ParentType::shouldWriteRestartFile(); + } // \} @@ -282,7 +298,8 @@ public: * \brief Evaluate the boundary conditions for a dirichlet * boundary segment. * - * \param values The dirichlet values for the primary variables + * \param values Stores the Dirichlet values for the conservation equations in + * \f$ [ \textnormal{unit of primary variable} ] \f$ * \param vertex The vertex for which the boundary type is set * * For this method, the \a values parameter stores primary variables. @@ -295,12 +312,18 @@ public: } /*! - * \brief Evaluate the boundary conditions for a neumann + * \brief Evaluates the boundary conditions for a Neumann * boundary segment. * - * For this method, the \a values parameter stores the mass flux - * in normal direction of each component. Negative values mean - * influx. + * \param values Stores the Neumann values for the conservation equations in + * \f$ [ \textnormal{unit of conserved quantity} / (m^(dim-1) \cdot s )] \f$ + * \param element The finite element + * \param fvGeometry The finite volume geometry of the element + * \param intersection The intersection between element and boundary + * \param scvIdx The local index of the sub-control volume + * \param boundaryFaceIdx The index of the boundary face + * + * Negative values mean influx. */ void neumann(PrimaryVariables &values, const Element &element, @@ -318,13 +341,16 @@ public: // \{ /*! - * \brief Evaluate the source term for all phases within a given + * \brief Evaluate the source term for all balance equations within a given * sub-control-volume. * - * For this method, the \a values parameter stores the rate mass - * of a component is generated or annihilate per volume - * unit. Positive values mean that mass is created, negative ones - * mean that it vanishes. + * \param values Stores the solution for the conservation equations in + * \f$ [ \textnormal{unit of primary variable} / (m^\textrm{dim} \cdot s )] \f$ + * \param element The finite element + * \param fvGeometry The finite volume geometry of the element + * \param scvIdx The local index of the sub-control volume + * + * Positive values mean that mass is created, negative ones mean that it vanishes. */ void source(PrimaryVariables &values, const Element &element, @@ -337,8 +363,11 @@ public: /*! * \brief Evaluate the initial value for a control volume. * - * For this method, the \a values parameter stores primary - * variables. + * \param values Stores the solution for the conservation equations in + * \f$ [ \textnormal{unit of primary variable} ] \f$ + * \param element The finite element + * \param fvGeometry The finite volume geometry of the element + * \param scvIdx The local index of the sub-control volume */ void initial(PrimaryVariables &values, const Element &element, @@ -353,17 +382,6 @@ public: // \} - - - - /*! - * \brief Write a restart file? - */ - bool shouldWriteRestartFile() const - { - return ParentType::shouldWriteRestartFile(); - } - private: // the internal method for the initial condition void initial_(PrimaryVariables &values, diff --git a/test/implicit/mpnc/forchheimer2pproblem.hh b/test/implicit/mpnc/forchheimer2pproblem.hh index 00e663e326..ebcd3d1254 100644 --- a/test/implicit/mpnc/forchheimer2pproblem.hh +++ b/test/implicit/mpnc/forchheimer2pproblem.hh @@ -18,9 +18,7 @@ *****************************************************************************/ /** * \file - * \brief Problem where water and gas is injected by means of a - * dirchlet condition on the lower right of the domain which have to go - * around an obstacle with \f$10^3\f$ lower permeability. + * \brief Problem for testing the two-phase forchheimer relation. */ #ifndef DUMUX_FORCHEIMER2P_HH #define DUMUX_FORCHEIMER2P_HH @@ -163,6 +161,12 @@ class Forchheimer2pProblem typedef typename GET_PROP_TYPE(TypeTag, TimeManager) TimeManager; public: + /*! + * \brief The constructor + * + * \param timeManager The time manager + * \param gridView The grid view + */ Forchheimer2pProblem(TimeManager &timeManager, const GridView &gridView) : ParentType(timeManager, gridView) { @@ -197,7 +201,9 @@ public: } /*! - * \brief Called directly after the time integration. + * \brief User defined output after the time integration + * + * Will be called diretly after the time integration. */ void postTimeStep() { @@ -235,7 +241,7 @@ public: // \{ /*! - * \brief The problem name. + * \brief Returns the problem name * * This is used as a prefix for files generated by the simulation. */ @@ -243,10 +249,18 @@ public: { return outputName_; } /*! - * \brief Returns the temperature [K] within the domain. + * \brief Returns the temperature \f$ K \f$ */ Scalar temperatureAtPos(const GlobalPosition &globalPos) const - { return temperature_; }; + { return temperature_; } + + /*! + * \brief Write a restart file? + */ + bool shouldWriteRestartFile() const + { + return ParentType::shouldWriteRestartFile(); + } // \} @@ -276,7 +290,8 @@ public: * \brief Evaluate the boundary conditions for a dirichlet * boundary segment. * - * \param values The dirichlet values for the primary variables + * \param values Stores the Dirichlet values for the conservation equations in + * \f$ [ \textnormal{unit of primary variable} ] \f$ * \param vertex The vertex for which the boundary type is set * * For this method, the \a values parameter stores primary variables. @@ -289,12 +304,18 @@ public: } /*! - * \brief Evaluate the boundary conditions for a neumann + * \brief Evaluates the boundary conditions for a Neumann * boundary segment. * - * For this method, the \a values parameter stores the mass flux - * in normal direction of each component. Negative values mean - * influx. + * \param values Stores the Neumann values for the conservation equations in + * \f$ [ \textnormal{unit of conserved quantity} / (m^(dim-1) \cdot s )] \f$ + * \param element The finite element + * \param fvGeometry The finite volume geometry of the element + * \param intersection The intersection between element and boundary + * \param scvIdx The local index of the sub-control volume + * \param boundaryFaceIdx The index of the boundary face + * + * Negative values mean influx. */ void neumann(PrimaryVariables &values, const Element &element, @@ -312,13 +333,16 @@ public: // \{ /*! - * \brief Evaluate the source term for all phases within a given + * \brief Evaluate the source term for all balance equations within a given * sub-control-volume. * - * For this method, the \a values parameter stores the rate mass - * of a component is generated or annihilate per volume - * unit. Positive values mean that mass is created, negative ones - * mean that it vanishes. + * \param priVars Stores the solution for the conservation equations in + * \f$ [ \textnormal{unit of primary variable} / (m^\textrm{dim} \cdot s )] \f$ + * \param element The finite element + * \param fvGeometry The finite volume geometry of the element + * \param scvIdx The local index of the sub-control volume + * + * Positive values mean that mass is created, negative ones mean that it vanishes. */ void source(PrimaryVariables &values, const Element &element, @@ -331,8 +355,11 @@ public: /*! * \brief Evaluate the initial value for a control volume. * - * For this method, the \a values parameter stores primary - * variables. + * \param values Stores the solution for the conservation equations in + * \f$ [ \textnormal{unit of primary variable} ] \f$ + * \param element The finite element + * \param fvGeometry The finite volume geometry of the element + * \param scvIdx The local index of the sub-control volume */ void initial(PrimaryVariables &values, const Element &element, @@ -347,15 +374,6 @@ public: // \} - - /*! - * \brief Write a restart file? - */ - bool shouldWriteRestartFile() const - { - return ParentType::shouldWriteRestartFile(); - } - private: // the internal method for the initial condition void initial_(PrimaryVariables &values, diff --git a/test/implicit/mpnc/obstacleproblem.hh b/test/implicit/mpnc/obstacleproblem.hh index cb328c67eb..ad13f70b2e 100644 --- a/test/implicit/mpnc/obstacleproblem.hh +++ b/test/implicit/mpnc/obstacleproblem.hh @@ -164,6 +164,12 @@ class ObstacleProblem enum { isBox = GET_PROP_VALUE(TypeTag, ImplicitIsBox) }; public: + /*! + * \brief The constructor + * + * \param timeManager The time manager + * \param gridView The grid view + */ ObstacleProblem(TimeManager &timeManager, const GridView &gridView) : ParentType(timeManager, gridView) { @@ -184,7 +190,9 @@ public: } /*! - * \brief Called directly after the time integration. + * \brief User defined output after the time integration + * + * Will be called diretly after the time integration. */ void postTimeStep() { @@ -222,7 +230,7 @@ public: // \{ /*! - * \brief The problem name. + * \brief Returns the problem name * * This is used as a prefix for files generated by the simulation. */ @@ -230,10 +238,20 @@ public: { return name_; } /*! - * \brief Returns the temperature [K] within the domain. + * \brief Returns the temperature \f$ K \f$ + * + * \param globalPos The global position */ Scalar temperatureAtPos(const GlobalPosition &globalPos) const - { return temperature_; }; + { return temperature_; } + + /*! + * \brief Write a restart file? + */ + bool shouldWriteRestartFile() const + { + return ParentType::shouldWriteRestartFile(); + } // \} @@ -262,7 +280,8 @@ public: * \brief Evaluate the boundary conditions for a dirichlet * control volume. * - * \param values The dirichlet values for the primary variables + * \param values Stores the Dirichlet values for the conservation equations in + * \f$ [ \textnormal{unit of primary variable} ] \f$ * \param globalPos The center of the finite volume which ought to be set. * * For this method, the \a values parameter stores primary variables. @@ -274,12 +293,18 @@ public: } /*! - * \brief Evaluate the boundary conditions for a neumann + * \brief Evaluates the boundary conditions for a Neumann * boundary segment. * - * For this method, the \a values parameter stores the mass flux - * in normal direction of each component. Negative values mean - * influx. + * \param values Stores the Neumann values for the conservation equations in + * \f$ [ \textnormal{unit of conserved quantity} / (m^(dim-1) \cdot s )] \f$ + * \param element The finite element + * \param fvGeometry The finite volume geometry of the element + * \param intersection The intersection between element and boundary + * \param scvIdx The local index of the sub-control volume + * \param boundaryFaceIdx The index of the boundary face + * + * Negative values mean influx. */ void neumann(PrimaryVariables &values, const Element &element, @@ -297,13 +322,16 @@ public: // \{ /*! - * \brief Evaluate the source term for all phases within a given + * \brief Evaluate the source term for all balance equations within a given * sub-control-volume. * - * For this method, the \a values parameter stores the rate mass - * of a component is generated or annihilate per volume - * unit. Positive values mean that mass is created, negative ones - * mean that it vanishes. + * \param priVars Stores the solution for the conservation equations in + * \f$ [ \textnormal{unit of primary variable} / (m^\textrm{dim} \cdot s )] \f$ + * \param element The finite element + * \param fvGeometry The finite volume geometry of the element + * \param scvIdx The local index of the sub-control volume + * + * Positive values mean that mass is created, negative ones mean that it vanishes. */ void source(PrimaryVariables &values, const Element &element, @@ -331,14 +359,6 @@ public: // \} - /*! - * \brief Write a restart file? - */ - bool shouldWriteRestartFile() const - { - return ParentType::shouldWriteRestartFile(); - } - private: // the internal method for the initial condition void initial_(PrimaryVariables &values, -- GitLab