ModularFluidState.hpp
Go to the documentation of this file.
1 // -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 // vi: set et ts=4 sw=4 sts=4:
3 /*
4  Copyright (C) 2011-2013 by Andreas Lauser
5 
6  This file is part of the Open Porous Media project (OPM).
7 
8  OPM is free software: you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation, either version 2 of the License, or
11  (at your option) any later version.
12 
13  OPM is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with OPM. If not, see <http://www.gnu.org/licenses/>.
20 */
25 #ifndef OPM_MODULAR_FLUID_STATE_HPP
26 #define OPM_MODULAR_FLUID_STATE_HPP
27 
36 
38 #include <algorithm>
39 
40 namespace Opm {
41 
50 template <class ScalarT,
51  int numPhasesV,
52  int numComponentsV,
53  class PressureModule,
54  class TemperatureModule,
55  class CompositionModule,
56  class FugacityModule,
57  class SaturationModule,
58  class DensityModule,
59  class ViscosityModule,
60  class EnthalpyModule>
62  : public PressureModule
63  , public TemperatureModule
64  , public CompositionModule
65  , public FugacityModule
66  , public SaturationModule
67  , public DensityModule
68  , public ViscosityModule
69  , public EnthalpyModule
70 {
71 public:
72  typedef ScalarT Scalar;
73  enum { numPhases = numPhasesV };
74  enum { numComponents = numComponentsV };
75 
84  void checkDefined() const
85  {
86  PressureModule::checkDefined();
87  TemperatureModule::checkDefined();
88  CompositionModule::checkDefined();
89  SaturationModule::checkDefined();
90  DensityModule::checkDefined();
91  ViscosityModule::checkDefined();
92  EnthalpyModule::checkDefined();
93  }
94 
99  template <class FluidState>
100  void assign(const FluidState& fs)
101  {
102  PressureModule::assign(fs);
103  TemperatureModule::assign(fs);
104  CompositionModule::assign(fs);
105  SaturationModule::assign(fs);
106  DensityModule::assign(fs);
107  ViscosityModule::assign(fs);
108  EnthalpyModule::assign(fs);
109  }
110 };
111 
112 } // namespace Opm
113 
114 #endif
Modules for the ModularFluidState which represent fugacity/chemical potential.
Modules for the ModularFluidState which represent saturation.
Definition: Air_Mesitylene.hpp:31
Modules for the ModularFluidState which represent viscosity.
ScalarT Scalar
Definition: ModularFluidState.hpp:72
Modules for the ModularFluidState which represent composition.
Some templates to wrap the valgrind client request macros.
Definition: ModularFluidState.hpp:74
Modules for the ModularFluidState which represent enthalpy.
Represents all relevant thermodynamic quantities of a multi-phase, multi-component fluid system assum...
Definition: ModularFluidState.hpp:61
Modules for the ModularFluidState which represent density.
void checkDefined() const
Make sure that all attributes are defined.
Definition: ModularFluidState.hpp:84
void assign(const FluidState &fs)
Retrieve all parameters from an arbitrary fluid state.
Definition: ModularFluidState.hpp:100
Definition: ModularFluidState.hpp:73
Modules for the ModularFluidState which represent temperature.
Modules for the ModularFluidState which represent pressure.