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

Using MPL in Heat_Transport_BHE process #2671

Merged
merged 5 commits into from
Sep 23, 2019
Merged

Conversation

HBShaoUFZ
Copy link
Contributor

In this PR, the source code and input files related to HEAT_TRANSPORT_BHE process were changed in order to use the MPL data structure for reading in soil parameters such as thermal conductivity and heat capacity.

  1. The MPL data structure was used when assembling the local matrix for soil part.
  2. All test files have been updated accordingly.
  3. When checking the number of material groups, the original FATAL error was replaced by a WARNING, as the BHEs are additional material groups than the number of medias defined.

@@ -28,7 +28,7 @@ createMaterialSpatialDistributionMap(

if (max_material_id > static_cast<int>(media.size() - 1))
{
OGS_FATAL(
WARN(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please provide explanation in the commit message.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explanation was added in the commit 4ffd04f

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why isn't this an OGS_FATAL? I would expect that bad things could be happen if something in the input project file is inconsistent with the mesh file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem originates from the fact that we use the material IDs to differentiate the 1D line elements assigned to the BHE in a 3D mesh. The simplest case would be, we have one material ID assigned to 3D prism elements for all the soil part. Then we have the 2nd material ID assigned to the one BHE. In this case, our max_material_id == 1. However, we can only define 1 media in the input files (which is the soil media). This means media.size() = 1. The if clause on line 29 is then true and we will trigger the block. If we keep the OGS_FATAL function, then we will not be able to run BHE simulations with different types of materials (soil layers). I discussed this with Dima and we agreed to change it to WARN.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for explaining the background. ⏩

ParameterLib::SpatialPosition pos;
pos.setElementID(_element_id);
pos.setElementID(this->_element_id);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not needed. Removed.

// fluid_phase.property(MaterialPropertyLib::PropertyType::density).template
// value<double>(vars, pos, t); auto const density_g =
// gas_phase.property(MaterialPropertyLib::PropertyType::density).template
// value<double>(vars, pos, t);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These "comments" were not touched for the last two years. I'd recommend to remove them.
If someday there is a need for those densities etc. it can be easily copied from the solid properties. No need to fix that dead "code"

Actually it was discussed in the original PR and nothing has changed: #2221 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although we will need them soon in order to include GW flow and partially saturated processes, they are not needed for now. Therefore removed.

<!-- <name>porosity</name> -->
<!-- <type>Constant</type> -->
<!-- <value>0.001</value> -->
<!-- </property> -->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These properties seems to be unused currently. I strongly recommend to drop the unused, commented code parts.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as the above. Removed for now.

ParameterLib::SpatialPosition pos;
pos.setElementID(_element_id);

auto const& process_data = this->_process_data;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually this local process_data is not necessary. Removed.

HBShaoUFZ and others added 5 commits September 23, 2019 13:13
fix the linking error ufz#2019
disable the unused liquid and gas phase
remove unused code from the soil assembler
remove this and also remove unnecessary local variable
In this commit, the original OGS_FATAL function was changed to a WARN function. The reason behind is that, when running a HEAT_TRANSPORT_BHE process, the BHEs are sitting on a separate material ID. This means , the total number of material IDs is more than the number of media defined. By changing from OGS_FATAL to WARN, this allowing the process to be running.
modify prj files - continued
replace tabs by spaces
modify prj files - continued
remove unused parameters from the input files.
Copy link
Member

@TomFischer TomFischer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. ⏩

@endJunction endJunction merged commit b363241 into ufz:master Sep 23, 2019
@ogsbot
Copy link
Member

ogsbot commented Jun 19, 2020

OpenGeoSys development has been moved to GitLab.

See this pull request on GitLab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants