Classes |
Public Member Functions |
Protected Types |
Protected Member Functions |
Protected Attributes |
Static Protected Attributes |
List of all members
Opm::BlackOilHybridNewton< TypeTag > Class Template Reference Hybrid Newton solver extension for the black-oil model. More...
Detailed Descriptiontemplate<typename TypeTag> class Opm::BlackOilHybridNewton< TypeTag > Hybrid Newton solver extension for the black-oil model. This class integrates machine learning–based corrections into the standard Newton solver of the black-oil simulator. It uses one or more trained Hybrid Newton models to adjust the initial guess of the nonlinear solver at specific timesteps. Each model is described by a HybridNewtonConfig, which specifies:
At runtime, the class:
Member Typedef Documentation◆ Evaluation
template<typename TypeTag >
◆ FluidSystem
template<typename TypeTag >
◆ Indices
template<typename TypeTag >
◆ MaterialLaw
template<typename TypeTag >
◆ Scalar
template<typename TypeTag >
◆ Simulator
template<typename TypeTag >
Member Enumeration Documentation◆ anonymous enum◆ anonymous enum◆ anonymous enum◆ anonymous enumConstructor & Destructor Documentation◆ BlackOilHybridNewton()
template<typename TypeTag >
Member Function Documentation◆ constructInputTensor()
template<typename TypeTag >
Construct the input feature tensor for the Hybrid Newton model. The tensor is constructed in the exact order specified by
Example: Suppose [ SGAS(cell0), SGAS(cell1), SGAS(cell2), TIMESTEP, PRESSURE(cell0), PRESSURE(cell1), PRESSURE(cell2) ] Thus, the tensor length equals: (# of scalar features) + (# of per-cell features × n_cells).
References Opm::FeatureSpec::actual_name, Opm::HybridNewtonConfig::cell_indices, Opm::BlackOilHybridNewton< TypeTag >::getPerCellFeatureValue(), Opm::BlackOilHybridNewton< TypeTag >::getScalarFeatureValue(), Opm::HybridNewtonConfig::input_features, and Opm::HybridNewtonConfig::n_cells. ◆ constructOutputTensor()
template<typename TypeTag >
Run the Hybrid Newton model to produce output predictions. Uses the input tensor (prepared by constructInputTensor) together with the model specified in
References Opm::HybridNewtonConfig::model_path, Opm::HybridNewtonConfig::n_cells, and Opm::HybridNewtonConfig::output_features. ◆ flagFeatures()
template<typename TypeTag >
References Opm::BlackOilHybridNewton< TypeTag >::FeatureFlags::has_PRESSURE, Opm::BlackOilHybridNewton< TypeTag >::FeatureFlags::has_SGAS, Opm::BlackOilHybridNewton< TypeTag >::FeatureFlags::has_SOIL, and Opm::BlackOilHybridNewton< TypeTag >::FeatureFlags::has_SWAT. Referenced by Opm::BlackOilHybridNewton< TypeTag >::updateInitialGuess(). ◆ getPerCellFeatureValue()
template<typename TypeTag >
Retrieve and transform a per-cell feature value. Supported per-cell features include:
The raw value is taken from the simulator state, converted into the configured unit system, then passed through the feature's transformation and scaling functions.
References Opm::FeatureSpec::actual_name, Opm::Transform::apply(), Opm::BlackOilHybridNewton< TypeTag >::gasPhaseIdx, Opm::BlackOilHybridNewton< TypeTag >::oilPhaseIdx, Opm::Scaler::scale(), Opm::FeatureSpec::scaler, Opm::BlackOilHybridNewton< TypeTag >::simulator_, Opm::FeatureSpec::transform, and Opm::BlackOilHybridNewton< TypeTag >::waterPhaseIdx. Referenced by Opm::BlackOilHybridNewton< TypeTag >::constructInputTensor(). ◆ getScalarFeatureValue()
template<typename TypeTag >
Retrieve and transform a scalar feature (global across the domain). Supported scalar feature:
The raw value is passed through the feature's transformation and scaling functions before being returned.
References Opm::FeatureSpec::actual_name, Opm::Transform::apply(), Opm::Scaler::scale(), Opm::FeatureSpec::scaler, Opm::BlackOilHybridNewton< TypeTag >::simulator_, and Opm::FeatureSpec::transform. Referenced by Opm::BlackOilHybridNewton< TypeTag >::constructInputTensor(). ◆ shouldApplyHybridNewton()
template<typename TypeTag >
Check whether the Hybrid Newton method should be applied at the given time. This function evaluates the current simulation time against the application times specified in the HybridNewtonConfig. The behavior depends on how many entries are provided in
References Opm::HybridNewtonConfig::apply_times. Referenced by Opm::BlackOilHybridNewton< TypeTag >::tryApplyHybridNewton(). ◆ tryApplyHybridNewton()
template<typename TypeTag >
Attempt to apply the Hybrid Newton correction at the current timestep. This function acts as the entry point for Hybrid Newton corrections. It first checks whether the Hybrid Newton mechanism is enabled (via At each timestep, it iterates over all loaded configurations and applies those that match the current simulation time. Typical call site: at the beginning of a nonlinear solve for each timestep.
References Opm::BlackOilHybridNewton< TypeTag >::compositionSwitchEnabled, Opm::BlackOilHybridNewton< TypeTag >::configs_, Opm::BlackOilHybridNewton< TypeTag >::configsLoaded_, Opm::PropertyTree::get_child(), Opm::PropertyTree::get_child_keys(), Opm::BlackOilHybridNewton< TypeTag >::shouldApplyHybridNewton(), Opm::BlackOilHybridNewton< TypeTag >::simulator_, Opm::HybridNewtonConfig::validateConfig(), and Opm::BlackOilHybridNewton< TypeTag >::validateFluidSystem(). Referenced by Opm::FlowProblemBlackoil< TypeTag >::beginTimeStep(). ◆ updateInitialGuess()
template<typename TypeTag >
Update the nonlinear solver's initial guess using ML predictions. For each target cell, this function:
Special handling:
References Opm::HybridNewtonConfig::cell_indices, Opm::BlackOilHybridNewton< TypeTag >::compositionSwitchEnabled, Opm::BlackOilHybridNewton< TypeTag >::flagFeatures(), Opm::BlackOilHybridNewton< TypeTag >::gasPhaseIdx, Opm::BlackOilHybridNewton< TypeTag >::FeatureFlags::has_PRESSURE, Opm::BlackOilHybridNewton< TypeTag >::FeatureFlags::has_SGAS, Opm::BlackOilHybridNewton< TypeTag >::FeatureFlags::has_SOIL, Opm::BlackOilHybridNewton< TypeTag >::FeatureFlags::has_SWAT, Opm::HybridNewtonConfig::n_cells, Opm::BlackOilHybridNewton< TypeTag >::numPhases, Opm::BlackOilHybridNewton< TypeTag >::oilPhaseIdx, Opm::HybridNewtonConfig::output_features, Opm::BlackOilHybridNewton< TypeTag >::simulator_, Opm::to_string(), and Opm::BlackOilHybridNewton< TypeTag >::waterPhaseIdx. ◆ validateFluidSystem()
template<typename TypeTag >
References Opm::BlackOilHybridNewton< TypeTag >::simulator_. Referenced by Opm::BlackOilHybridNewton< TypeTag >::tryApplyHybridNewton(). Member Data Documentation◆ compositionSwitchEnabled
template<typename TypeTag >
◆ configs_
template<typename TypeTag >
Referenced by Opm::BlackOilHybridNewton< TypeTag >::tryApplyHybridNewton(). ◆ configsLoaded_
template<typename TypeTag >
Referenced by Opm::BlackOilHybridNewton< TypeTag >::tryApplyHybridNewton(). ◆ simulator_
template<typename TypeTag >
Referenced by Opm::BlackOilHybridNewton< TypeTag >::getPerCellFeatureValue(), Opm::BlackOilHybridNewton< TypeTag >::getScalarFeatureValue(), Opm::BlackOilHybridNewton< TypeTag >::tryApplyHybridNewton(), Opm::BlackOilHybridNewton< TypeTag >::updateInitialGuess(), and Opm::BlackOilHybridNewton< TypeTag >::validateFluidSystem(). The documentation for this class was generated from the following file: |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||