From 3f26cee5c5f1fc0383ee28fee830a4014191cccb Mon Sep 17 00:00:00 2001 From: Thomas Fischer <thomas.fischer@ufz.de> Date: Mon, 25 Jun 2018 13:56:01 +0200 Subject: [PATCH] [PL/ComponentTransport] Read balance related part of project file. --- .../CreateComponentTransportProcess.cpp | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/ProcessLib/ComponentTransport/CreateComponentTransportProcess.cpp b/ProcessLib/ComponentTransport/CreateComponentTransportProcess.cpp index b212554ccb1..467825776b9 100644 --- a/ProcessLib/ComponentTransport/CreateComponentTransportProcess.cpp +++ b/ProcessLib/ComponentTransport/CreateComponentTransportProcess.cpp @@ -12,6 +12,9 @@ #include "MaterialLib/Fluid/FluidProperties/CreateFluidProperties.h" #include "MaterialLib/PorousMedium/CreatePorousMediaProperties.h" +#include "MeshLib/IO/readMeshFromFile.h" + +#include "ProcessLib/CalculateSurfaceFlux/ParseCalculateSurfaceFluxData.h" #include "ProcessLib/Output/CreateSecondaryVariables.h" #include "ProcessLib/Parameter/ConstantParameter.h" #include "ProcessLib/Utils/ProcessUtils.h" @@ -167,6 +170,33 @@ std::unique_ptr<Process> createComponentTransportProcess( ProcessLib::createSecondaryVariables(config, secondary_variables, named_function_caller); + // for the balance + std::string mesh_name; // surface mesh the balance will computed on + std::string balance_pv_name; + std::string balance_out_fname; + std::unique_ptr<MeshLib::Mesh> surface_mesh; + ProcessLib::parseCalculateSurfaceFluxData( + config, mesh_name, balance_pv_name, balance_out_fname); + + if (!mesh_name.empty()) // balance is optional + { + mesh_name = BaseLib::copyPathToFileName(mesh_name, project_directory); + + balance_out_fname = + BaseLib::copyPathToFileName(balance_out_fname, output_directory); + + surface_mesh.reset(MeshLib::IO::readMeshFromFile(mesh_name)); + + DBUG( + "read balance meta data:\n\tbalance mesh:\"%s\"\n\tproperty name: " + "\"%s\"\n\toutput to: \"%s\"", + mesh_name.c_str(), balance_pv_name.c_str(), + balance_out_fname.c_str()); + + // Surface mesh and bulk mesh must have equal axial symmetry flags! + surface_mesh->setAxiallySymmetric(mesh.isAxiallySymmetric()); + } + return std::make_unique<ComponentTransportProcess>( mesh, std::move(jacobian_assembler), parameters, integration_order, std::move(process_variables), std::move(process_data), -- GitLab