Commit fa1a8a57 authored by Markus Wolff's avatar Markus Wolff
Browse files

some corrections in structure of decoupled onemodelproblems



git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@4158 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent 02c28ff6
......@@ -48,6 +48,9 @@ class TransportProblem2P : public OneModelProblem<TypeTag, Implementation>
typedef typename GET_PROP_TYPE(TypeTag, PTAG(FluidSystem)) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, PTAG(SpatialParameters)) SpatialParameters;
typedef typename GET_PROP(TypeTag, PTAG(SolutionTypes)) SolutionTypes;
typedef typename SolutionTypes::ScalarSolution Solution;
enum {
dim = Grid::dimension,
......@@ -100,6 +103,24 @@ public:
const SpatialParameters &spatialParameters() const
{ return spatialParameters_; }
void timeIntegration()
{
// allocate temporary vectors for the updates
Solution k1 = asImp_().variables().saturation();
dt_ = 1e100;
Scalar t = timeManager().time();
// obtain the first update and the time step size
model().update(t, dt_, k1);
//make sure t_old + dt is not larger than tend
dt_ = std::min(dt_*cFLFactor_, timeManager().episodeMaxTimeStepSize());
timeManager().setTimeStepSize(dt_);
// explicit Euler: Sat <- Sat + dt*N(Sat)
asImp_().variables().saturation() += (k1 *= dt_);
}
// \}
......@@ -108,6 +129,8 @@ private:
// fluids and material properties
SpatialParameters spatialParameters_;
static const Scalar cFLFactor_= GET_PROP_VALUE(TypeTag, PTAG(CFLFactor));
};
}
......
......@@ -33,11 +33,6 @@
namespace Dumux
{
namespace Properties
{
NEW_PROP_TAG(CFLFactor);
}
/*! \ingroup diffusion
* @brief base class that defines the parameters of loosely coupled diffusion and transport equations
*
......@@ -116,7 +111,6 @@ public:
// bboxMax_[i] = std::max(bboxMax_[i], vIt->geometry().corner(0)[i]);
// }
// }
cFLFactor_ = GET_PROP_VALUE(TypeTag, PTAG(CFLFactor));
model_ = new Model(asImp_()) ;
}
......@@ -145,36 +139,6 @@ public:
void preTimeStep()
{ };
/*!
* \brief Called by Dumux::TimeManager in order to do a time
* integration on the model.
*
* \note \a timeStepSize and \a nextStepSize are references and may
* be modified by the timeIntegration(). On exit of this
* function \a timeStepSize must contain the step size
* actually used by the time integration for the current
* steo, and \a nextStepSize must contain a suggestion for the
* next time step size.
*/
void timeIntegration()
{
// allocate temporary vectors for the updates
Solution k1 = asImp_().variables().saturation();
dt_ = 1e100;
Scalar t = timeManager().time();
// obtain the first update and the time step size
model().update(t, dt_, k1);
//make sure t_old + dt is not larger than tend
dt_ = std::min(dt_*cFLFactor_, timeManager().episodeMaxTimeStepSize());
timeManager().setTimeStepSize(dt_);
// explicit Euler: Sat <- Sat + dt*N(Sat)
asImp_().variables().saturation() += (k1 *= dt_);
}
/*!
* \brief Called by Dumux::TimeManager just before the time
* integration.
......@@ -413,8 +377,6 @@ private:
Scalar dt_;
Scalar cFLFactor_;
Model* model_;
VtkMultiWriter resultWriter_;
......
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