diff --git a/dumux/material/constraintsolvers/compositionfromfugacities2pncmin.hh b/dumux/material/constraintsolvers/compositionfromfugacities2pncmin.hh index b78511d91dccffa8f771bd0ef20f0a50e67ea758..728ef37baa9a96f6a05cfbd011e37d54deb7b461 100644 --- a/dumux/material/constraintsolvers/compositionfromfugacities2pncmin.hh +++ b/dumux/material/constraintsolvers/compositionfromfugacities2pncmin.hh @@ -25,6 +25,7 @@ #ifndef DUMUX_COMPOSITION_FROM_FUGACITIES_2PNCMIN_HH #define DUMUX_COMPOSITION_FROM_FUGACITIES_2PNCMIN_HH +#include "compositionfromfugacities.hh" #include <dune/common/deprecated.hh> #include <dune/common/fvector.hh> #include <dune/common/fmatrix.hh> @@ -39,114 +40,10 @@ namespace Dumux { * fugacities in a phase. */ template <class Scalar, class FluidSystem> -class DUNE_DEPRECATED_MSG("CompositionFromFugacities2pncmin is deprecated. Use CompositionFromFugacities2pnc instead.") +class DUNE_DEPRECATED_MSG("CompositionFromFugacities2pncmin is deprecated. Use CompositionFromFugacities instead.") CompositionFromFugacities2pncmin - : public CompositionFromFugacities2pnc<Scalar, FluidSystem> + : public CompositionFromFugacities<Scalar, FluidSystem> { }; -// template <class Scalar, class FluidSystem> -// class CompositionFromFugacities2pncmin -// { -// enum { -// numComponents = FluidSystem::numComponents, -// numMajorComponents = FluidSystem::numPhases -// }; -// -// typedef typename FluidSystem::ParameterCache ParameterCache; -// -// -// public: -// typedef Dune::FieldVector<Scalar, numComponents> ComponentVector; -// -// /*! -// * \brief Guess an initial value for the composition of the phase. -// * \param fluidState Thermodynamic state of the fluids -// * \param paramCache Container for cache parameters -// * \param phaseIdx The phase index -// * \param phasePresence The presence index of the reference phase -// * \param fugVec fugacity vector of the component -// */ -// template <class FluidState> -// static void guessInitial(FluidState &fluidState, -// ParameterCache ¶mCache, -// int phaseIdx, -// int phasePresence, -// const ComponentVector &fugVec) -// { -// if (FluidSystem::isIdealMixture(phaseIdx)) -// return; -// -// // Pure component fugacities -// for (int i = 0; i < numComponents; ++ i) -// { -// fluidState.setMoleFraction(phaseIdx,i, 1.0/numComponents); -// } -// } -// -// /*! -// * \brief Calculates the chemical equilibrium from the component -// * fugacities in a phase. This constraint solver is developed for drying scenarios where -// * salt component is restricted to liquid phase and still for the sake for equilibrium -// * calculation some residual salt must be considered in the gas phase. In such cases for -// * existence of gas phase only, in the theoretical liquid phase, we set the mole fraction -// * of salt to 1e-10. -// * \param fluidState Thermodynamic state of the fluids -// * \param paramCache Container for cache parameters -// * \param phaseIdx The phase index -// * \param targetFug target fugacity -// * \param phasePresence Presence of the phase -// * -// * The phase's fugacities must already be set. -// */ -// template <class FluidState> -// static void solve(FluidState &fluidState, -// ParameterCache ¶mCache, -// int phaseIdx, -// int phasePresence, -// const ComponentVector &targetFug) -// { -// // use a much more efficient method in case the phase is an -// // ideal mixture -// if (FluidSystem::isIdealMixture(phaseIdx)) -// { -// solveIdealMix_(fluidState, paramCache, phaseIdx, phasePresence, targetFug); -// return; -// } -// else -// DUNE_THROW(NumericalProblem, "This constraint solver is not tested for non-ideal mixtures: Please refer computefromfugacities.hh for details" ); -// } -// -// protected: -// // update the phase composition in case the phase is an ideal -// // mixture, i.e. the component's fugacity coefficients are -// // independent of the phase's composition. -// template <class FluidState> -// static void solveIdealMix_(FluidState &fluidState, -// ParameterCache ¶mCache, -// int phaseIdx, -// int phasePresence, -// const ComponentVector &fugacities) -// { -// for (int i = 0; i < numComponents; ++ i) -// { -// Scalar phi = FluidSystem::fugacityCoefficient(fluidState, -// paramCache, -// phaseIdx, -// i); -// Scalar gamma = phi * fluidState.pressure(phaseIdx); -// fluidState.setFugacityCoefficient(phaseIdx, i, phi); -// fluidState.setMoleFraction(phaseIdx, i, fugacities[i]/gamma); -// // Special situation for drying PM and n-phase only situation.set the mole fraction of salt to 1e-10. -// if (phaseIdx == 0 && i >= numMajorComponents && phasePresence == 2 /*nPhaseOnly*/) -// fluidState.setMoleFraction(phaseIdx, i, 1.0e-10); -// } -// -// paramCache.updatePhase(fluidState, phaseIdx); -// -// Scalar rho = FluidSystem::density(fluidState, paramCache, phaseIdx); -// fluidState.setDensity(phaseIdx, rho); -// return; -// } -}; template <class Scalar, class FluidSystem> class DUNE_DEPRECATED_MSG("compositionFromFugacities2pncmin is deprecated. Use CompositionFromFugacities2pncmin (capital C) instead.") diff --git a/dumux/material/constraintsolvers/computefromreferencephase2pncmin.hh b/dumux/material/constraintsolvers/computefromreferencephase2pncmin.hh index 60bbe64e4ecb560c97079746158da6dbaffdb18e..6ccfec73319d3381af921154768771287567752e 100644 --- a/dumux/material/constraintsolvers/computefromreferencephase2pncmin.hh +++ b/dumux/material/constraintsolvers/computefromreferencephase2pncmin.hh @@ -29,7 +29,6 @@ #ifndef DUMUX_COMPUTE_FROM_REFERENCE_PHASE_2PNCMIN_HH #define DUMUX_COMPUTE_FROM_REFERENCE_PHASE_2PNCMIN_HH -#include <dumux/material/constraintsolvers/compositionfromfugacities.hh> #include "computefromreferencephase.hh" #include <dune/common/deprecated.hh> @@ -72,113 +71,6 @@ class DUNE_DEPRECATED_MSG("ComputeFromReferencePhase2pNCMin is deprecated. Use C ComputeFromReferencePhase2pNCMin : public ComputeFromReferencePhase<Scalar, FluidSystem> { }; -// template <class Scalar, class FluidSystem> -// class ComputeFromReferencePhase2pNCMin -// { -// enum { numPhases = FluidSystem::numPhases }; -// enum { numComponents = FluidSystem::numComponents }; -// typedef Dumux::compositionFromFugacities2pncmin<Scalar, FluidSystem> compositionFromFugacities2pncmin; -// typedef Dune::FieldVector<Scalar, numComponents> ComponentVector; -// -// public: -// /*! -// * \brief Computes all quantities of a generic fluid state if a -// * reference phase has been specified. -// * -// * This makes it is possible to specify just one phase and let the -// * remaining ones be calculated by the constraint solver. This -// * constraint solver assumes thermodynamic equilibrium. It assumes the -// * following quantities to be set: -// * -// * - composition (mole+mass fractions) of the *reference* phase -// * - temperature of the *all* phases -// * - saturations of *all* phases -// * - pressures of *all* phases -// * -// * after calling the solve() method the following quantities are -// * calculated in addition: -// * -// * - temperature of *all* phases -// * - density, molar density, molar volume of *all* phases -// * - composition in mole and mass fractions and molaries of *all* phases -// * - mean molar masses of *all* phases -// * - fugacity coefficients of *all* components in *all* phases -// * - if the setViscosity parameter is true, also dynamic viscosities of *all* phases -// * - if the setEnthalpy parameter is true, also specific enthalpies and internal energies of *all* phases -// * -// * \param fluidState Thermodynamic state of the fluids -// * \param paramCache Container for cache parameters -// * \param refPhaseIdx The phase index of the reference phase -// * \param phasePresence The presence index of the reference phase -// * \param setViscosity Specify whether the dynamic viscosity of -// * each phase should also be set. -// * \param setEnthalpy Specify whether the specific -// * enthalpy/internal energy of each phase -// * should also be set. -// */ -// template <class FluidState, class ParameterCache> -// static void solve(FluidState &fluidState, -// ParameterCache ¶mCache, -// int refPhaseIdx, -// int phasePresence, -// bool setViscosity, -// bool setEnthalpy) -// { -// ComponentVector fugVec; -// -// // compute the density and enthalpy of the -// // reference phase -// paramCache.updatePhase(fluidState, refPhaseIdx); -// fluidState.setDensity(refPhaseIdx, -// FluidSystem::density(fluidState, -// paramCache, -// refPhaseIdx)); -// -// if (setEnthalpy) -// fluidState.setEnthalpy(refPhaseIdx, -// FluidSystem::enthalpy(fluidState, -// paramCache, -// refPhaseIdx)); -// -// if (setViscosity) -// fluidState.setViscosity(refPhaseIdx, -// FluidSystem::viscosity(fluidState, -// paramCache, -// refPhaseIdx)); -// -// // compute the fugacities of all components in the reference phase -// for (int compIdx = 0; compIdx < numComponents; ++compIdx) { -// fluidState.setFugacityCoefficient(refPhaseIdx, -// compIdx, -// FluidSystem::fugacityCoefficient(fluidState, -// paramCache, -// refPhaseIdx, -// compIdx)); -// fugVec[compIdx] = fluidState.fugacity(refPhaseIdx, compIdx); -// } -// -// // compute all quantities for the non-reference phases -// for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) { -// if (phaseIdx == refPhaseIdx) -// continue; // reference phase is already calculated -// -// compositionFromFugacities2pncmin::guessInitial(fluidState, paramCache, phaseIdx, phasePresence,fugVec); -// compositionFromFugacities2pncmin::solve(fluidState, paramCache, phaseIdx, phasePresence, fugVec); -// -// if (setViscosity) -// fluidState.setViscosity(phaseIdx, -// FluidSystem::viscosity(fluidState, -// paramCache, -// phaseIdx)); -// -// if (setEnthalpy) -// fluidState.setEnthalpy(phaseIdx, -// FluidSystem::enthalpy(fluidState, -// paramCache, -// phaseIdx)); -// } -// } -// }; } // end namespace Dumux