Skip to content

Commit

Permalink
Merge pull request #4319 from multitalentloes/gpu_support_brineco2pvt
Browse files Browse the repository at this point in the history
Gpu support brineco2pvt
  • Loading branch information
atgeirr authored Jan 6, 2025
2 parents 82a5575 + 5ab75f9 commit 780ce15
Show file tree
Hide file tree
Showing 4 changed files with 176 additions and 75 deletions.
9 changes: 6 additions & 3 deletions opm/material/components/BrineDynamic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class BrineDynamic : public Component<Scalar, BrineDynamic<Scalar, H2O> >
{
const Scalar M1 = H2O::molarMass();
const Evaluation X2 = salinity; // mass fraction of salt in brine
return M1*mM_salt/(mM_salt + X2*(M1 - mM_salt));
return M1*mM_salt()/(mM_salt() + X2*(M1 - mM_salt()));
}

/*!
Expand Down Expand Up @@ -349,9 +349,12 @@ class BrineDynamic : public Component<Scalar, BrineDynamic<Scalar, H2O> >

return mu_brine/1000.0; // convert to [Pa s] (todo: check if correct cP->Pa s is times 10...)
}

private:
//Molar mass salt (assumes pure NaCl) [kg/mol]
static constexpr Scalar mM_salt = 58.44e-3;
static constexpr Scalar mM_salt()
{
return 58.44e-3;
}

};

Expand Down
34 changes: 17 additions & 17 deletions opm/material/fluidsystems/blackoilpvt/BrineCo2Pvt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@

namespace Opm {

template<class Scalar, class Params>
BrineCo2Pvt<Scalar, Params>::
BrineCo2Pvt(const std::vector<Scalar>& salinity,
template<class Scalar, class Params, class ContainerT>
BrineCo2Pvt<Scalar, Params, ContainerT>::
BrineCo2Pvt(const ContainerT& salinity,
int activityModel,
int thermalMixingModelSalt,
int thermalMixingModelLiquid,
Expand All @@ -60,8 +60,8 @@ BrineCo2Pvt(const std::vector<Scalar>& salinity,
}

#if HAVE_ECL_INPUT
template<class Scalar, class Params>
void BrineCo2Pvt<Scalar, Params>::
template<class Scalar, class Params, class ContainerT>
void BrineCo2Pvt<Scalar, Params, ContainerT>::
initFromState(const EclipseState& eclState, const Schedule&)
{
bool co2sol = eclState.runspec().co2Sol();
Expand Down Expand Up @@ -150,17 +150,17 @@ initFromState(const EclipseState& eclState, const Schedule&)
}
#endif

template<class Scalar, class Params>
void BrineCo2Pvt<Scalar, Params>::
template<class Scalar, class Params, class ContainerT>
void BrineCo2Pvt<Scalar, Params, ContainerT>::
setNumRegions(std::size_t numRegions)
{
brineReferenceDensity_.resize(numRegions);
co2ReferenceDensity_.resize(numRegions);
salinity_.resize(numRegions);
}

template<class Scalar, class Params>
void BrineCo2Pvt<Scalar, Params>::
template<class Scalar, class Params, class ContainerT>
void BrineCo2Pvt<Scalar, Params, ContainerT>::
setReferenceDensities(unsigned regionIdx,
Scalar rhoRefBrine,
Scalar rhoRefCO2,
Expand All @@ -170,8 +170,8 @@ setReferenceDensities(unsigned regionIdx,
co2ReferenceDensity_[regionIdx] = rhoRefCO2;
}

template<class Scalar, class Params>
void BrineCo2Pvt<Scalar, Params>::
template<class Scalar, class Params, class ContainerT>
void BrineCo2Pvt<Scalar, Params, ContainerT>::
setActivityModelSalt(int activityModel)
{
switch (activityModel) {
Expand All @@ -182,8 +182,8 @@ setActivityModelSalt(int activityModel)
}
}

template<class Scalar, class Params>
void BrineCo2Pvt<Scalar, Params>::
template<class Scalar, class Params, class ContainerT>
void BrineCo2Pvt<Scalar, Params, ContainerT>::
setThermalMixingModel(int thermalMixingModelSalt, int thermalMixingModelLiquid)
{
switch (thermalMixingModelSalt) {
Expand All @@ -200,8 +200,8 @@ setThermalMixingModel(int thermalMixingModelSalt, int thermalMixingModelLiquid)
}
}

template<class Scalar, class Params>
void BrineCo2Pvt<Scalar, Params>::
template<class Scalar, class Params, class ContainerT>
void BrineCo2Pvt<Scalar, Params, ContainerT>::
setEzrokhiDenCoeff(const std::vector<EzrokhiTable>& denaqa)
{
if (denaqa.empty())
Expand All @@ -216,8 +216,8 @@ setEzrokhiDenCoeff(const std::vector<EzrokhiTable>& denaqa)
static_cast<Scalar>(denaqa[0].getC2("CO2"))};
}

template<class Scalar, class Params>
void BrineCo2Pvt<Scalar, Params>::
template<class Scalar, class Params, class ContainerT>
void BrineCo2Pvt<Scalar, Params, ContainerT>::
setEzrokhiViscCoeff(const std::vector<EzrokhiTable>& viscaqa)
{
if (viscaqa.empty())
Expand Down
Loading

0 comments on commit 780ce15

Please sign in to comment.