Skip to content

Issue4483 temp var fluid prop borefield - #4672

Open
LoneMeertens wants to merge 155 commits into
lbl-srg:issue4483_TempVarFluidPropBorefieldfrom
LoneMeertens:issue4483_TempVarFluidPropBorefield
Open

Issue4483 temp var fluid prop borefield#4672
LoneMeertens wants to merge 155 commits into
lbl-srg:issue4483_TempVarFluidPropBorefieldfrom
LoneMeertens:issue4483_TempVarFluidPropBorefield

Conversation

@LoneMeertens

Copy link
Copy Markdown

This PR continues the work started for temperature-dependent fluid properties in borefield models.

It addresses and combines the work from the following issues:

The implementation in this branch was built on top of the work done for #4656, which already incorporated the changes from #4655. Therefore, this PR includes the functionality from the earlier PR #4660 as well.

This PR is intended to replace #4660.

Main additions included here:

  • temperature-dependent fluid-property evaluation for borefield heat-transfer and pressure-drop correlations;
  • optional temperature-dependent pipe convection resistance via use_TDepRConv;
  • optional Darcy-Weisbach pressure drop via use_DarcyPressureDrop;
  • optional temperature-dependent density and viscosity for Darcy pressure drop via use_TDepPressureDrop;
  • shared fluid-property evaluation through fluidProperties_T;
  • Churchill friction-factor functions used by the updated convection and pressure-drop correlations;
  • validation/example models for:
    • fluid-property evaluation,
    • convection resistance,
    • Darcy pressure drop,
    • temperature-dependent pressure drop in borefields.

I would appreciate feedback on the added and updated example models before generating the final reference results.

LoneMeertens and others added 30 commits July 14, 2026 10:07
…eertens/modelica-buildings into issue4655_NusseltCorrelationUpdate
… include new churchillfrictionfactorRe2 function, including validations models and mos scripts
@LoneMeertens

Copy link
Copy Markdown
Author

Note from @Vbraciszewski

Hi Lone,

Deploy project Tested model: GeoSystems_Adaptive.GeoOnly.NoGSHP_1_v8_2Pipe2DynGround_2

I was able to get model to compile and run for 24 hrs. I'll continue to test. Please let me know if you push any changes to the MBL_Dev branch.

ConDat:
Still not sure the purpose of the mass fraction input, as it is grayed out for me based on my fluidpropevalution selection. I cannot think of a case when I would not want to pull mass fraction from media definition.

Requests

Could you please explain reason for the 3 fluidproperty evaluation options?

If we keep, X_a input, then I recommend correcting text to say generically "antifreeze" as we should be able to support other antifreezes mixes besides Propylene Glycol (PG).

Is current implementation limited to PG for some reason? Or does the model work (and has been tested) with any available antifreeze from MBL?

Update

@Vbraciszewski Thanks for testing and for the feedback.

You are right: the separate fluidPropertyEvaluation and X_a inputs in conDat were confusing and could lead to inconsistent setups. I refactored this so the redeclared Medium is now the single source of truth for fluid type and glycol mass fraction.

What changed

  • Removed fluidPropertyEvaluation from the borefield configuration records.
  • Removed X_a from the borefield configuration records.
  • Moved the modeling switches from conDat to the borefield model level:
    • use_DarcyPressureDrop
    • use_TDepPressureDrop
    • use_TDepRConv
  • The borefield now automatically derives the fluid type and, for antifreeze media, X_a from the redeclared Medium.
  • Shared helper functions were moved to Buildings.Fluid.BaseClasses.Media.Functions so they can also be reused by future FixedResistances pipe models.
  • Updated Buildings.Fluid.Geothermal.Borefields, Buildings.Fluid.Geothermal.ZonedBorefields, examples, validation models, and users guides accordingly.

New usage

The fluid is defined only in the medium declaration, for example:

redeclare package Medium =
  Buildings.Media.Antifreeze.PropyleneGlycolWater(
    property_T=293.15,
    X_a=0.40)

The modeling options are set on the borefield instance:

borFie(
  use_DarcyPressureDrop=true,
  use_TDepPressureDrop=true,
  use_TDepRConv=true)

conDat now only contains geometry, nominal conditions, and physical tube/borefield data, such as roughness.

Supported media

For temperature-dependent pressure drop and convection resistance, the current implementation supports:

  • Buildings.Media.Water
  • Buildings.Media.Antifreeze.EthyleneGlycolWater
  • Buildings.Media.Antifreeze.PropyleneGlycolWater

So it is not limited to propylene glycol anymore. It also supports ethylene glycol/water. All valid X_a values supported by those media should work, because X_a is read from the medium declaration.

If use_TDepPressureDrop=false and use_TDepRConv=false, other compatible media can still be used as before. If either temperature-dependent option is enabled, the model checks that the medium is one of the supported media above.

In short: the three old fluidPropertyEvaluation choices and the separate conDat.X_a input are removed from the user workflow. The user now only redeclares the Medium, and the model handles the property evaluation automatically.

@Vbraciszewski

Copy link
Copy Markdown

@LoneMeertens - thanks for making the change!

Moved the modeling switches from conDat to the borefield model level:

  • use_DarcyPressureDrop
  • use_TDepPressureDrop
  • use_TDepRConv

I pulled the latest, and did not see booleans in UI under advanced tab or in the config record. Oddly, I see them in the PartialBorefield base class code layer but not the UI. 

I think it's due to a formatting issue in the annotation lines (see line 66). If you remove the line breaks, they should appear correctly. 
image

Snips of current models showing booleans missing:

Borefield
image

Zoned
image

@LoneMeertens

Copy link
Copy Markdown
Author

Hi @Vbraciszewski, I double-checked whether the changes were correctly merged into MBL_Dev, and on my side I can see the booleans in the GUI as well (see below).

Could you let me know which is the latest commit you have pulled? That might help us figure out where the discrepancy is coming from.

image

@Vbraciszewski

Vbraciszewski commented Aug 8, 2026 via email

Copy link
Copy Markdown

@LoneMeertens

LoneMeertens commented Aug 10, 2026 via email

Copy link
Copy Markdown
Author

@Vbraciszewski

Vbraciszewski commented Aug 10, 2026

Copy link
Copy Markdown

I just switched to PR development branch to check. The GUI issue is resolved in this branch:
https://github.com/LoneMeertens/modelica-buildings/tree/issue4483_TempVarFluidPropBorefield

Solution: Merge the PR dev branch with MBL_Dev. We can take a look tomorrow.

@Vbraciszewski

Copy link
Copy Markdown

@LoneMeertens - after additional testing, to reduce parameterization decisions for users, I think the 3 booleans could be reduced to 2:

Keep "Use_Darcy" - toggles new major loss PD calc

Then combine the 2 T_dep options into single boolean since I could not think of a case (outside of research) in which user would want to toggle just one of the two booleans.

Example below
image

Could combine the display annotation for the two as well that explain the use of local medium state and impact on Darcy-Weisbach pressure drop and pipe convection resistance.

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.

3 participants