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

[box][fickslaw] Adapt to changes in indexes and consider density

parent 010f9a3c
No related branches found
No related tags found
2 merge requests!617[WIP] Next,!528Feature/diffusive fluxes as vectors
...@@ -120,18 +120,18 @@ public: ...@@ -120,18 +120,18 @@ public:
const auto& volVars = elemVolVars[scv]; const auto& volVars = elemVolVars[scv];
// density interpolation // density interpolation
rho += volVars.molarDensity(phaseIdx)*shapeValues[scv.index()][0]; rho += volVars.molarDensity(phaseIdx)*shapeValues[scv.indexInElement()][0];
// the mole/mass fraction gradient // the mole/mass fraction gradient
GlobalPosition gradI; GlobalPosition gradI;
jacInvT.mv(shapeJacobian[scv.index()][0], gradI); jacInvT.mv(shapeJacobian[scv.indexInElement()][0], gradI);
gradI *= volVars.moleFraction(phaseIdx, compIdx)*rho; gradI *= volVars.moleFraction(phaseIdx, compIdx)*rho;
gradX += gradI; gradX += gradI;
} }
// apply the diffusion tensor and return the flux // apply the diffusion tensor and return the flux
auto DGradX = applyDiffusionTensor_(D, gradX); auto DGradX = applyDiffusionTensor_(D, gradX);
componentFlux[compIdx] = -1.0*(DGradX*scvf.unitOuterNormal())*scvf.area(); componentFlux[compIdx] = -1.0*rho*(DGradX*scvf.unitOuterNormal())*scvf.area();
} }
return componentFlux; return componentFlux;
} }
......
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