Skip to content
Snippets Groups Projects
Commit 3569ac4b authored by Markus Wolff's avatar Markus Wolff
Browse files

changed reset of CFL-Timestep-Estimator

   - reset is now done directly in the transport loop to
     avoid errors

   -Reviewed by Klaus



git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@9958 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent 23c305f3
No related branches found
No related tags found
No related merge requests found
...@@ -114,6 +114,10 @@ public: ...@@ -114,6 +114,10 @@ public:
return 0.0; return 0.0;
} }
//! reset function
void reset()
{}
/*! @brief Constructs a EvalCflFlux instance */ /*! @brief Constructs a EvalCflFlux instance */
EvalCflFlux () EvalCflFlux ()
{} {}
......
...@@ -111,6 +111,15 @@ public: ...@@ -111,6 +111,15 @@ public:
return (getCFLFluxFunction(element) * element.geometry().volume()); return (getCFLFluxFunction(element) * element.geometry().volume());
} }
//! resets the accumulated CFL-fluxes to zero
void reset()
{
fluxWettingOut_ = 0;
fluxNonwettingOut_ = 0;
fluxIn_ = 0;
fluxOut_ = 0;
}
/*! \brief Constructs an EvalCflFluxDefault object /*! \brief Constructs an EvalCflFluxDefault object
* *
* \param problem A problem type object * \param problem A problem type object
...@@ -209,19 +218,6 @@ private: ...@@ -209,19 +218,6 @@ private:
return fluxOut_; return fluxOut_;
} }
protected:
//! resets the accumulated CFL-fluxes to zero
void reset()
{
fluxWettingOut_ = 0;
fluxNonwettingOut_ = 0;
fluxIn_ = 0;
fluxOut_ = 0;
}
private:
Problem& problem_;//problem data Problem& problem_;//problem data
Scalar fluxWettingOut_; Scalar fluxWettingOut_;
Scalar fluxNonwettingOut_; Scalar fluxNonwettingOut_;
...@@ -273,8 +269,6 @@ typename EvalCflFluxDefault<TypeTag>::Scalar EvalCflFluxDefault<TypeTag>::getCFL ...@@ -273,8 +269,6 @@ typename EvalCflFluxDefault<TypeTag>::Scalar EvalCflFluxDefault<TypeTag>::getCFL
//determine timestep //determine timestep
Scalar cFLFluxFunction = std::min(cFLFluxIn, cFLFluxOut); Scalar cFLFluxFunction = std::min(cFLFluxIn, cFLFluxOut);
reset();
return cFLFluxFunction; return cFLFluxFunction;
} }
......
...@@ -244,6 +244,8 @@ void FVTransport<TypeTag>::update(const Scalar t, Scalar& dt, TransportSolutionT ...@@ -244,6 +244,8 @@ void FVTransport<TypeTag>::update(const Scalar t, Scalar& dt, TransportSolutionT
CellData& cellDataI = problem_.variables().cellData(globalIdxI); CellData& cellDataI = problem_.variables().cellData(globalIdxI);
Scalar update = 0; Scalar update = 0;
evalCflFluxFunction().reset();
// run through all intersections with neighbors and boundary // run through all intersections with neighbors and boundary
IntersectionIterator isItEnd = problem_.gridView().iend(*eIt); IntersectionIterator isItEnd = problem_.gridView().iend(*eIt);
for (IntersectionIterator isIt = problem_.gridView().ibegin(*eIt); isIt != isItEnd; ++isIt) for (IntersectionIterator isIt = problem_.gridView().ibegin(*eIt); isIt != isItEnd; ++isIt)
......
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