diff --git a/dumux/boxmodels/2pni/2pnifluxvariables.hh b/dumux/boxmodels/2pni/2pnifluxvariables.hh index a45313b30ff1a135c0247cc81a2868d9dfe21d61..12bce2a7ae7767caddd69453df356d345cc02362 100644 --- a/dumux/boxmodels/2pni/2pnifluxvariables.hh +++ b/dumux/boxmodels/2pni/2pnifluxvariables.hh @@ -74,46 +74,46 @@ public: * * \param problem The problem * \param element The finite element - * \param elemGeom The finite-volume geometry in the box scheme + * \param fvGeometry The finite-volume geometry in the box scheme * \param faceIdx The local index of the SCV (sub-control-volume) face - * \param elemDat The volume variables of the current element + * \param elemVolVars The volume variables of the current element * \param onBoundary A boolean variable to specify whether the flux variables * are calculated for interior SCV faces or boundary faces, default=false */ TwoPNIFluxVariables(const Problem &problem, const Element &element, - const FVElementGeometry &elemGeom, - int scvfIdx, - const ElementVolumeVariables &elemDat, + const FVElementGeometry &fvGeometry, + int faceIdx, + const ElementVolumeVariables &elemVolVars, const bool onBoundary = false) - : ParentType(problem, element, elemGeom, scvfIdx, elemDat, onBoundary) + : ParentType(problem, element, fvGeometry, faceIdx, elemVolVars, onBoundary) { // calculate temperature gradient using finite element // gradients Vector temperatureGrad(0); - Vector tmp(0.0); - for (int vertIdx = 0; vertIdx < elemGeom.numFAP; vertIdx++) + for (int idx = 0; idx < fvGeometry.numFAP; idx++) { - tmp = this->face().grad[vertIdx]; + Vector feGrad = this->face().grad[idx]; // index for the element volume variables - int volVarsIdx = this->face().fapIndices[vertIdx]; + int volVarsIdx = this->face().fapIndices[idx]; - tmp *= elemDat[volVarsIdx].temperature(); - temperatureGrad += tmp; + feGrad *= elemVolVars[volVarsIdx].temperature(); + temperatureGrad += feGrad; } // The spatial parameters calculates the actual heat flux vector - problem.spatialParameters().matrixHeatFlux(tmp, + Vector heatFlux; + problem.spatialParams().matrixHeatFlux(heatFlux, *this, - elemDat, + elemVolVars, temperatureGrad, element, - elemGeom, - scvfIdx); + fvGeometry, + faceIdx); // project the heat flux vector on the face's normal vector - normalMatrixHeatFlux_ = tmp * this->face().normal; + normalMatrixHeatFlux_ = heatFlux * this->face().normal; } /*! diff --git a/dumux/boxmodels/2pni/2pnilocalresidual.hh b/dumux/boxmodels/2pni/2pnilocalresidual.hh index 357b26c90daf8830949ac19b56bc51fe1962d926..8a69b44ad77afe284bc787c6126d578f0dfc0d39 100644 --- a/dumux/boxmodels/2pni/2pnilocalresidual.hh +++ b/dumux/boxmodels/2pni/2pnilocalresidual.hh @@ -91,33 +91,33 @@ public: * The result should be averaged over the volume (e.g. phase mass * inside a sub control volume divided by the volume) * - * \param result The phase mass within the sub-control volume + * \param storage The phase mass within the sub-control volume * \param scvIdx The SCV (sub-control-volume) index * \param usePrevSol Evaluate function with solution of current or previous time step */ - void computeStorage(PrimaryVariables &result, int scvIdx, bool usePrevSol) const + void computeStorage(PrimaryVariables &storage, int scvIdx, bool usePrevSol) const { // compute the storage term for phase mass - ParentType::computeStorage(result, scvIdx, usePrevSol); + ParentType::computeStorage(storage, scvIdx, usePrevSol); // if flag usePrevSol is set, the solution from the previous // time step is used, otherwise the current solution is // used. The secondary variables are used accordingly. This // is required to compute the derivative of the storage term // using the implicit euler method. - const ElementVolumeVariables &vertDatArray = usePrevSol ? this->prevVolVars_() : this->curVolVars_(); - const VolumeVariables &vertDat = vertDatArray[scvIdx]; + const ElementVolumeVariables &elemVolVars = usePrevSol ? this->prevVolVars_() : this->curVolVars_(); + const VolumeVariables &volVars = elemVolVars[scvIdx]; // compute the energy storage - result[temperatureIdx] = - vertDat.porosity()*(vertDat.density(wPhaseIdx) * - vertDat.internalEnergy(wPhaseIdx) * - vertDat.saturation(wPhaseIdx) + storage[temperatureIdx] = + volVars.porosity()*(volVars.density(wPhaseIdx) * + volVars.internalEnergy(wPhaseIdx) * + volVars.saturation(wPhaseIdx) + - vertDat.density(nPhaseIdx) * - vertDat.internalEnergy(nPhaseIdx) * - vertDat.saturation(nPhaseIdx)) - + vertDat.temperature()*vertDat.heatCapacity(); + volVars.density(nPhaseIdx) * + volVars.internalEnergy(nPhaseIdx) * + volVars.saturation(nPhaseIdx)) + + volVars.temperature()*volVars.heatCapacity(); } /*! @@ -139,13 +139,13 @@ public: // advective heat flux in all phases flux[energyEqIdx] = 0; - Vector tmpVec; + Vector kGradPotential; for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) { // calculate the flux in the normal direction of the // current sub control volume face fluxVars.intrinsicPermeability().mv(fluxVars.potentialGrad(phaseIdx), - tmpVec); - Scalar normalFlux = -(tmpVec*fluxVars.face().normal); + kGradPotential); + Scalar normalFlux = -(kGradPotential*fluxVars.face().normal); // data attached to upstream and the downstream vertices // of the current phase @@ -173,17 +173,17 @@ public: * the face of a sub-control volume. * * \param flux The diffusive flux over the sub-control-volume face for each phase - * \param fluxData The flux variables at the current SCV + * \param fluxVars The flux variables at the current SCV * */ void computeDiffusiveFlux(PrimaryVariables &flux, - const FluxVariables &fluxData) const + const FluxVariables &fluxVars) const { // diffusive mass flux - ParentType::computeDiffusiveFlux(flux, fluxData); + ParentType::computeDiffusiveFlux(flux, fluxVars); // diffusive heat flux - flux[energyEqIdx] += fluxData.normalMatrixHeatFlux(); + flux[energyEqIdx] += fluxVars.normalMatrixHeatFlux(); } private: diff --git a/dumux/boxmodels/2pni/2pnivolumevariables.hh b/dumux/boxmodels/2pni/2pnivolumevariables.hh index 07bb165f3c4d1aaf9d530e1bc1f74774ef57a6ab..a27f80cc5567f61aa7eef9a2e18d9daff5e15479 100644 --- a/dumux/boxmodels/2pni/2pnivolumevariables.hh +++ b/dumux/boxmodels/2pni/2pnivolumevariables.hh @@ -90,7 +90,7 @@ protected: static Scalar temperature_(const PrimaryVariables &priVars, const Problem& problem, const Element &element, - const FVElementGeometry &elemGeom, + const FVElementGeometry &fvGeometry, int scvIdx) { return priVars[Indices::temperatureIdx]; @@ -107,15 +107,15 @@ protected: /*! * \brief Called by update() to compute the energy related quantities */ - void updateEnergy_(const PrimaryVariables &sol, + void updateEnergy_(const PrimaryVariables &priVars, const Problem &problem, const Element &element, - const FVElementGeometry &elemGeom, + const FVElementGeometry &fvGeometry, int scvIdx, bool isOldSol) { // copmute and set the heat capacity of the solid phase - heatCapacity_ = problem.spatialParameters().heatCapacity(element, elemGeom, scvIdx); + heatCapacity_ = problem.spatialParams().heatCapacity(element, fvGeometry, scvIdx); Valgrind::CheckDefined(heatCapacity_); }