Skip to content
Snippets Groups Projects
Commit ce560548 authored by Bernd Flemisch's avatar Bernd Flemisch
Browse files

box 2pni: implement naming conventions

git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@8272 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent a204e33c
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
/*!
......
......@@ -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:
......
......@@ -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_);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment