Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Balance for HT process #2132

Merged
merged 13 commits into from
May 31, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[PL/HT] Enable reading information for the balance.
  • Loading branch information
TomFischer committed May 30, 2018
commit 7546ae2c5e65cb8176cabfee1843181ac54b2fd1
2 changes: 1 addition & 1 deletion Applications/ApplicationsLib/ProjectData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ void ProjectData::parseProcesses(BaseLib::ConfigTree const& processes_config,
process = ProcessLib::HT::createHTProcess(
*_mesh_vec[0], std::move(jacobian_assembler),
_process_variables, _parameters, integration_order,
process_config);
process_config, project_directory, output_directory);
}
else
#endif
Expand Down
34 changes: 33 additions & 1 deletion ProcessLib/HT/CreateHTProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@
#include "MaterialLib/Fluid/FluidProperties/CreateFluidProperties.h"
#include "MaterialLib/PorousMedium/CreatePorousMediaProperties.h"

#include "MeshLib/IO/readMeshFromFile.h"

#include "ProcessLib/Output/CreateSecondaryVariables.h"
#include "ProcessLib/Parameter/ConstantParameter.h"
#include "ProcessLib/Utils/ProcessUtils.h"
#include "ProcessLib/CalculateSurfaceFlux/ParseCalculateSurfaceFluxData.h"

#include "HTProcess.h"
#include "HTMaterialProperties.h"
Expand All @@ -30,7 +33,9 @@ std::unique_ptr<Process> createHTProcess(
std::vector<ProcessVariable> const& variables,
std::vector<std::unique_ptr<ParameterBase>> const& parameters,
unsigned const integration_order,
BaseLib::ConfigTree const& config)
BaseLib::ConfigTree const& config,
std::string const& project_directory,
std::string const& output_directory)
{
//! \ogs_file_param{prj__processes__process__type}
config.checkConfigParameter("type", "HT");
Expand Down Expand Up @@ -194,6 +199,33 @@ std::unique_ptr<Process> createHTProcess(
DBUG("Use \'%s\' as Biot's constant.", biot_constant->name.c_str());
}

// 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());
}

std::unique_ptr<HTMaterialProperties> material_properties =
std::make_unique<HTMaterialProperties>(
std::move(porous_media_properties),
Expand Down
4 changes: 3 additions & 1 deletion ProcessLib/HT/CreateHTProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ std::unique_ptr<Process> createHTProcess(
std::vector<ProcessVariable> const& variables,
std::vector<std::unique_ptr<ParameterBase>> const& parameters,
unsigned const integration_order,
BaseLib::ConfigTree const& config);
BaseLib::ConfigTree const& config,
std::string const& project_directory,
std::string const& output_directory);

} // namespace HT
} // namespace ProcessLib