Loading...
Searching...
No Matches
discretefractureprimaryvariables.hh
Go to the documentation of this file.
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*
This file is part of the Open Porous Media project (OPM).
OPM 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.
OPM 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 OPM. If not, see <http://www.gnu.org/licenses/>.
Consult the COPYING file in the top-level source directory of this
module for the precise wording of the license and the list of
copyright holders.
*/
#ifndef EWOMS_DISCRETE_FRACTURE_PRIMARY_VARIABLES_HH
#define EWOMS_DISCRETE_FRACTURE_PRIMARY_VARIABLES_HH
#include <opm/models/discretefracture/discretefractureproperties.hh>
#include <opm/models/immiscible/immiscibleprimaryvariables.hh>
#include <array>
namespace Opm {
template <class TypeTag>
class DiscreteFracturePrimaryVariables
: public ImmisciblePrimaryVariables<TypeTag>
{
using ParentType = ImmisciblePrimaryVariables<TypeTag>;
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using MaterialLaw = GetPropType<TypeTag, Properties::MaterialLaw>;
using MaterialLawParams = GetPropType<TypeTag, Properties::MaterialLawParams>;
enum { numPhases = getPropValue<TypeTag, Properties::NumPhases>() };
public:
DiscreteFracturePrimaryVariables() = default;
DiscreteFracturePrimaryVariables(const DiscreteFracturePrimaryVariables&) = default;
DiscreteFracturePrimaryVariables& operator=(const DiscreteFracturePrimaryVariables&) = default;
using ParentType::operator=;
template <class FluidState>
void assignNaiveFromFracture(const FluidState& fractureFluidState,
const MaterialLawParams& matParams)
{
FluidState matrixFluidState;
fractureToMatrixFluidState_(matrixFluidState, fractureFluidState,
matParams);
ParentType::assignNaive(matrixFluidState);
}
private:
template <class FluidState>
void fractureToMatrixFluidState_(FluidState& matrixFluidState,
const FluidState& fractureFluidState,
const MaterialLawParams& matParams) const
{
// start with the same fluid state as in the fracture
matrixFluidState.assign(fractureFluidState);
// the condition for the equilibrium is that the pressures are
// the same in the fracture and in the matrix. This means that
// we have to find saturations for the matrix which result in
// the same pressures as in the fracture. this can be done by
// inverting the capillary pressure-saturation curve.
std::array<Scalar, numPhases> saturations;
MaterialLaw::saturations(saturations, matParams, matrixFluidState);
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
matrixFluidState.setSaturation(phaseIdx, saturations[phaseIdx]);
}
}
};
} // namespace Opm
#endif
Opm::DiscreteFracturePrimaryVariables::DiscreteFracturePrimaryVariables
DiscreteFracturePrimaryVariables()=default
Default constructor.
Opm::DiscreteFracturePrimaryVariables::DiscreteFracturePrimaryVariables
DiscreteFracturePrimaryVariables(const DiscreteFracturePrimaryVariables &)=default
Copy constructor.
Opm::DiscreteFracturePrimaryVariables::assignNaiveFromFracture
void assignNaiveFromFracture(const FluidState &fractureFluidState, const MaterialLawParams &matParams)
< Import base class assignment operators.
Definition discretefractureprimaryvariables.hh:86
Opm::ImmisciblePrimaryVariables::assignNaive
void assignNaive(const FluidState &fluidState)
Directly retrieve the primary variables from an arbitrary fluid state.
Definition immiscibleprimaryvariables.hh:189
Opm::ImmisciblePrimaryVariables::ImmisciblePrimaryVariables
ImmisciblePrimaryVariables()
Default constructor.
Definition immiscibleprimaryvariables.hh:82
discretefractureproperties.hh
Defines the properties required for the immiscible multi-phase model which considers discrete fractur...
immiscibleprimaryvariables.hh
Represents the primary variables used by the immiscible multi-phase, model.
Opm
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilbioeffectsmodules.hh:43
Opm::GetPropType
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property (equivalent to old macro GET_PROP_TYPE(....
Definition propertysystem.hh:233
Opm::getPropValue
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:240