Skip to content
Snippets Groups Projects
Commit d56ec86d authored by Tom Fischer's avatar Tom Fischer
Browse files

[PL/LF] Make reading body forces consistent with other processes.

parent 8b08b8e0
No related branches found
No related tags found
No related merge requests found
...@@ -80,28 +80,26 @@ std::unique_ptr<Process> createLiquidFlowProcess( ...@@ -80,28 +80,26 @@ std::unique_ptr<Process> createLiquidFlowProcess(
ProcessLib::createSecondaryVariables(config, secondary_variables); ProcessLib::createSecondaryVariables(config, secondary_variables);
// Get the gravity vector for the Darcy velocity std::vector<double> const b =
//! \ogs_file_param{prj__processes__process__LIQUID_FLOW__darcy_gravity} //! \ogs_file_param{prj__processes__process__LIQUID_FLOW__specific_body_force}
auto const& darcy_g_config = config.getConfigSubtree("darcy_gravity"); config.getConfigParameter<std::vector<double>>("specific_body_force");
const auto gravity_axis_id_input = if (b.size() != mesh.getDimension())
//! \ogs_file_param{prj__processes__process__LIQUID_FLOW__darcy_gravity__axis_id}
darcy_g_config.getConfigParameter<int>("axis_id");
if (gravity_axis_id_input >= static_cast<int>(mesh.getDimension()))
{ {
OGS_FATAL( OGS_FATAL(
"The gravity axis must be a number between 0 and one less than the " "specific body force (gravity vector) has {:d} components, mesh "
"mesh dimension, which is {:d}. Read gravity axis {:d} from input " "dimension is {:d}",
"file.", b.size(), mesh.getDimension());
mesh.getDimension(), gravity_axis_id_input);
} }
const auto g = int gravity_axis_id = -1; // default: no gravity
//! \ogs_file_param{prj__processes__process__LIQUID_FLOW__darcy_gravity__g} double const g = -b[mesh.getDimension()-1];
darcy_g_config.getConfigParameter<double>("g"); bool const has_gravity = MathLib::toVector(b).norm() > 0;
if (g < 0.) if (has_gravity)
{ {
OGS_FATAL("Gravity magnitude must be non-negative."); if (g != 0.0)
{
gravity_axis_id = mesh.getDimension()-1;
}
} }
const int gravity_axis_id = (g == 0.) ? -1 : gravity_axis_id_input;
std::unique_ptr<ProcessLib::SurfaceFluxData> surfaceflux; std::unique_ptr<ProcessLib::SurfaceFluxData> surfaceflux;
auto calculatesurfaceflux_config = auto calculatesurfaceflux_config =
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment