From b52900aa76a01449da3931c2d9db9adef5da7f08 Mon Sep 17 00:00:00 2001 From: danieldouglas92 Date: Mon, 14 Oct 2024 16:23:59 -0600 Subject: [PATCH] account for the fluid velocity for outflow boundaries --- source/simulator/helper_functions.cc | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/source/simulator/helper_functions.cc b/source/simulator/helper_functions.cc index 55ee60b6c83..2510ee8f6de 100644 --- a/source/simulator/helper_functions.cc +++ b/source/simulator/helper_functions.cc @@ -2291,12 +2291,12 @@ namespace aspect update_quadrature_points | update_JxW_values); std::vector> face_current_velocity_values (fe_face_values.n_quadrature_points); - std::vector> face_current_fluid_velocity_values(fe_face_values.n_quadrature_points); + std::vector> face_current_fluid_velocity_values (fe_face_values.n_quadrature_points); MaterialModel::MaterialModelInputs in(fe_face_values.n_quadrature_points, introspection.n_compositional_fields); MaterialModel::MaterialModelOutputs out(fe_face_values.n_quadrature_points, introspection.n_compositional_fields); MeltHandler::create_material_model_outputs(out); - MaterialModel::MeltOutputs *fluid_out = nullptr; + MaterialModel::MeltOutputs *fluid_out = out.template get_additional_output>();; const auto &tangential_velocity_boundaries = boundary_velocity_manager.get_tangential_boundary_velocity_indicators(); @@ -2329,8 +2329,11 @@ namespace aspect // ... check if the face is an outflow boundary by integrating the normal velocities // (flux through the boundary) as: int u*n ds = Sum_q u(x_q)*n(x_q) JxW(x_q)... - double integrated_flow = 0; + // do this for the solid velocity, the darcy velocity, and/or the fluid velocity + // if applicable. + double integrated_solid_flow = 0; double integrated_darcy_flow = 0; + double integrated_fluid_flow = 0; for (unsigned int q=0; q 0 || integrated_darcy_flow > 0) + if (integrated_solid_flow > 0 || integrated_darcy_flow > 0 || integrated_fluid_flow > 0) face->set_boundary_id(face->boundary_id() + offset); } }