Commit 9364b4c7 authored by Benjamin Faigle's avatar Benjamin Faigle
Browse files

-use vtk output level instead of debug level to trigger output verbosity (and...

-use vtk output level instead of debug level to trigger output verbosity (and introduce function in base problem as is done for output in general, approved by Markus)
-purge adaptive properties from 2p2c, as adaptive 2p2c modules will use their own properties files.

git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@9108 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent e567d092
......@@ -86,10 +86,6 @@ NEW_PROP_TAG( FluidSystem ); //!< The fluid system
NEW_PROP_TAG( FluidState ); //!< The fluid state
NEW_PROP_TAG( ImpetEnableVolumeIntegral ); //!< Enables volume integral in the pressure equation (volume balance formulation)
NEW_PROP_TAG( EnableVolumeIntegral ); //!< DEPRECATED Enables volume integral in the pressure equation (volume balance formulation)
NEW_PROP_TAG( GridAdaptEnableMultiPointFluxApproximation); //!< HangingNode: Two-point flux approximation (false) or mpfa (true)
NEW_PROP_TAG( EnableMultiPointFluxApproximationOnAdaptiveGrids ); //Deprecated
NEW_PROP_TAG( EnableSecondHalfEdge ); //!< Uses second interaction volume for second half-edge in 2D
NEW_PROP_TAG( GridAdaptEnableSecondHalfEdge ); //!< Uses second interaction volume for second half-edge in 2D
}}
//DUMUX includes
......@@ -153,6 +149,7 @@ SET_PROP(DecoupledTwoPTwoC, TransportSolutionType)
SET_BOOL_PROP(DecoupledTwoPTwoC, EnableCompressibility, true); //!< Compositional models are very likely compressible
SET_BOOL_PROP(DecoupledTwoPTwoC, VisitFacesOnlyOnce, false); //!< Faces are regarded from both sides
SET_BOOL_PROP(DecoupledTwoPTwoC, EnableCapillarity, false); //!< Capillarity is enabled
SET_INT_PROP(DecoupledTwoPTwoC, VtkOutputLevel,2); //!< Default verbosity for VtkOutputLevel is 2 = pretty verbose
SET_INT_PROP(DecoupledTwoPTwoC, ImpetRestrictFluxInTransport, GET_PROP_VALUE(TypeTag, RestrictFluxInTransport)); //!< Restrict (no upwind) flux in transport step if direction reverses after pressure equation
SET_INT_PROP(DecoupledTwoPTwoC, RestrictFluxInTransport, 0); //!< DEPRECATED Restrict (no upwind) flux in transport step if direction reverses after pressure equation
......@@ -166,9 +163,6 @@ SET_TYPE_PROP(DecoupledTwoPTwoC, FluidState, TwoPTwoCFluidState<TypeTag>);
SET_TYPE_PROP(DecoupledTwoPTwoC, SpatialParameters, typename GET_PROP_TYPE(TypeTag, SpatialParams));//!< DEPRECATED SpatialParameters property
SET_BOOL_PROP(DecoupledTwoPTwoC, GridAdaptEnableMultiPointFluxApproximation,
GET_PROP_VALUE(TypeTag,EnableMultiPointFluxApproximationOnAdaptiveGrids)); //!< MPFA disabled on adaptive grids
SET_BOOL_PROP(DecoupledTwoPTwoC, EnableMultiPointFluxApproximationOnAdaptiveGrids, false); //!< DEPRECATED MPFA disabled on adaptive grids
SET_BOOL_PROP(DecoupledTwoPTwoC, ImpetEnableVolumeIntegral, GET_PROP_VALUE(TypeTag,EnableVolumeIntegral)); //!< Regard volume integral in pressure equation
SET_BOOL_PROP(DecoupledTwoPTwoC, EnableVolumeIntegral, true); //!< DEPRECATED Regard volume integral in pressure equation
......
......@@ -160,15 +160,18 @@ public:
{
FVPressureCompositional<TypeTag>::addOutputVtkFields(writer);
int size = problem().gridView().size(0);
// add multiphysics stuff
Dune::BlockVector<Dune::FieldVector<int,1> >* subdomainPtr = writer.template allocateManagedBuffer<int, 1> (size);
for (int i = 0; i < size; i++)
if(problem().vtkOutputLevel()>=1)
{
CellData& cellData = problem().variables().cellData(i);
(*subdomainPtr)[i] = cellData.subdomain();
int size = problem().gridView().size(0);
// add multiphysics stuff
Dune::BlockVector<Dune::FieldVector<int,1> >* subdomainPtr = writer.template allocateManagedBuffer<int, 1> (size);
for (int i = 0; i < size; i++)
{
CellData& cellData = problem().variables().cellData(i);
(*subdomainPtr)[i] = cellData.subdomain();
}
writer.attachCellData(*subdomainPtr, "subdomain");
}
writer.attachCellData(*subdomainPtr, "subdomain");
return;
}
......
......@@ -156,6 +156,8 @@ public:
int size = problem_.gridView().size(0);
ScalarSolutionType *pressureW = writer.allocateManagedBuffer(size);
ScalarSolutionType *pressureN = writer.allocateManagedBuffer(size);
ScalarSolutionType *totalConcentration1 = writer.allocateManagedBuffer (size);
ScalarSolutionType *totalConcentration2 = writer.allocateManagedBuffer (size);
ScalarSolutionType *pC = writer.allocateManagedBuffer(size);
ScalarSolutionType *saturationW = writer.allocateManagedBuffer(size);
ScalarSolutionType *densityWetting = writer.allocateManagedBuffer(size);
......@@ -167,105 +169,113 @@ public:
// numerical stuff
ScalarSolutionType *volErr = writer.allocateManagedBuffer (size);
#if DUNE_MINIMAL_DEBUG_LEVEL <= 3
// add debug stuff
ScalarSolutionType *errorCorrPtr = writer.allocateManagedBuffer (size);
ScalarSolutionType *dv_dpPtr = writer.allocateManagedBuffer (size);
ScalarSolutionType *dV_dC1Ptr = writer.allocateManagedBuffer (size);
ScalarSolutionType *dV_dC2Ptr = writer.allocateManagedBuffer (size);
ScalarSolutionType *updEstimate1 = writer.allocateManagedBuffer (size);
ScalarSolutionType *updEstimate2 = writer.allocateManagedBuffer (size);
#endif
for (int i = 0; i < size; i++)
{
// basic level 0 output
CellData& cellData = problem_.variables().cellData(i);
(*pressureW)[i] = cellData.pressure(wPhaseIdx);
(*pressureN)[i] = cellData.pressure(nPhaseIdx);
(*pC)[i] = cellData.capillaryPressure();
(*totalConcentration1)[i] = cellData.massConcentration(wCompIdx);
(*totalConcentration2)[i] = cellData.massConcentration(nCompIdx);
(*saturationW)[i] = cellData.saturation(wPhaseIdx);
(*densityWetting)[i] = cellData.density(wPhaseIdx);
(*densityNonwetting)[i] = cellData.density(nPhaseIdx);
(*mobilityW)[i] = cellData.mobility(wPhaseIdx);
(*mobilityNW)[i] = cellData.mobility(nPhaseIdx);
(*massfraction1W)[i] = cellData.massFraction(wPhaseIdx,wCompIdx);
(*massfraction1NW)[i] = cellData.massFraction(nPhaseIdx,wCompIdx);
(*volErr)[i] = cellData.volumeError();
#if DUNE_MINIMAL_DEBUG_LEVEL <= 3
(*errorCorrPtr)[i] = cellData.errorCorrection();
(*dv_dpPtr)[i] = cellData.dv_dp();
(*dV_dC1Ptr)[i] = cellData.dv(wCompIdx);
(*dV_dC2Ptr)[i] = cellData.dv(nCompIdx);
(*updEstimate1)[i] = updateEstimate_[0][i];
(*updEstimate2)[i] = updateEstimate_[1][i];
#endif
// output standard secondary variables
if(problem_.vtkOutputLevel()>=1)
{
(*pC)[i] = cellData.capillaryPressure();
(*densityWetting)[i] = cellData.density(wPhaseIdx);
(*densityNonwetting)[i] = cellData.density(nPhaseIdx);
(*mobilityW)[i] = cellData.mobility(wPhaseIdx);
(*mobilityNW)[i] = cellData.mobility(nPhaseIdx);
(*massfraction1W)[i] = cellData.massFraction(wPhaseIdx,wCompIdx);
(*massfraction1NW)[i] = cellData.massFraction(nPhaseIdx,wCompIdx);
(*volErr)[i] = cellData.volumeError();
}
}
writer.attachCellData(*pressureW, "wetting pressure");
writer.attachCellData(*pressureN, "nonwetting pressure");
writer.attachCellData(*pC, "capillary pressure");
writer.attachCellData(*saturationW, "wetting saturation");
writer.attachCellData(*densityWetting, "wetting density");
writer.attachCellData(*densityNonwetting, "nonwetting density");
writer.attachCellData(*mobilityW, "mobility w_phase");
writer.attachCellData(*mobilityNW, "mobility nw_phase");
std::ostringstream oss1, oss2;
oss1 << "mass fraction " << FluidSystem::componentName(0) << " in " << FluidSystem::phaseName(0) << "-phase";
writer.attachCellData(*massfraction1W, oss1.str());
oss2 << "mass fraction " << FluidSystem::componentName(0) << " in " << FluidSystem::phaseName(1) << "-phase";
writer.attachCellData(*massfraction1NW, oss2.str());
writer.attachCellData(*volErr, "volume Error");
#if DUNE_MINIMAL_DEBUG_LEVEL <= 3
writer.attachCellData(*errorCorrPtr, "Error Correction");
writer.attachCellData(*dv_dpPtr, "dv_dp");
writer.attachCellData(*dV_dC1Ptr, "dV_dC1");
writer.attachCellData(*dV_dC2Ptr, "dV_dC2");
writer.attachCellData(*updEstimate1, "updEstimate comp 1");
writer.attachCellData(*updEstimate2, "updEstimate comp 2");
#endif
#if DUNE_MINIMAL_DEBUG_LEVEL <= 2
ScalarSolutionType *pressurePV = writer.allocateManagedBuffer(size);
ScalarSolutionType *totalConcentration1 = writer.allocateManagedBuffer (size);
ScalarSolutionType *totalConcentration2 = writer.allocateManagedBuffer (size);
ScalarSolutionType *viscosityWetting = writer.allocateManagedBuffer(size);
ScalarSolutionType *viscosityNonwetting = writer.allocateManagedBuffer(size);
// ScalarSolutionType *nun = writer.allocateManagedBuffer(size);
// ScalarSolutionType *nuw = writer.allocateManagedBuffer(size);
ScalarSolutionType *faceUpwindW = writer.allocateManagedBuffer(size);
ScalarSolutionType *faceUpwindN = writer.allocateManagedBuffer(size);
for (int i = 0; i < size; i++)
writer.attachCellData(*totalConcentration1, "C^w from cellData");
writer.attachCellData(*totalConcentration2, "C^n from cellData");
if(problem_.vtkOutputLevel()>=1)
{
CellData& cellData = problem_.variables().cellData(i);
(*totalConcentration1)[i] = cellData.massConcentration(wCompIdx);
(*totalConcentration2)[i] = cellData.massConcentration(nCompIdx);
(*viscosityWetting)[i] = cellData.viscosity(wPhaseIdx);
(*viscosityNonwetting)[i] = cellData.viscosity(nPhaseIdx);
// (*nun)[i] = cellData.phaseMassFraction(nPhaseIdx);
// (*nuw)[i] = cellData.phaseMassFraction(wPhaseIdx);
(*faceUpwindW)[i] = 0;
(*faceUpwindN)[i] = 0;
// run thorugh all local face idx and collect upwind information
for(int faceIdx = 0; faceIdx<cellData.fluxData().size(); faceIdx++)
writer.attachCellData(*pC, "capillary pressure");
writer.attachCellData(*densityWetting, "wetting density");
writer.attachCellData(*densityNonwetting, "nonwetting density");
writer.attachCellData(*mobilityW, "mobility w_phase");
writer.attachCellData(*mobilityNW, "mobility nw_phase");
std::ostringstream oss1, oss2;
oss1 << "mass fraction " << FluidSystem::componentName(0) << " in " << FluidSystem::phaseName(0) << "-phase";
writer.attachCellData(*massfraction1W, oss1.str());
oss2 << "mass fraction " << FluidSystem::componentName(0) << " in " << FluidSystem::phaseName(1) << "-phase";
writer.attachCellData(*massfraction1NW, oss2.str());
writer.attachCellData(*volErr, "volume Error");
}
// verbose output with numerical details
if(problem_.vtkOutputLevel()>=2)
{
// add debug stuff
ScalarSolutionType *errorCorrPtr = writer.allocateManagedBuffer (size);
ScalarSolutionType *dv_dpPtr = writer.allocateManagedBuffer (size);
ScalarSolutionType *dV_dC1Ptr = writer.allocateManagedBuffer (size);
ScalarSolutionType *dV_dC2Ptr = writer.allocateManagedBuffer (size);
ScalarSolutionType *updEstimate1 = writer.allocateManagedBuffer (size);
ScalarSolutionType *updEstimate2 = writer.allocateManagedBuffer (size);
for (int i = 0; i < size; i++)
{
if(cellData.isUpwindCell(faceIdx, contiWEqIdx))
(*faceUpwindW)[i] += pow(10,static_cast<double>(1-faceIdx));
if(cellData.isUpwindCell(faceIdx, contiNEqIdx))
(*faceUpwindN)[i] += pow(10,static_cast<double>(1-faceIdx));
CellData& cellData = problem_.variables().cellData(i);
(*errorCorrPtr)[i] = cellData.errorCorrection();
(*dv_dpPtr)[i] = cellData.dv_dp();
(*dV_dC1Ptr)[i] = cellData.dv(wCompIdx);
(*dV_dC2Ptr)[i] = cellData.dv(nCompIdx);
(*updEstimate1)[i] = updateEstimate_[0][i];
(*updEstimate2)[i] = updateEstimate_[1][i];
}
writer.attachCellData(*errorCorrPtr, "Error Correction");
writer.attachCellData(*dv_dpPtr, "dv_dp");
writer.attachCellData(*dV_dC1Ptr, "dV_dC1");
writer.attachCellData(*dV_dC2Ptr, "dV_dC2");
writer.attachCellData(*updEstimate1, "updEstimate comp 1");
writer.attachCellData(*updEstimate2, "updEstimate comp 2");
}
// writer.attachCellData(*nun, "phase mass fraction n-phase");
// writer.attachCellData(*nuw, "phase mass fraction w-phase");
*pressurePV = this->pressure();
writer.attachCellData(*faceUpwindW, "isUpwind w-phase");
writer.attachCellData(*faceUpwindN, "isUpwind n-phase");
writer.attachCellData(*pressurePV, "pressure (Primary Variable");
writer.attachCellData(*totalConcentration1, "C^w from cellData");
writer.attachCellData(*totalConcentration2, "C^n from cellData");
writer.attachCellData(*viscosityWetting, "wetting viscosity");
writer.attachCellData(*viscosityNonwetting, "nonwetting viscosity");
#endif
// very verbose output
if(problem_.vtkOutputLevel()>=3)
{
ScalarSolutionType *pressurePV = writer.allocateManagedBuffer(size);
ScalarSolutionType *viscosityWetting = writer.allocateManagedBuffer(size);
ScalarSolutionType *viscosityNonwetting = writer.allocateManagedBuffer(size);
// ScalarSolutionType *nun = writer.allocateManagedBuffer(size);
// ScalarSolutionType *nuw = writer.allocateManagedBuffer(size);
ScalarSolutionType *faceUpwindW = writer.allocateManagedBuffer(size);
ScalarSolutionType *faceUpwindN = writer.allocateManagedBuffer(size);
for (int i = 0; i < size; i++)
{
CellData& cellData = problem_.variables().cellData(i);
(*viscosityWetting)[i] = cellData.viscosity(wPhaseIdx);
(*viscosityNonwetting)[i] = cellData.viscosity(nPhaseIdx);
// (*nun)[i] = cellData.phaseMassFraction(nPhaseIdx);
// (*nuw)[i] = cellData.phaseMassFraction(wPhaseIdx);
(*faceUpwindW)[i] = 0;
(*faceUpwindN)[i] = 0;
// run thorugh all local face idx and collect upwind information
for(int faceIdx = 0; faceIdx<cellData.fluxData().size(); faceIdx++)
{
if(cellData.isUpwindCell(faceIdx, contiWEqIdx))
(*faceUpwindW)[i] += pow(10,static_cast<double>(3-faceIdx));
if(cellData.isUpwindCell(faceIdx, contiNEqIdx))
(*faceUpwindN)[i] += pow(10,static_cast<double>(3-faceIdx));
}
}
// writer.attachCellData(*nun, "phase mass fraction n-phase");
// writer.attachCellData(*nuw, "phase mass fraction w-phase");
*pressurePV = this->pressure();
writer.attachCellData(*faceUpwindW, "isUpwind w-phase");
writer.attachCellData(*faceUpwindN, "isUpwind n-phase");
writer.attachCellData(*pressurePV, "pressure (Primary Variable");
writer.attachCellData(*viscosityWetting, "wetting viscosity");
writer.attachCellData(*viscosityNonwetting, "nonwetting viscosity");
}
return;
}
......@@ -289,8 +299,7 @@ public:
for (ElementIterator eIt = problem_.gridView().template begin<0> ();
eIt != problem_.gridView().template end<0>(); ++eIt)
{
// get position, index
GlobalPosition globalPos = eIt->geometry().center();
// get index
int globalIdx = problem_.variables().index(*eIt);
poro_[globalIdx] = problem_.spatialParams().porosity(*eIt);
perm_[globalIdx] = problem_.spatialParams().intrinsicPermeability(*eIt)[0][0];
......@@ -336,15 +345,16 @@ protected:
Scalar ErrorTermFactor_; //!< Handling of error term: relaxation factor
Scalar ErrorTermLowerBound_; //!< Handling of error term: lower bound for error dampening
Scalar ErrorTermUpperBound_; //!< Handling of error term: upper bound for error dampening
static constexpr int pressureType = GET_PROP_VALUE(TypeTag, PressureFormulation); //!< gives kind of pressure used (\f$ 0 = p_w \f$, \f$ 1 = p_n \f$, \f$ 2 = p_{global} \f$)
private:
// //! Returns the implementation of the problem (i.e. static polymorphism)
// Implementation &asImp_()
// { return *static_cast<Implementation *>(this);}
//
// //! \copydoc Dumux::IMPETProblem::asImp_()
// const Implementation &asImp_() const
// { return *static_cast<const Implementation *>(this);}
//! Returns the implementation of the problem (i.e. static polymorphism)
Implementation &asImp_()
{ return *static_cast<Implementation *>(this);}
//! \copydoc Dumux::IMPETProblem::asImp_()
const Implementation &asImp_() const
{ return *static_cast<const Implementation *>(this);}
};
......
......@@ -133,14 +133,17 @@ public:
template<class MultiWriter>
void addOutputVtkFields(MultiWriter &writer)
{
typedef typename GET_PROP(TypeTag, SolutionTypes)::ScalarSolution ScalarSolutionType;
int size = problem_.gridView().size(0);
ScalarSolutionType *totalC1PV = writer.allocateManagedBuffer(size);
ScalarSolutionType *totalC2PV = writer.allocateManagedBuffer(size);
*totalC1PV = this->totalConcentration_[wCompIdx];
*totalC2PV = this->totalConcentration_[nCompIdx];
writer.attachCellData(*totalC1PV, "total Concentration w-Comp");
writer.attachCellData(*totalC2PV, "total Concentration n-Comp");
if(problem().vtkOutputLevel()>=3)
{
typedef typename GET_PROP(TypeTag, SolutionTypes)::ScalarSolution ScalarSolutionType;
int size = problem_.gridView().size(0);
ScalarSolutionType *totalC1PV = writer.allocateManagedBuffer(size);
ScalarSolutionType *totalC2PV = writer.allocateManagedBuffer(size);
*totalC1PV = this->totalConcentration_[wCompIdx];
*totalC2PV = this->totalConcentration_[nCompIdx];
writer.attachCellData(*totalC1PV, "total Concentration w-Comp - vector");
writer.attachCellData(*totalC2PV, "total Concentration n-Comp - vector");
}
}
//! Function needed for restart option of the transport model: Write out
......
......@@ -104,7 +104,8 @@ public:
timeManager_(&timeManager),
variables_(gridView),
outputInterval_(1),
outputTimeInterval_(0.0)
outputTimeInterval_(0.0),
vtkOutputLevel_(-1)
{
// calculate the bounding box of the grid view
VertexIterator vIt = gridView.template begin<dim>();
......@@ -133,6 +134,7 @@ public:
gridAdapt_ = new GridAdaptModel(asImp_());
resultWriter_ = NULL;
vtkOutputLevel_ = GET_PARAM_FROM_GROUP(TypeTag, int, Vtk, OutputLevel);
}
//! destructor
......@@ -755,6 +757,15 @@ public:
void addOutputVtkFields()
{
}
/*!
* \brief Returns the vtk output verbosity level
*
* Level is set by property or input file.
*/
const int vtkOutputLevel() const
{
return vtkOutputLevel_;
}
//! Write the fields current solution into an VTK output file.
void writeOutput(bool verbose = true)
......@@ -820,6 +831,7 @@ private:
VtkMultiWriter *resultWriter_;
int outputInterval_;
Scalar outputTimeInterval_;
int vtkOutputLevel_;
GridAdaptModel* gridAdapt_;
};
}
......
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