From bb3afbf31e73ccaed5f1da8fe9513f1a3ac0c217 Mon Sep 17 00:00:00 2001 From: Timo Koch <timo.koch@iws.uni-stuttgart.de> Date: Fri, 20 Jan 2017 14:57:25 +0100 Subject: [PATCH] [pm][velocityoutput] Correct by extrusion factor. Output unit. --- dumux/io/vtkoutputmodule.hh | 8 ++++---- dumux/porousmediumflow/implicit/velocityoutput.hh | 8 +++++++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/dumux/io/vtkoutputmodule.hh b/dumux/io/vtkoutputmodule.hh index 5c3a1d87c2..259e6b69da 100644 --- a/dumux/io/vtkoutputmodule.hh +++ b/dumux/io/vtkoutputmodule.hh @@ -291,16 +291,16 @@ public: { using NestedFunction = VtkNestedFunction<GridView, VertexMapper, std::vector<GlobalPosition>>; for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) - sequenceWriter_.addVertexData(std::make_shared<NestedFunction>("velocity_" + std::string(FluidSystem::phaseName(phaseIdx)), - problem_.gridView(), problem_.vertexMapper(), - velocity[phaseIdx], dim, dimWorld)); + sequenceWriter_.addVertexData(std::make_shared<NestedFunction>("velocity_" + std::string(FluidSystem::phaseName(phaseIdx)) + " (m/s)", + problem_.gridView(), problem_.vertexMapper(), + velocity[phaseIdx], dim, dimWorld)); } // cell-centered models else { using NestedFunction = VtkNestedFunction<GridView, ElementMapper, std::vector<GlobalPosition>>; for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) - sequenceWriter_.addCellData(std::make_shared<NestedFunction>("velocity_" + std::string(FluidSystem::phaseName(phaseIdx)), + sequenceWriter_.addCellData(std::make_shared<NestedFunction>("velocity_" + std::string(FluidSystem::phaseName(phaseIdx)) + " (m/s)", problem_.gridView(), problem_.elementMapper(), velocity[phaseIdx], 0, dimWorld)); } diff --git a/dumux/porousmediumflow/implicit/velocityoutput.hh b/dumux/porousmediumflow/implicit/velocityoutput.hh index 3e75f61866..5980213d44 100644 --- a/dumux/porousmediumflow/implicit/velocityoutput.hh +++ b/dumux/porousmediumflow/implicit/velocityoutput.hh @@ -34,7 +34,6 @@ namespace Dumux { -//At the moment this property is defined in the individual models -> should be changed namespace Properties { NEW_PROP_TAG(VtkAddVelocity); //!< Returns whether velocity vectors are written into the vtk output @@ -52,6 +51,7 @@ class ImplicitVelocityOutput using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVElementGeometry); using SubControlVolumeFace = typename GET_PROP_TYPE(TypeTag, SubControlVolumeFace); using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, ElementVolumeVariables); + using ElementSolutionVector = typename GET_PROP_TYPE(TypeTag, ElementSolutionVector); using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); using FluxVariables = typename GET_PROP_TYPE(TypeTag, FluxVariables); using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); @@ -246,6 +246,9 @@ public: FluxVariables fluxVars; fluxVars.initAndComputeFluxes(problem_, element, fvGeometry, elemVolVars, scvf, elemFluxVarsCache); scvfFluxes[scvfIndexInInside[localScvfIdx]] = fluxVars.advectiveFlux(phaseIdx, upwindTerm); + scvfFluxes[scvfIndexInInside[localScvfIdx]] /= problem_.extrusionFactor(element, + fvGeometry.scv(scvf.insideScvIdx()), + problem_.model().elementSolution(element, problem_.model().curSol())); } else { @@ -255,6 +258,9 @@ public: FluxVariables fluxVars; fluxVars.initAndComputeFluxes(problem_, element, fvGeometry, elemVolVars, scvf, elemFluxVarsCache); scvfFluxes[scvfIndexInInside[localScvfIdx]] = fluxVars.advectiveFlux(phaseIdx, upwindTerm); + scvfFluxes[scvfIndexInInside[localScvfIdx]] /= problem_.extrusionFactor(element, + fvGeometry.scv(scvf.insideScvIdx()), + problem_.model().elementSolution(element, problem_.model().curSol())); } } -- GitLab