Commit b12a2d0e authored by Gabi Seitz's avatar Gabi Seitz Committed by Dennis Gläser

[material] add calculation of effective solid properties

parent d87a7704
......@@ -3,6 +3,7 @@ add_subdirectory("2p")
add_subdirectory("2pia")
add_subdirectory("3p")
add_subdirectory("mp")
add_subdirectory("mineralization")
#install headers
install(FILES
......
#install headers
install(FILES
effectivesoliddensity.hh
effectivesolidheatcapacity.hh
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/material/fluidmatrixinteractions/mineralization)
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*****************************************************************************
* See the file COPYING for full copying permissions. *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* 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 Class for the evaluation of the porosity subject to precipitation.
*/
#ifndef DUMUX_EFFECTIVE_SOLID_DENSITY_HH
#define DUMUX_EFFECTIVE_SOLID_DENSITY_HH
#include <dumux/discretization/evalsolution.hh>
namespace Dumux
{
/*!
* \ingroup Fluidmatrixinteractions
*/
/**
* \brief Calculates the effective solid density
*/
template<class TypeTag>
class EffectiveSolidDensity
{
using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
using ElementSolution = typename GET_PROP_TYPE(TypeTag, ElementSolutionVector);
using SubControlVolume = typename GET_PROP_TYPE(TypeTag, SubControlVolume);
static const int dim = GridView::dimension;
static const int dimWorld = GridView::dimensionworld;
static const int numComponents = GET_PROP_VALUE(TypeTag, NumComponents);
static const int numSolidPhases = GET_PROP_VALUE(TypeTag, NumSPhases);
using Element = typename GridView::template Codim<0>:: Entity;
public:
void init(const SpatialParams& spatialParams)
{
spatialParamsPtr_ = &spatialParams;
}
// calculates the effective solid density of multiple solid phases according to
// their volume fractions
Scalar effectiveSolidDensity(const Element& element,
const SubControlVolume& scv,
const ElementSolution& elemSol) const
{
auto priVars = evalSolution(element, element.geometry(), elemSol, scv.center());
Scalar sumPrecipitates = 0.0;
Scalar effRhoS = 0.0;
for (unsigned int solidPhaseIdx = 0; solidPhaseIdx < numSolidPhases; ++solidPhaseIdx)
{
sumPrecipitates += priVars[numComponents + solidPhaseIdx];
effRhoS += priVars[numComponents + solidPhaseIdx]*spatialParams_().solidPhaseDensity(element, scv, elemSol, solidPhaseIdx);
}
return effRhoS/sumPrecipitates;
}
private:
const SpatialParams& spatialParams_() const
{ return *spatialParamsPtr_; }
const SpatialParams* spatialParamsPtr_;
};
} // namespace Dumux
#endif
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*****************************************************************************
* See the file COPYING for full copying permissions. *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* 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 Class for the evaluation of the porosity subject to precipitation.
*/
#ifndef DUMUX_EFFECTIVE_SOLID_HEATCAPACITY_HH
#define DUMUX_EFFECTIVE_SOLID_HEATCAPACITY_HH
#include <dumux/discretization/evalsolution.hh>
namespace Dumux
{
/*!
* \ingroup Fluidmatrixinteractions
*/
/**
* \brief Calculates the effective solid heat capacity
*/
template<class TypeTag>
class EffectiveSolidHeatCapacity
{
using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
using ElementSolution = typename GET_PROP_TYPE(TypeTag, ElementSolutionVector);
using SubControlVolume = typename GET_PROP_TYPE(TypeTag, SubControlVolume);
static const int dim = GridView::dimension;
static const int dimWorld = GridView::dimensionworld;
static const int numComponents = GET_PROP_VALUE(TypeTag, NumComponents);
static const int numSolidPhases = GET_PROP_VALUE(TypeTag, NumSPhases);
using Element = typename GridView::template Codim<0>:: Entity;
public:
void init(const SpatialParams& spatialParams)
{
spatialParamsPtr_ = &spatialParams;
}
// calculates the effective solid heat capacity of multiple solid phases accordin to
// their volume fractions
Scalar effectiveSolidHeatCapacity(const Element& element,
const SubControlVolume& scv,
const ElementSolution& elemSol) const
{
auto priVars = evalSolution(element, element.geometry(), elemSol, scv.center());
Scalar sumPrecipitates = 0.0;
Scalar effCp = 0.0;
for (unsigned int solidPhaseIdx = 0; solidPhaseIdx < numSolidPhases; ++solidPhaseIdx)
{
sumPrecipitates += priVars[numComponents + solidPhaseIdx];
effCp += priVars[numComponents + solidPhaseIdx]*spatialParams_().solidPhaseHeatCapacity(element, scv, elemSol, solidPhaseIdx);
}
return effCp/sumPrecipitates;
}
private:
const SpatialParams& spatialParams_() const
{ return *spatialParamsPtr_; }
const SpatialParams* spatialParamsPtr_;
};
} // namespace Dumux
#endif
......@@ -24,7 +24,7 @@
#ifndef DUMUX_POROSITY_REACTIVE_BED_HH
#define DUMUX_POROSITY_REACTIVE_BED_HH
#include <dumux/discretization/scvoperator.hh>
#include <dumux/discretization/evalsolution.hh>
namespace Dumux
{
......@@ -42,7 +42,6 @@ class PorosityReactiveBed
using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams);
using ElementSolution = typename GET_PROP_TYPE(TypeTag, ElementSolutionVector);
using SubControlVolume = typename GET_PROP_TYPE(TypeTag, SubControlVolume);
using ScvOperator = SubControlVolumeOperator<TypeTag>;
static const int dim = GridView::dimension;
static const int dimWorld = GridView::dimensionworld;
......@@ -68,7 +67,7 @@ public:
const SubControlVolume& scv,
const ElementSolution& elemSol) const
{
auto priVars = ScvOperator::evaluateSolution(element, scv, elemSol);
auto priVars = evalSolution(element, element.geometry(), elemSol, scv.center());
Scalar sumPrecipitates = 0.0;
for (unsigned int solidPhaseIdx = 0; solidPhaseIdx < numSolidPhases; ++solidPhaseIdx)
......
Markdown is supported
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