From c6ae8f32b4719a8a110809e2f42d13c611675ab3 Mon Sep 17 00:00:00 2001 From: Klaus Mosthaf <klmos@env.dtu.dk> Date: Wed, 2 May 2012 08:19:22 +0000 Subject: [PATCH] some more renaming, adaption of indices, etc. git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@8174 2fb0f335-1f38-0410-981e-8018bf24f1b0 --- dumux/boxmodels/2p2c/2p2clocalresidual.hh | 14 +++--- dumux/boxmodels/2p2c/2p2cmodel.hh | 8 ++-- dumux/boxmodels/2p2c/2p2cpropertydefaults.hh | 4 +- dumux/boxmodels/2p2c/2p2cvolumevariables.hh | 48 ++++++++++---------- 4 files changed, 37 insertions(+), 37 deletions(-) diff --git a/dumux/boxmodels/2p2c/2p2clocalresidual.hh b/dumux/boxmodels/2p2c/2p2clocalresidual.hh index 5bd0ca6a47..603f2a9f19 100644 --- a/dumux/boxmodels/2p2c/2p2clocalresidual.hh +++ b/dumux/boxmodels/2p2c/2p2clocalresidual.hh @@ -142,8 +142,8 @@ class TwoPTwoCLocalResidual: public GET_PROP_TYPE(TypeTag, BaseLocalResidual) * \param boundaryFaceIdx The index of the boundary face */ void evalOutflowSegment(const IntersectionIterator &isIt, - int scvIdx, - int boundaryFaceIdx) + const int scvIdx, + const int boundaryFaceIdx) { const BoundaryTypes &bcTypes = this->bcTypes_(scvIdx); @@ -174,7 +174,7 @@ class TwoPTwoCLocalResidual: public GET_PROP_TYPE(TypeTag, BaseLocalResidual) * \param scvIdx The SCV (sub-control-volume) index * \param usePrevSol Evaluate function with solution of current or previous time step */ - void computeStorage(PrimaryVariables &storage, int scvIdx, bool usePrevSol) const + void computeStorage(PrimaryVariables &storage, const int scvIdx, bool usePrevSol) const { // if flag usePrevSol is set, the solution from the previous // time step is used, otherwise the current solution is @@ -215,7 +215,7 @@ class TwoPTwoCLocalResidual: public GET_PROP_TYPE(TypeTag, BaseLocalResidual) * \param faceIdx The index of the SCV face * \param onBoundary Evaluate flux at inner SCV face or on a boundary face */ - void computeFlux(PrimaryVariables &flux, int faceIdx, bool onBoundary=false) const + void computeFlux(PrimaryVariables &flux, const int faceIdx, bool onBoundary=false) const { FluxVariables fluxVars(this->problem_(), this->element_(), @@ -333,7 +333,7 @@ class TwoPTwoCLocalResidual: public GET_PROP_TYPE(TypeTag, BaseLocalResidual) if (replaceCompEqIdx != contiWEqIdx) flux[contiWEqIdx] -= tmp * FluidSystem::molarMass(wCompIdx); - // add diffusive flux of liquid component in gas phase + // add diffusive flux of liquid component in non-wetting phase tmp = fluxVars.moleFractionGrad(nPhaseIdx)*fluxVars.face().normal; tmp *= -1; tmp *= @@ -352,7 +352,7 @@ class TwoPTwoCLocalResidual: public GET_PROP_TYPE(TypeTag, BaseLocalResidual) * \param source The source/sink in the sub-control volume for each component * \param scvIdx The index of the sub-control volume */ - void computeSource(PrimaryVariables& source, int scvIdx) + void computeSource(PrimaryVariables& source, const int scvIdx) { this->problem_().boxSDSource(source, this->element_(), @@ -362,7 +362,7 @@ class TwoPTwoCLocalResidual: public GET_PROP_TYPE(TypeTag, BaseLocalResidual) } protected: - void evalPhaseStorage_(int phaseIdx) + void evalPhaseStorage_(const int phaseIdx) { // evaluate the storage terms of a single phase for (int i=0; i < this->fvGeometry_().numVertices; i++) { diff --git a/dumux/boxmodels/2p2c/2p2cmodel.hh b/dumux/boxmodels/2p2c/2p2cmodel.hh index 2c2c64dd47..9a828b2021 100644 --- a/dumux/boxmodels/2p2c/2p2cmodel.hh +++ b/dumux/boxmodels/2p2c/2p2cmodel.hh @@ -118,8 +118,8 @@ class TwoPTwoCModel: public BoxModel<TypeTag> nPhaseOnly = Indices::gPhaseOnly, bothPhases = Indices::bothPhases, - pwSn = TwoPTwoCFormulation::plSg, - pnSw = TwoPTwoCFormulation::pgSl, + pwSn = TwoPTwoCFormulation::pwSn, + pnSw = TwoPTwoCFormulation::pnSw, formulation = GET_PROP_VALUE(TypeTag, Formulation) }; @@ -192,7 +192,7 @@ public: * \param storage Contains the storage of each component for one phase * \param phaseIdx The phase index */ - void globalPhaseStorage(PrimaryVariables &storage, int phaseIdx) + void globalPhaseStorage(PrimaryVariables &storage, const int phaseIdx) { storage = 0; @@ -228,7 +228,7 @@ public: * \param globalIdx The global vertex index * \param pvIdx The primary variable index */ - Scalar primaryVarWeight(int globalIdx, int pvIdx) const + Scalar primaryVarWeight(const int globalIdx, const int pvIdx) const { if (Indices::pressureIdx == pvIdx) return std::min(1.0/this->prevSol()[globalIdx][pvIdx], 1.0); diff --git a/dumux/boxmodels/2p2c/2p2cpropertydefaults.hh b/dumux/boxmodels/2p2c/2p2cpropertydefaults.hh index 31a1f49ca4..6bd6d90274 100644 --- a/dumux/boxmodels/2p2c/2p2cpropertydefaults.hh +++ b/dumux/boxmodels/2p2c/2p2cpropertydefaults.hh @@ -86,10 +86,10 @@ SET_PROP(BoxTwoPTwoC, NumPhases) SET_INT_PROP(BoxTwoPTwoC, NumEq, 2); //!< set the number of equations to 2 -//! Set the default formulation to pl-Sg +//! Set the default formulation to pw-Sn SET_INT_PROP(BoxTwoPTwoC, Formulation, - TwoPTwoCFormulation::plSg); + TwoPTwoCFormulation::pwSn); //! set as default that no component mass balance is replaced by the total mass balance SET_INT_PROP(BoxTwoPTwoC, ReplaceCompEqIdx, 2); diff --git a/dumux/boxmodels/2p2c/2p2cvolumevariables.hh b/dumux/boxmodels/2p2c/2p2cvolumevariables.hh index 339f5fd911..764c55cb82 100644 --- a/dumux/boxmodels/2p2c/2p2cvolumevariables.hh +++ b/dumux/boxmodels/2p2c/2p2cvolumevariables.hh @@ -71,24 +71,24 @@ class TwoPTwoCVolumeVariables : public BoxVolumeVariables<TypeTag> typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices; enum { - wCompIdx = Indices::lCompIdx, - nCompIdx = Indices::gCompIdx, - wPhaseIdx = Indices::lPhaseIdx, - nPhaseIdx = Indices::gPhaseIdx + wCompIdx = Indices::wCompIdx, + nCompIdx = Indices::nCompIdx, + wPhaseIdx = Indices::wPhaseIdx, + nPhaseIdx = Indices::nPhaseIdx }; // present phases enum { - wPhaseOnly = Indices::lPhaseOnly, - nPhaseOnly = Indices::gPhaseOnly, + wPhaseOnly = Indices::wPhaseOnly, + nPhaseOnly = Indices::nPhaseOnly, bothPhases = Indices::bothPhases }; // formulations enum { formulation = GET_PROP_VALUE(TypeTag, Formulation), - pwSn = TwoPTwoCFormulation::plSg, - pnSw = TwoPTwoCFormulation::pgSl + pwSn = TwoPTwoCFormulation::pwSn, + pnSw = TwoPTwoCFormulation::pnSw }; // primary variable indices @@ -200,22 +200,22 @@ public: ///////////// // set the saturations ///////////// - Scalar Sg; + Scalar Sn; if (phasePresence == nPhaseOnly) - Sg = 1.0; + Sn = 1.0; else if (phasePresence == wPhaseOnly) { - Sg = 0.0; + Sn = 0.0; } else if (phasePresence == bothPhases) { if (formulation == pwSn) - Sg = primaryVariables[switchIdx]; + Sn = primaryVariables[switchIdx]; else if (formulation == pnSw) - Sg = 1.0 - primaryVariables[switchIdx]; + Sn = 1.0 - primaryVariables[switchIdx]; else DUNE_THROW(Dune::InvalidStateException, "Formulation: " << formulation << " is invalid."); } else DUNE_THROW(Dune::InvalidStateException, "phasePresence: " << phasePresence << " is invalid."); - fluidState.setSaturation(wPhaseIdx, 1 - Sg); - fluidState.setSaturation(nPhaseIdx, Sg); + fluidState.setSaturation(wPhaseIdx, 1 - Sn); + fluidState.setSaturation(nPhaseIdx, Sn); ///////////// // set the pressures of the fluid phases @@ -224,7 +224,7 @@ public: // calculate capillary pressure const MaterialLawParams &materialParams = problem.spatialParams().materialLawParams(element, fvGeometry, scvIdx); - Scalar pC = MaterialLaw::pC(materialParams, 1 - Sg); + Scalar pC = MaterialLaw::pC(materialParams, 1 - Sn); if (formulation == pwSn) { fluidState.setPressure(wPhaseIdx, primaryVariables[pressureIdx]); @@ -329,7 +329,7 @@ public: * * \param phaseIdx The phase index */ - Scalar saturation(int phaseIdx) const + Scalar saturation(const int phaseIdx) const { return fluidState_.saturation(phaseIdx); } /*! @@ -338,7 +338,7 @@ public: * * \param phaseIdx The phase index */ - Scalar density(int phaseIdx) const + Scalar density(const int phaseIdx) const { return fluidState_.density(phaseIdx); } /*! @@ -347,7 +347,7 @@ public: * * \param phaseIdx The phase index */ - Scalar molarDensity(int phaseIdx) const + Scalar molarDensity(const int phaseIdx) const { return fluidState_.density(phaseIdx) / fluidState_.averageMolarMass(phaseIdx); } /*! @@ -356,7 +356,7 @@ public: * * \param phaseIdx The phase index */ - Scalar pressure(int phaseIdx) const + Scalar pressure(const int phaseIdx) const { return fluidState_.pressure(phaseIdx); } /*! @@ -375,7 +375,7 @@ public: * * \param phaseIdx The phase index */ - Scalar relativePermeability(int phaseIdx) const + Scalar relativePermeability(const int phaseIdx) const { return relativePermeability_[phaseIdx]; } @@ -386,7 +386,7 @@ public: * * \param phaseIdx The phase index */ - Scalar mobility(int phaseIdx) const + Scalar mobility(const int phaseIdx) const { return relativePermeability_[phaseIdx]/fluidState_.viscosity(phaseIdx); } @@ -423,7 +423,7 @@ protected: template<class ParameterCache> static Scalar enthalpy_(const FluidState& fluidState, const ParameterCache& paramCache, - int phaseIdx) + const int phaseIdx) { return 0; } @@ -435,7 +435,7 @@ protected: const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, - int vertIdx, + const int vertIdx, bool isOldSol) { } -- GitLab