Skip to content
Snippets Groups Projects
Commit a2905bfb authored by Kilian Weishaupt's avatar Kilian Weishaupt
Browse files

[md][stokesDarcy] Fix calculation of diffusive fluxes over interface

* always return molecular diffusive flux, as name suggests
parent caab5a52
No related branches found
No related tags found
1 merge request!1201[md][stokesDarcy] Fix calculation of diffusive fluxes over interface
...@@ -765,7 +765,16 @@ protected: ...@@ -765,7 +765,16 @@ protected:
// treat the diffusive fluxes // treat the diffusive fluxes
const auto& insideScv = insideFvGeometry.scv(scvf.insideScvIdx()); const auto& insideScv = insideFvGeometry.scv(scvf.insideScvIdx());
flux += diffusiveMolecularFlux_(domainI, domainJ, scvf, insideScv, outsideScv, insideVolVars, outsideVolVars, diffCoeffAvgType); auto diffusiveFlux = diffusiveMolecularFlux_(domainI, domainJ, scvf, insideScv, outsideScv, insideVolVars, outsideVolVars, diffCoeffAvgType);
if(!useMoles)
{
//convert everything to a mass flux
for(int compIdx = 0; compIdx < numComponents; ++compIdx)
diffusiveFlux[compIdx] *= FluidSystem<i>::molarMass(compIdx);
}
flux += diffusiveFlux;
// convert to total mass/mole balance, if set be user // convert to total mass/mole balance, if set be user
if(replaceCompEqIdx < numComponents) if(replaceCompEqIdx < numComponents)
...@@ -842,16 +851,7 @@ protected: ...@@ -842,16 +851,7 @@ protected:
const Scalar cumulativeFlux = std::accumulate(diffusiveFlux.begin(), diffusiveFlux.end(), 0.0); const Scalar cumulativeFlux = std::accumulate(diffusiveFlux.begin(), diffusiveFlux.end(), 0.0);
diffusiveFlux[couplingCompIdx(domainI, 0)] = -cumulativeFlux; diffusiveFlux[couplingCompIdx(domainI, 0)] = -cumulativeFlux;
if(!useMoles)
{
//convert everything to a mass flux
for(int compIdx = 0; compIdx < numComponents; ++compIdx)
diffusiveFlux[compIdx] *= FluidSystem<i>::molarMass(compIdx);
}
return diffusiveFlux; return diffusiveFlux;
// return NumEqVector(0);
} }
/*! /*!
...@@ -895,8 +895,7 @@ protected: ...@@ -895,8 +895,7 @@ protected:
: getComponentEnthalpy(outsideVolVars, couplingPhaseIdx(domainJ), domainJCompIdx); : getComponentEnthalpy(outsideVolVars, couplingPhaseIdx(domainJ), domainJCompIdx);
// always use a mass-based calculation for the energy balance // always use a mass-based calculation for the energy balance
if (useMoles) diffusiveFlux[domainICompIdx] *= FluidSystem<i>::molarMass(domainICompIdx);
diffusiveFlux[domainICompIdx] *= FluidSystem<i>::molarMass(domainICompIdx);
flux += diffusiveFlux[domainICompIdx] * componentEnthalpy; flux += diffusiveFlux[domainICompIdx] * componentEnthalpy;
} }
......
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