My Project
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  This file is part of the Open Porous Media project (OPM).
5 
6  OPM is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 2 of the License, or
9  (at your option) any later version.
10 
11  OPM is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with OPM. If not, see <http://www.gnu.org/licenses/>.
18 
19  Consult the COPYING file in the top-level source directory of this
20  module for the precise wording of the license and the list of
21  copyright holders.
22 */
27 #ifndef OPM_MODULAR_FLUID_STATE_HPP
28 #define OPM_MODULAR_FLUID_STATE_HPP
29 
38 
40 #include <algorithm>
41 
42 namespace Opm {
43 
52 template <class ScalarT,
53  unsigned numPhasesV,
54  unsigned numComponentsV,
55  class PressureModule,
56  class TemperatureModule,
57  class CompositionModule,
58  class FugacityModule,
59  class SaturationModule,
60  class DensityModule,
61  class ViscosityModule,
62  class EnthalpyModule>
64  : public PressureModule
65  , public TemperatureModule
66  , public CompositionModule
67  , public FugacityModule
68  , public SaturationModule
69  , public DensityModule
70  , public ViscosityModule
71  , public EnthalpyModule
72 {
73 public:
74  typedef ScalarT Scalar;
75  enum { numPhases = numPhasesV };
76  enum { numComponents = numComponentsV };
77 
86  void checkDefined() const
87  {
88  PressureModule::checkDefined();
89  TemperatureModule::checkDefined();
90  CompositionModule::checkDefined();
91  SaturationModule::checkDefined();
92  DensityModule::checkDefined();
93  ViscosityModule::checkDefined();
94  EnthalpyModule::checkDefined();
95  }
96 
101  template <class FluidState>
102  void assign(const FluidState& fs)
103  {
104  PressureModule::assign(fs);
105  TemperatureModule::assign(fs);
106  CompositionModule::assign(fs);
107  SaturationModule::assign(fs);
108  DensityModule::assign(fs);
109  ViscosityModule::assign(fs);
110  EnthalpyModule::assign(fs);
111  }
112 };
113 
114 } // namespace Opm
115 
116 #endif
Modules for the ModularFluidState which represent composition.
Modules for the ModularFluidState which represent density.
Modules for the ModularFluidState which represent enthalpy.
Modules for the ModularFluidState which represent fugacity/chemical potential.
Modules for the ModularFluidState which represent pressure.
Modules for the ModularFluidState which represent saturation.
Modules for the ModularFluidState which represent temperature.
Modules for the ModularFluidState which represent viscosity.
Some templates to wrap the valgrind client request macros.
Represents all relevant thermodynamic quantities of a multi-phase, multi-component fluid system assum...
Definition: ModularFluidState.hpp:72
void assign(const FluidState &fs)
Retrieve all parameters from an arbitrary fluid state.
Definition: ModularFluidState.hpp:102
void checkDefined() const
Make sure that all attributes are defined.
Definition: ModularFluidState.hpp:86