Skip to content
Snippets Groups Projects
Commit ef65eeb7 authored by Roman Winter's avatar Roman Winter
Browse files

update Code Snippets and their examples

parent fec50b31
No related branches found
No related tags found
1 merge request!157markdown text for materialsystem slides
Pipeline #30362 waiting for manual action
---
title: Material system
author: Tufan Ghosh
---
# Introduction to DuMuX- Material system
# Material system
## Challenges in simulating porous media:
* Highly heterogeneous distribution of parameters and complex nonlinear material laws
* Strong interconnection of properties **--->** difficult to achieve modularity
## Modular structure:
<ins> User-defined parameters and relationships: </ins>
......@@ -203,67 +199,58 @@ CompositionFromFugacities: takes all component fugacities, the temperature and p
<img src="img/component-fluidsystem.png" width="500"/>
## Example: 2 phases, immiscible
## Example: 2 phases, miscible
* Components: _H2O_, _Air_
* Fluid system: _TwoPImmiscible_
* Fluid system: _TwoPTwoC_
## Include headers in properties file: components
```cpp
// The numerical model
#include <dumux/porousmediumflow/2p/implicit/model.hh>
// The two-phase immiscible fluid system
#include <dumux/material/fluidsystems/h2oair.hh>
// The water component
#include <dumux/material/components/h2o.hh>
// The air component
#include <dumux/material/components/air.hh>
```
## Include headers in properties file: phases
```cpp
// The two-phase immiscible fluid system
#include <dumux/material/fluidsystems/2pimmiscible.hh>
// Liquid phase
#include <dumux/material/fluidsystems/1pliquid.hh>
// Gas phase
#include <dumux/material/fluidsystems/1pgas.hh>
// Solid phase
#include <dumux/material/solidsystems/1csolid.hh>
```
## Specify fluid system in properties file:
```cpp
// we use the immiscible fluid system here
SET_PROP(WaterAirProblem, FluidSystem)
template<class TypeTag>
struct FluidSystem<TypeTag, TTag::H2OAir>
{
private:
using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
using LiquidPhase = typename FluidSystems::LiquidPhase<Scalar,
H2O<Scalar> >;
using GasPhase = typename FluidSystems::GasPhase<Scalar,
Air<Scalar> >;
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
public:
using type = typename FluidSystems::TwoPImmiscible<Scalar,
LiquidPhase, GasPhase>;
using type = FluidSystems::H2OAir<Scalar,
Components::TabulatedComponent<Components::H2O<Scalar>>,
FluidSystems::H2OAirDefaultPolicy</*fastButSimplifiedRelations=*/true>,
true /*useKelvinEquation*/>;
};
```
# Example: From component to solid system
## Example: 2 phases, miscible
* Components: _CaO_, _CaO2H2_ (slaked lime)
* Solid system: _OnePNCMin_
## Specify solid system in properties file:
```cpp
// we use the inert solid system here
SET_PROP(WaterAirProblem, SolidSystem)
// The solid system
template<class TypeTag>
struct SolidSystem<TypeTag, TTag::ThermoChem>
{
private:
using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
using ComponentT = Components::Granite<Scalar>;
public:
using type = SolidSystems::InertSolidphase<Scalar, ComponentT>;
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using ComponentOne = Components::ModifiedCaO<Scalar>;
using ComponentTwo = Components::CaO2H2<Scalar>;
using type = SolidSystems::CompositionalSolidPhase<Scalar, ComponentOne, ComponentTwo>;
};
```
## Note to solid system
......
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