Commit 296cb801 authored by Benjamin Faigle's avatar Benjamin Faigle
Browse files

Minor changes

-remove disabled acess functions in multiphysics cell data
-enable "EnableCapillarity" Property for Multiphyiscs in simple update function
-avoid wrong output:
	* set error correction to 0 if it is 0
	* upwind information in simple subdomain set for both phases
	* First episode has index 1 and not 0 => fix first timestep size in fvpressurecompositional

Fixed bug for Adaptive Multiphysics (in devel):
After grid modification, a once complex local cellData object might now point to a cell in simple subdomain. Hence both mobilities have to be overwritten by material law update, which was not done in simple update. This only has an effect when grid is adapted.
reviewed by Philipp

git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@9501 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent ba68a1fb
......@@ -266,16 +266,6 @@ public:
}
//@}
// FluxData& setFluxData()
// {
// return fluxData_;
// }
//
// const FluxData& fluxData() const
// {
// return fluxData_;
// }
//! Set a simple fluidstate for a cell in the simple domain
/** Uses a simplified fluidstate with less storage capacity
* and functionality.
......
......@@ -457,6 +457,8 @@ void FVPressure2P2CMultiPhysics<TypeTag>::get1pStorage(Dune::FieldVector<Scalar,
fac * (1 + x_mi - hifac*x_mi/(1-x_mi) + (hifac/(1-x_mi)-1)*erri/maxError)
* cellDataI.volumeError() * volume;
}
else
problem().variables().cellData(globalIdxI).errorCorrection()=0 ;
return;
}
......@@ -542,19 +544,22 @@ void FVPressure2P2CMultiPhysics<TypeTag>::get1pFlux(Dune::FieldVector<Scalar, 2>
if (potential > 0.)
{
lambda = cellDataI.mobility(phaseIdx);
cellDataJ.setUpwindCell(intersection.indexInOutside(), contiEqIdx, false); // store in cellJ since cellI is const
cellDataJ.setUpwindCell(intersection.indexInOutside(), contiWEqIdx, false); // store in cellJ since cellI is const
cellDataJ.setUpwindCell(intersection.indexInOutside(), contiNEqIdx, false); // store in cellJ since cellI is const
//density = cellDataI.density(phaseIdx);
}
else if (potential < 0.)
{
lambda = cellDataJ.mobility(phaseIdx);
cellDataJ.setUpwindCell(intersection.indexInOutside(), contiEqIdx, true);
cellDataJ.setUpwindCell(intersection.indexInOutside(), contiWEqIdx, true);
cellDataJ.setUpwindCell(intersection.indexInOutside(), contiNEqIdx, true);
//density = cellDataJ.density(phaseIdx);
}
else
{
lambda = harmonicMean(cellDataI.mobility(phaseIdx) , cellDataJ.mobility(phaseIdx));
cellDataJ.setUpwindCell(intersection.indexInOutside(), contiEqIdx, false);
cellDataJ.setUpwindCell(intersection.indexInOutside(), contiWEqIdx, false);
cellDataJ.setUpwindCell(intersection.indexInOutside(), contiNEqIdx, false);
//density = cellDataJ.density(phaseIdx);
}
......@@ -876,7 +881,9 @@ void FVPressure2P2CMultiPhysics<TypeTag>::update1pMaterialLawsInElement(const El
// both phase pressures are necessary for the case 1p domain is assigned for
// the next 2p subdomain
PhaseVector pressure(0.);
Scalar pc = MaterialLaw::pC(problem().spatialParams().materialLawParams(elementI),
Scalar pc = 0;
if(GET_PROP_VALUE(TypeTag, EnableCapillarity))
pc = MaterialLaw::pC(problem().spatialParams().materialLawParams(elementI),
((presentPhaseIdx == wPhaseIdx) ? 1. : 0.)); // assign Sw = 1 if wPhase present, else 0
if(pressureType == wPhaseIdx)
{
......@@ -900,20 +907,26 @@ void FVPressure2P2CMultiPhysics<TypeTag>::update1pMaterialLawsInElement(const El
// write stuff in fluidstate
assert(presentPhaseIdx == pseudoFluidState.presentPhaseIdx());
cellData.setSimpleFluidState(pseudoFluidState);
// cellData.setSimpleFluidState(pseudoFluidState);
// initialize viscosities
cellData.setViscosity(presentPhaseIdx, FluidSystem::viscosity(pseudoFluidState, presentPhaseIdx));
// initialize mobilities
if(presentPhaseIdx == wPhaseIdx)
{
cellData.setMobility(wPhaseIdx,
MaterialLaw::krw(problem().spatialParams().materialLawParams(elementI), pseudoFluidState.saturation(wPhaseIdx))
/ cellData.viscosity(wPhaseIdx));
cellData.setMobility(nPhaseIdx, 0.);
}
else
{
cellData.setMobility(nPhaseIdx,
MaterialLaw::krn(problem().spatialParams().materialLawParams(elementI), pseudoFluidState.saturation(wPhaseIdx))
/ cellData.viscosity(nPhaseIdx));
cellData.setMobility(wPhaseIdx, 0.);
}
// error term handling
Scalar vol(0.);
......
......@@ -137,7 +137,7 @@ public:
// if we just started a new episode, the TS size of the update Estimate is a better
// estimate then the size of the last time step
if(problem_.timeManager().time() == problem_.timeManager().episodeStartTime()
&& problem_.timeManager().episodeIndex() > 0)
&& problem_.timeManager().episodeIndex() > 1)
problem_.timeManager().setTimeStepSize(dt_estimate*GET_PARAM_FROM_GROUP(TypeTag, Scalar, Impet, CFLFactor));
updateEstimate_ *= problem_.timeManager().timeStepSize();
......
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