Commit c784ce62 authored by Timo Koch's avatar Timo Koch
Browse files

Adapt box and mpfa ficks law to using maincomponent

parent 29a12d4d
......@@ -52,6 +52,7 @@ class FicksLawImplementation<TypeTag, DiscretizationMethods::Box>
{
using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
using Model = typename GET_PROP_TYPE(TypeTag, Model);
using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
using SubControlVolume = typename GET_PROP_TYPE(TypeTag, SubControlVolume);
......@@ -115,7 +116,7 @@ public:
for (int compIdx = 0; compIdx < numComponents; compIdx++)
{
if(compIdx == phaseIdx)
if(compIdx == FluidSystem::getMainComponent(phaseIdx))
continue;
// effective diffusion tensors
......@@ -145,7 +146,8 @@ public:
// apply the diffusion tensor and return the flux
auto DGradX = applyDiffusionTensor_(D, gradX);
componentFlux[compIdx] = -1.0*rho*(DGradX*scvf.unitOuterNormal())*scvf.area();
componentFlux[phaseIdx] -= componentFlux[compIdx];
if (Model::mainComponentIsBalanced(phaseIdx) && !FluidSystem::isTracerFluidSystem())
componentFlux[phaseIdx] -= componentFlux[compIdx];
}
return componentFlux;
}
......
......@@ -48,12 +48,14 @@ class FicksLawImplementation<TypeTag, DiscretizationMethods::CCMpfa>
using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
using Model = typename GET_PROP_TYPE(TypeTag, Model);
using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
using MpfaHelper = typename GET_PROP_TYPE(TypeTag, MpfaHelper);
using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
using SubControlVolume = typename GET_PROP_TYPE(TypeTag, SubControlVolume);
using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVElementGeometry);
using EffDiffModel = typename GET_PROP_TYPE(TypeTag, EffectiveDiffusivityModel);
using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
using SubControlVolumeFace = typename GET_PROP_TYPE(TypeTag, SubControlVolumeFace);
using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, ElementVolumeVariables);
using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, ElementFluxVariablesCache);
......@@ -174,7 +176,7 @@ public:
ComponentFluxVector componentFlux(0.0);
for (int compIdx = 0; compIdx < numComponents; compIdx++)
{
if(compIdx == phaseIdx)
if(compIdx == FluidSystem::getMainComponent(phaseIdx))
continue;
const auto& fluxVarsCache = elemFluxVarsCache[scvf];
......@@ -239,8 +241,8 @@ public:
// accumulate the phase component flux
for(int compIdx = 0; compIdx < numComponents; compIdx++)
if(compIdx != phaseIdx)
componentFlux[phaseIdx] -= componentFlux[compIdx];
if(compIdx != FluidSystem::getMainComponent(phaseIdx) && Model::mainComponentIsBalanced(phaseIdx) && !FluidSystem::isTracerFluidSystem())
componentFlux[FluidSystem::getMainComponent(phaseIdx)] -= componentFlux[compIdx];
return componentFlux;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment