Commit c9ed8202 authored by Thomas Fetzer's avatar Thomas Fetzer
Browse files

[multidomain,freeflow] added and updated documentation


git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@12659 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent 59577766
......@@ -72,7 +72,7 @@ class StokesncVolumeVariables : public StokesVolumeVariables<TypeTag>
public:
/*!
* \copydoc BoxVolumeVariables::update()
* \copydoc ImplicitVolumeVariables::update()
*/
void update(const PrimaryVariables &priVars,
const Problem &problem,
......@@ -198,6 +198,8 @@ public:
/*!
* \brief Returns the binary (mass) diffusion coefficient
*
* \param compIdx The component index
*/
Scalar diffusionCoeff(int compIdx) const
{ return diffCoeff_[compIdx]; }
......
......@@ -404,7 +404,7 @@ class TwoCStokesTwoPTwoCLocalOperator :
const Scalar massTransferCoeff = massTransferCoefficient(cParams, sdElement1, sdElement2, globalPos1,
vertInElem1, vertInElem2);
if (massTransferCoeff > 1.0 || massTransferCoeff < 0.0)
std::cout << "MTC out of bounds! >>> " << massTransferCoeff << std::endl;
std::cout << "MTC out of bounds, should be in between 0.0 and 1.0! >>> " << massTransferCoeff << std::endl;
if (globalProblem_.sdProblem1().isCornerPoint(globalPos1))
......
......@@ -104,7 +104,7 @@ public:
~MultiDomainAssembler()
{ }
//! \copydoc Dumux::ImplicitModel::init()
//! \copydoc ImplicitAssembler::init()
void init(Problem& problem)
{
globalProblem_ = &problem;
......@@ -168,7 +168,7 @@ public:
residual_.resize(matrix_->N());
}
//! \copydoc Dumux::ImplicitModel::assemble()
//! \copydoc ImplicitAssembler::assemble()
void assemble()
{
// std::cerr << __FILE__ << ":" << __LINE__ << "\n";
......@@ -186,11 +186,11 @@ public:
// printvector(std::cout, residual_, "residual", "row", 200, 1, 3);
}
//! \copydoc Dumux::ImplicitModel::reassembleAll()
//! \copydoc ImplicitAssembler::reassembleAll()
void reassembleAll()
{ }
//! \copydoc Dumux::ImplicitModel::matrix()
//! \copydoc ImplicitAssembler::matrix()
const JacobianMatrix &matrix() const
{ return *matrix_; }
......@@ -203,7 +203,7 @@ public:
JacobianMatrix &matrix()
{ return *matrix_; }
//! \copydoc Dumux::ImplicitModel::residual()
//! \copydoc ImplicitAssembler::residual()
const SolutionVector &residual() const
{ return residual_; }
SolutionVector &residual()
......
......@@ -321,7 +321,11 @@ public:
SplitAndMerge::mergeSolVectors(sdModel1().curSol(), sdModel2().curSol(), uCur_);
};
//! \copydoc Dumux::ImplicitModel::updateFailedTry()
/*!
* \brief Called by the update() method if a try was
* unsuccessful. This is primary a hook which the
* actual model can overload.
*/
void updateFailedTry()
{
sdModel1().updateFailedTry();
......
......@@ -165,10 +165,15 @@ public:
*/
// \{
//! \copydoc Dumux::ImplicitProblem::simulate()
/*!
* \brief Set the initial time step and the time where the simulation ends
* and starts simulation
*
* \param dtInitial Initial time step
* \param tEnd Time, when simulation ends
*/
bool simulate(Scalar dtInitial, Scalar tEnd)
{
// set the initial time step and the time where the simulation ends
timeManager_.setEndTime(tEnd);
timeManager_.setTimeStepSize(dtInitial);
timeManager_.runSimulation(asImp_());
......
......@@ -83,7 +83,7 @@ SET_BOOL_PROP(Stokes2cTestProblem, ProblemEnableGravity, false);
* of the momentum balance equations in case of Dirichlet bcs for the momentum balance.
* In the middle of the lower boundary one vertex receives Dirichlet bcs, to set the pressure level.
*
* This problem uses the \ref BoxStokesncModel.
* This problem uses the \ref StokesncModel.
* To run the simulation execute the following line in a shell:
* <tt>./test_stokes2c -parameterFile ./test_stokes2c.input</tt>
*/
......
......@@ -86,7 +86,7 @@ SET_BOOL_PROP(Stokes2cniTestProblem, ProblemEnableGravity, true);
* On the upper boundary a Dirichlet condition is set for the mass balance to fix the pressure.
* Gravity is on in this example.
*
* This problem uses the \ref BoxStokesncniModel.
* This problem uses the \ref StokesncniModel.
* To run the simulation execute the following line in shell:
* <tt>./test_stokes2cni -parameterFile ./test_stokes2cni.input</tt>
*/
......
......@@ -16,11 +16,21 @@
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*****************************************************************************/
/**
* @file
* \ingroup docme
* @brief docme
/*!
* \file
* \ingroup StokesniProblems
* \ingroup 2p2cniProblems
* \brief The problem class for the coupling of a non-isothermal two-component Stokes
* and a non-isothermal two-phase two-component Darcy model.
*
* The problem class for the coupling of a non-isothermal two-component Stokes (stokes2cn)
* and a non-isothermal two-phase two-component Darcy model (2p2cni).
* It uses the 2p2cniCoupling model and the Stokes2cnicoupling model and provides
* the problem specifications for common parameters of the two submodels.
* The initial and boundary conditions of the submodels are specified in the two subproblems,
* 2p2cnisubproblem.hh and stokes2cnisubproblem.hh, which are accessible via the coupled problem.
*/
#ifndef DUMUX_2CNISTOKES2P2CNIPROBLEM_HH
#define DUMUX_2CNISTOKES2P2CNIPROBLEM_HH
......@@ -133,15 +143,17 @@ SET_BOOL_PROP(TwoCNIStokesTwoPTwoCNIProblem, NewtonWriteConvergence, false);
}
/*!
* \brief The problem class for the coupling of a non-isothermal two-component Stokes (stokes2cni)
* and a non-isothermal two-phase two-component Darcy model (2p2cni).
* \ingroup StokesniProblems
* \ingroup 2p2cniProblems
* \brief The problem class for the coupling of a non-isothermal two-component Stokes
* and a non-isothermal two-phase two-component Darcy model.
*
* The problem class for the coupling of a non-isothermal two-component Stokes (stokes2cni)
* and a non-isothermal two-phase two-component Darcy model (2p2cni).
* It uses the 2p2cniCoupling model and the Stokes2cnicoupling model and provides
* the problem specifications for common parameters of the two submodels.
* The initial and boundary conditions of the submodels are specified in the two subproblems,
* 2p2cnisubproblem.hh and stokes2cnisubproblem.hh, which are accessible via the coupled problem.
* The problem class for the coupling of a non-isothermal two-component Stokes (stokes2cn)
* and a non-isothermal two-phase two-component Darcy model (2p2cni).
* It uses the 2p2cniCoupling model and the Stokes2cnicoupling model and provides
* the problem specifications for common parameters of the two submodels.
* The initial and boundary conditions of the submodels are specified in the two subproblems,
* 2p2cnisubproblem.hh and stokes2cnisubproblem.hh, which are accessible via the coupled problem.
*/
template <class TypeTag = TTAG(TwoCNIStokesTwoPTwoCNIProblem) >
class TwoCNIStokesTwoPTwoCNIProblem : public MultiDomainProblem<TypeTag>
......@@ -235,14 +247,13 @@ class TwoCNIStokesTwoPTwoCNIProblem : public MultiDomainProblem<TypeTag>
typedef typename MDGrid::template Codim<0>::LeafIterator ElementIterator;
typedef typename MDGrid::LeafSubDomainInterfaceIterator SDInterfaceIterator;
public:
/*!
* \brief docme
*
* \param hostGrid docme
* \param timeManager The TimeManager which is used by the simulation
* \brief The problem for the coupling of Stokes and Darcy flow
*
* \param mdGrid The multidomain grid
* \param timeManager The time manager
*/
public:
TwoCNIStokesTwoPTwoCNIProblem(MDGrid &mdGrid,
TimeManager &timeManager)
: ParentType(mdGrid, timeManager)
......@@ -286,12 +297,21 @@ public:
this->timeManager().startNextEpisode(episodeLength_);
}
/*!
* \brief The destructor
*/
~TwoCNIStokesTwoPTwoCNIProblem()
{
fluxFile_.close();
};
//! \copydoc Dumux::CoupledProblem::init()
/*!
* \brief Called by the Dumux::TimeManager in order to
* initialize the problem.
*
* If you overload this method don't forget to call
* ParentType::init()
*/
void init()
{
ParentType::init();
......@@ -312,7 +332,10 @@ public:
}
/*!
* \brief docme
* \brief Initialization of the grids
*
* This function splits the multidomain grid in the two
* individual subdomain grids and takes care of parallelization.
*/
void initializeGrid()
{
......@@ -345,7 +368,10 @@ public:
gridinfo(this->sdGrid2());
}
//! \copydoc Dumux::CoupledProblem::postTimeStep()
/*!
* \brief Called by the time manager after the time integration to
* do some post processing on the solution.
*/
void postTimeStep()
{
// call the postTimeStep function of the subproblems
......@@ -361,7 +387,11 @@ public:
}
}
//! \copydoc Dumux::CoupledProblem::episodeEnd()
/*!
* \brief Called when the end of an simulation episode is reached.
*
* Typically a new episode should be started in this method.
*/
void episodeEnd()
{
this->timeManager().startNextEpisode(episodeLength_);
......@@ -372,9 +402,12 @@ public:
}
}
/*
* \brief Calculates fluxes and coupling terms at the interface for the Stokes model.
* Flux output files are created and the summarized flux is written to a file.
/*!
* \brief Calculates fluxes and coupling terms at the interface
* for the Stokes model.
*
* Flux output files are created and the summarized flux is
* written to a file.
*/
void calculateFirstInterfaceFluxes()
{
......@@ -506,9 +539,12 @@ public:
<< sumEnergyFluxes << "; ";
}
/*
* \brief Calculates fluxes and coupling terms at the interface for the Darcy model.
* Flux output files are created and the summarized flux is written to a file.
/*!
* \brief Calculates fluxes and coupling terms at the interface
* for the Darcy model.
*
* Flux output files are created and the summarized flux is written
* to a file.
*/
void calculateSecondInterfaceFluxes()
{
......@@ -634,6 +670,15 @@ public:
}
}
/*!
* \brief Returns the advective vapor fluxes
*
* The phaseIdx and transportCompIdx1 are predefined
*
* \param elemVolVars1 All volume variables for the element
* \param boundaryVars1 Flux variables (\todo violates naming convention)
* \param vertInElem1 Vertex index for the inside element
*/
Scalar computeAdvectiveVaporFluxes1(const ElementVolumeVariables1& elemVolVars1,
const BoundaryVariables1& boundaryVars1,
int vertInElem1)
......@@ -644,6 +689,15 @@ public:
return advFlux;
}
/*!
* \brief Returns the diffusive vapor fluxes
*
* The transportCompIdx1 is predefined
*
* \param elemVolVars1 All volume variables for the element
* \param boundaryVars1 Flux variables (\todo violates naming convention)
* \param vertInElem1 Vertex index for the inside elements
*/
Scalar computeDiffusiveVaporFluxes1(const ElementVolumeVariables1& elemVolVars1,
const BoundaryVariables1& boundaryVars1,
int vertInElem1)
......@@ -656,7 +710,14 @@ public:
return diffFlux;
}
//! \copydoc Dumux::CoupledProblem::shouldWriteRestartFile()
/*!
* \brief Returns true if a restart file should be written to
* disk.
*
* The default behavior is to write one restart file every 5 time
* steps. This file is intended to be overwritten by the
* implementation.
*/
bool shouldWriteRestartFile() const
{
if ((this->timeManager().timeStepIndex() > 0 &&
......@@ -668,7 +729,14 @@ public:
}
//! \copydoc Dumux::CoupledProblem::shouldWriteOutput()
/*!
* \brief Returns true if the current solution should be written to
* disk (i.e. as a VTK file)
*
* The default behavior is to write out the solution for
* every time step. This function is intended to be overwritten by the
* implementation.
*/
bool shouldWriteOutput() const
{
if (this->timeManager().timeStepIndex() % freqOutput_ == 0
......@@ -679,7 +747,8 @@ public:
/*!
* \brief Returns true if a file with the fluxes across the
* free-flow -- porous-medium interface should be written.
* free-flow -- porous-medium interface should be
* written to disk.
*/
bool shouldWriteFluxFile() const
{
......@@ -704,11 +773,17 @@ public:
}
/*!
* \brief Returns a pointer to the Stokes problem
*/
Stokes2cniSubProblem& stokes2cniProblem()
{ return this->sdProblem1(); }
const Stokes2cniSubProblem& stokes2cniProblem() const
{ return this->sdProblem1(); }
/*!
* \brief Returns a pointer to the Darcy problem
*/
TwoPTwoCNISubProblem& twoPtwoCNIProblem()
{ return this->sdProblem2(); }
const TwoPTwoCNISubProblem& twoPtwoCNIProblem() const
......@@ -755,4 +830,4 @@ private:
} //end namespace
#endif
#endif // DUMUX_2CNISTOKES2P2CNIPROBLEM_HH
......@@ -16,6 +16,14 @@
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*****************************************************************************/
/*!
* \file
*
* \brief Spatial parameters for the
* coupling of an non-isothermal two-component Stokes
* and an non-isothermal two-phase two-component Darcy model.
*/
#ifndef DUMUX_TWOCNISTOKES2P2CNISPATIALPARAMS_HH
#define DUMUX_TWOCNISTOKES2P2CNISPATIALPARAMS_HH
......@@ -59,7 +67,12 @@ public:
/*!
* \brief docme
* \ingroup TwoPTwoCNiModel
* \ingroup StokesniModel
* \ingroup ImplicitTestProblems
* \brief Definition of the spatial parameters for
* the coupling of an non-isothermal two-component Stokes
* and an non-isothermal two-phase two-component Darcy model.
*/
template<class TypeTag>
class TwoCNIStokesTwoPTwoCNISpatialParams : public ImplicitSpatialParams<TypeTag>
......@@ -96,10 +109,11 @@ public:
typedef std::vector<MaterialLawParams> MaterialLawParamsVector;
/*!
* \brief docme
*
* \param gridView The GridView which is used by the problem.
* \brief Spatial parameters for the
* coupling of an isothermal two-component Stokes
* and an isothermal two-phase two-component Darcy model.
*
* \param gridView The GridView which is used by the problem
*/
TwoCNIStokesTwoPTwoCNISpatialParams(const GridView& gridView)
: ParentType(gridView),
......@@ -156,17 +170,18 @@ public:
}
}
/*!
* \brief The destructor
*/
~TwoCNIStokesTwoPTwoCNISpatialParams()
{ }
/*!
* \brief Apply the intrinsic permeability tensor to a pressure
* potential gradient.
* \brief Returns the intrinsic permeability tensor \f$[m^2]\f$
*
* \param element The current finite element
* \param fvGeometry The current finite volume geometry of the element
* \param scvIdx The index sub-control volume face where the
* intrinsic velocity ought to be calculated.
* \param element The finite element
* \param fvGeometry The finite volume geometry of the element
* \param scvIdx The local index of the sub-control volume
*/
const Scalar intrinsicPermeability(const Element &element,
const FVElementGeometry &fvGeometry,
......@@ -186,7 +201,13 @@ public:
return mediumPermeability_;
}
//! \copydoc Dumux::ImplicitSpatialParamsOneP::porosity()
/*!
* \brief Returns the porosity \f$[-]\f$
*
* \param element The finite element
* \param fvGeometry The finite volume geometry of the element
* \param scvIdx The local index of the sub-control volume
*/
Scalar porosity(const Element &element,
const FVElementGeometry &fvGeometry,
const int scvIdx) const
......@@ -204,7 +225,13 @@ public:
}
//! \copydoc Dumux::ImplicitSpatialParams::materialLawParams()
/*!
* \brief Returns the parameter object for the material law
*
* \param element The finite element
* \param fvGeometry The finite volume geometry of the element
* \param scvIdx The local index of the sub-control volume
*/
const MaterialLawParams& materialLawParams(const Element &element,
const FVElementGeometry &fvGeometry,
const int scvIdx) const
......@@ -224,14 +251,15 @@ public:
/*!
* \brief Returns the heat capacity \f$[J/m^3 K]\f$ of the rock matrix.
* \brief Returns the effective heat capacity \f$[J/m^3 K]\f$
*
* This is only required for non-isothermal models.
* This is only required for non-isothermal models. This function does not
* return the specific heat capacity, but an effective heat capacity, which is
* \f$c_\textrm{p,eff,s} = c_\textrm{p,s} \varrho_\textrm{s} \left(1 - \phi\right)\f$
*
* \param element The finite element
* \param fvGeometry The finite volume geometry
* \param scvIdx The local index of the sub-control volume where
* the heat capacity needs to be defined
* \param fvGeometry The finite volume geometry of the element
* \param scvIdx The local index of the sub-control volume
*/
Scalar heatCapacity(const Element &element,
const FVElementGeometry &fvGeometry,
......@@ -245,12 +273,13 @@ public:
}
/*!
* \brief docme
* \brief Returns the thermal conductivity \f$[W/m^2]\f$ of the solid
*
* \param element The finite element
* \param fvGeometry The finite-volume geometry
* \param scvIdx The local subcontrolvolume index
* This is only required for non-isothermal models.
*
* \param element The finite element
* \param fvGeometry The finite volume geometry of the element
* \param scvIdx The local index of the sub-control volume
*/
Scalar thermalConductivitySolid(const Element &element,
const FVElementGeometry &fvGeometry,
......@@ -269,26 +298,27 @@ public:
}
/*!
* \brief docme
* \brief Returns the index of the used soil type
*
* \param pos The position of the boundary face's integration point in global coordinates
* The soil, can be chosen as runtime parameter:
* 1: coarse,
* 2: medium,
* 3: fine,
* 4: LeverettJ (x < xMaterialInterface)
*
* \param pos The global position
*/
const unsigned checkSoilType(const GlobalPosition &pos) const
{
// one soil, which can be chosen as runtime parameter:
// 1: coarse
// 2: medium
// 3: fine
// 4: LeverettJ (x < xMaterialInterface)
return soilType_;
}
// this is called from the coupled problem
// and creates a gnuplot output of the Pc-Sw curve
/*!
* \brief docme
* \brief This is called from the coupled problem and creates
* a gnuplot output of the Pc-Sw curve
*
* If this function should be used, uncomment the lines between
* the curly brackets.
*/
void plotMaterialLaw()
{
......@@ -367,5 +397,5 @@ private:
};
} // end namespace
#endif
#endif // DUMUX_TWOCNISTOKES2P2CNISPATIALPARAMS_HH
......@@ -18,8 +18,9 @@
*****************************************************************************/
/*!
* \file
*
* \brief Porous-medium subproblem with coupling at the top boundary.
* \ingroup 2p2cniProblems
* \brief Non-isothermal two-phase two-component porous-medium subproblem
* with coupling at the top boundary.
*/
#ifndef DUMUX_2P2CNISUB_PROBLEM_HH
#define DUMUX_2P2CNISUB_PROBLEM_HH
......@@ -122,7 +123,18 @@ SET_BOOL_PROP(TwoPTwoCNISubProblem, VtkAddVelocity, true);
SET_BOOL_PROP(TwoPTwoCNISubProblem, ProblemEnableGravity, true);
}
/*!
* \ingroup 2p2cniProblems
* \brief Non-isothermal two-phase two-component porous-medium subproblem
* with coupling at the top boundary.
*
* The Darcy subdomain is sized 0.25m times 0.25m. All BCs for the balance
* equations are set to Neumann no-flow, except for the top, where couplingInflow
* conditions are applied.
*
* This sub problem uses the \ref TwoPTwoCNIModel. It is part of the 2p2cni model and
* is combined with the stokes2cnisubproblem for the free flow domain.
*/
template <class TypeTag = TTAG(TwoPTwoCNISubProblem) >
class TwoPTwoCNISubProblem : public ImplicitPorousMediaProblem<TypeTag>
{
......@@ -192,11 +204,10 @@ class TwoPTwoCNISubProblem : public ImplicitPorousMediaProblem<TypeTag>
typedef Dune::FieldVector<Scalar, dimWorld> GlobalPosition;
/*!
* \brief docme
* \brief The sub-problem for the porous-medium subdomain
*
* \param timeManager The TimeManager which is used by the simulation
* \param gridView The simulation's idea about physical space
*
*/
public:
TwoPTwoCNISubProblem(TimeManager &timeManager, const GridView &gridView)
......@@ -252,11 +263,21 @@ public:
*/
// \{
//! \copydoc Dumux::ImplicitProblem::name()
/*!
* \brief Returns the problem name
*
* This is used as a prefix for files generated by the simulation.
*/
const std::string &name() const
{ return GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, std::string, Vtk, NamePM); }
//! \copydoc Dumux::ImplicitProblem::init()
/*!