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

Add Modelica Tough coupling user guide #3696

Open
wants to merge 47 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
aedf419
added coupling files
JayHuLBL Sep 27, 2022
f056e4c
corrected comments
JayHuLBL Sep 27, 2022
c086363
creating the dummy code
JayHuLBL Sep 28, 2022
8ac10d6
adding user guide
JayHuLBL Sep 30, 2022
ee88d9f
merged master
JayHuLBL Jan 4, 2023
722f65c
updated python code comments
JayHuLBL Jan 4, 2023
1a7f512
updated SI units
JayHuLBL Jan 4, 2023
7c8c720
created tough avatot
JayHuLBL Jan 4, 2023
1b92a77
updated modelica-tough user guide
JayHuLBL Jan 7, 2023
2f80ca5
Merge branch 'master' into issue1495_clean_Mo2To_Interface
JayHuLBL Feb 2, 2023
2bf3b3a
added toughTemp folder
JayHuLBL Feb 23, 2023
3b82fa8
dummy commit
JayHuLBL Mar 1, 2023
8f71638
converting Fortran script to python
JayHuLBL Apr 19, 2023
4f5090f
converting fortran code
JayHuLBL Apr 19, 2023
a295afc
converting script
JayHuLBL Apr 20, 2023
ec2a088
converted Fortran functinality to python
JayHuLBL Apr 21, 2023
55b65a9
dummy commit
JayHuLBL Apr 24, 2023
3322640
changed the data format to fortran style
JayHuLBL May 1, 2023
a65d87c
corrected data format, so have the right results
JayHuLBL May 1, 2023
3d793e1
Updated user guide for TOUGH coupling
EttoreZ Feb 27, 2024
e8fa41b
Merge branch 'master' into issue1495_clean_Mo2To_Interface
JayHuLBL Mar 8, 2024
f700977
cleaned the documentation
JayHuLBL Mar 9, 2024
c9da375
added the toughTemp
JayHuLBL Mar 9, 2024
3bd73f8
used the tough avatar code, updated reference
JayHuLBL Mar 11, 2024
52b7601
updated revision note
JayHuLBL Mar 11, 2024
cb09d53
Merge branch 'master' into issue1495_clean_Mo2To_Interface
JayHuLBL Mar 11, 2024
f50d995
added release note
JayHuLBL Mar 11, 2024
041bec9
updated flow chart figure
JayHuLBL Mar 11, 2024
17a54f1
added to the exclusion list
JayHuLBL Mar 12, 2024
d8e7e38
added toughTemp folder
JayHuLBL Mar 12, 2024
0015cf2
avoided delete the Dummy file
JayHuLBL Mar 12, 2024
70db3f3
deleted not used files
JayHuLBL Mar 15, 2024
048b8ed
sorted configuration file conf.yml
JayHuLBL Mar 15, 2024
5b578e7
Merge branch 'master' into issue1495_clean_Mo2To_Interface
JayHuLBL Mar 15, 2024
7e66505
increased the time out time
JayHuLBL Mar 27, 2024
626cb06
merged master
JayHuLBL May 2, 2024
fe42068
temporary disabled other tests
JayHuLBL May 3, 2024
dcb2bb6
merged master
JayHuLBL Jun 11, 2024
4b6f924
merged master
JayHuLBL Jun 11, 2024
41c873a
removed obsolete text [ci skip]
JayHuLBL Jun 11, 2024
20de026
Update TOUGH co-simulation script
EttoreZ Jun 22, 2024
f962393
merged master
JayHuLBL Nov 13, 2024
b3da830
updated reference
JayHuLBL Nov 14, 2024
3cfaace
added model to exclude optimica CI test
JayHuLBL Nov 14, 2024
b2d89b2
enabled all ci tests
JayHuLBL Nov 15, 2024
b959c9a
improved documentation
JayHuLBL Nov 15, 2024
9d3aacb
corrected typo, added reference
JayHuLBL Nov 19, 2024
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
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,9 @@ Buildings/Resources/src/fluid/heatpumps/calibration/doc/build/doctrees
eplus*
sqlite*
Buildings/spawn-*

# Temporary files needed for TOUGH simulation
#########################################
Buildings/Resources/Python-Sources/toughTemp/*
!Buildings/Resources/Python-Sources/toughTemp/Dummy.txt

Copy link
Member

Choose a reason for hiding this comment

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

Opening this file in OMEdit gives an error message due to a wrong annotation.

Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
within Buildings.Fluid.Geothermal.Borefields.TOUGHResponse.BaseClasses;
model GroundResponse

parameter Integer nSeg=10 "Total number of segments";
parameter Integer nInt=10 "Number of points in the ground to be investigated";
parameter Modelica.Units.SI.Time samplePeriod=60 "Sample period of component"
annotation(Dialog(group="Sampling"));
parameter Integer flag=0
"Flag for double values (0: use current value, 1: use average over interval, 2: use integral over interval)"
annotation(Dialog(group="Sampling"));

Modelica.Blocks.Interfaces.RealInput QBor_flow[nSeg](
final unit=fill("W", nSeg))
"Heat flow from boreholes (positive if heat from fluid into soil)"
annotation (Placement(transformation(extent={{-140,60},{-100,100}}),
iconTransformation(extent={{-120,50},{-100,70}})));
Modelica.Blocks.Interfaces.RealInput TBorWal_start[nSeg](
final unit=fill("K", nSeg),
displayUnit=fill("degC", nSeg),
quantity=fill("ThermodynamicTemperature", nSeg))
"Initial borehole outer wall temperature at the begining of the simulation"
annotation (Placement(transformation(extent={{-140,20},{-100,60}}),
iconTransformation(extent={{-120,-10},{-100,10}})));
Modelica.Blocks.Interfaces.RealInput TOut(
final unit="K",
displayUnit="degC",
quantity="ThermodynamicTemperature")
"Outdoor air temperature"
annotation (Placement(transformation(extent={{-140,-20},{-100,20}}),
iconTransformation(extent={{-120,-70},{-100,-50}})));
Modelica.Blocks.Interfaces.RealOutput TBorWal[nSeg](
final unit=fill("K", nSeg),
displayUnit=fill("degC", nSeg),
quantity=fill("ThermodynamicTemperature", nSeg))
"Temperature of current borehole wall temperature"
annotation (Placement(transformation(extent={{100,40},{140,80}}),
iconTransformation(extent={{100,50},{120,70}})));
Modelica.Blocks.Interfaces.RealOutput pInt[nInt]
"Pressure of the interested points"
annotation (Placement(transformation(extent={{100,0},{140,40}}),
iconTransformation(extent={{100,10},{120,30}})));
Modelica.Blocks.Interfaces.RealOutput xInt[nInt]
"Satuation of the interested points"
annotation (Placement(transformation(extent={{100,-40},{140,0}}),
iconTransformation(extent={{100,-30},{120,-10}})));
Modelica.Blocks.Interfaces.RealOutput TInt[nInt](
final unit=fill("K", nInt),
displayUnit=fill("degC", nInt),
quantity=fill("ThermodynamicTemperature", nInt))
"Temperature at the interested points"
annotation (Placement(transformation(extent={{100,-80},{140,-40}}),
iconTransformation(extent={{100,-70},{120,-50}})));

Buildings.Utilities.IO.Python_3_8.Real_Real pyt(
moduleName="GroundResponse",
functionName="doStep",
nDblRea=nSeg+3*nInt,
nDblWri=2*nSeg+2,
samplePeriod=samplePeriod,
flag=flag,
passPythonObject=true)
"Python interface model to call TOUGH simulator"
annotation (Placement(transformation(extent={{20,-10},{40,10}})));
Modelica.Blocks.Routing.Multiplex mul(final n=2*nSeg+2)
"Multiplex"
annotation (Placement(transformation(extent={{-20,-10},{0,10}})));
Modelica.Blocks.Sources.ContinuousClock clock
"Current time"
annotation (Placement(transformation(extent={{-80,-60},{-60,-40}})));

equation
connect(pyt.yR[1:nSeg], TBorWal)
annotation (Line(points={{41,0},{60,0},{60,60},{120,60}}, color={0,0,127}));
connect(mul.y, pyt.uR)
annotation (Line(points={{1,0},{18,0}}, color={0,0,127}));
connect(QBor_flow, mul.u[1:nSeg])
annotation (Line(points={{-120,80},{-40,80},{-40,0},{-20,0}}, color={0,0,127}));
connect(TBorWal_start, mul.u[nSeg+1:2*nSeg]) annotation (Line(points={{-120,40},{-60,40},
{-60,0},{-20,0}}, color={0,0,127}));
connect(TOut, mul.u[2*nSeg+1])
annotation (Line(points={{-120,0},{-20,0}}, color={0,0,127}));
connect(clock.y, mul.u[2*nSeg+2]) annotation (Line(points={{-59,-50},{-40,-50},{-40,
0},{-20,0}}, color={0,0,127}));
connect(pyt.yR[nSeg + 1:nSeg + nInt], pInt) annotation (Line(points={{41,0},{60,
0},{60,20},{120,20}}, color={0,0,127}));
connect(pyt.yR[nSeg+nInt+1:nSeg+2*nInt], xInt)
annotation (Line(points={{41,0},{60,0},{60,-20},{120,-20}}, color={0,0,127}));
connect(pyt.yR[nSeg+2*nInt+1:nSeg+3*nInt], TInt)
annotation (Line(points={{41,0},{60,0},{60,-60},{120,-60}}, color={0,0,127}));

annotation (defaultComponentName="toughRes",
Icon(coordinateSystem(preserveAspectRatio=false), graphics={
Rectangle(
extent={{-100,100},{100,-100}},
lineColor={0,0,0},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Rectangle(
extent={{-100,30},{100,-100}},
lineColor={0,0,0},
fillColor={127,127,0},
fillPattern=FillPattern.Solid),
Rectangle(
extent={{-52,30},{-94,-100}},
lineColor={0,0,0},
fillColor={135,135,135},
fillPattern=FillPattern.Solid),
Line(
points={{-66,-4},{72,-4}},
color={255,0,0},
arrow={Arrow.None,Arrow.Filled}),
Rectangle(
extent={{-100,30},{-94,-100}},
lineColor={0,0,0},
fillColor={0,128,255},
fillPattern=FillPattern.Solid),
Text(
extent={{-151,147},{149,107}},
color={0,0,255},
fillPattern=FillPattern.HorizontalCylinder,
fillColor={0,127,255},
textString="%name")}), Diagram(coordinateSystem(preserveAspectRatio=
false)),
Documentation(info="<html>
<p>
This model calculates the ground temperature response to obtain the temperature
at the borehole wall in a geothermal system where heat is being injected into or
extracted from the ground.
</p>
<p>
The instance <code>pyt</code> finds the ground response with the
<a href=\"https://tough.lbl.gov/software/tough3\">TOUGH</a> simulator
through the Python interface
<a href=\"modelica://Buildings.Utilities.IO.Python_3_8.Real_Real\">
Buildings.Utilities.IO.Python_3_8.Real_Real</a>. See
<a href=\"modelica://Buildings.Fluid.Geothermal.Borefields.TOUGHResponse.UsersGuide\">
Buildings.Fluid.Geothermal.Borefields.TOUGHResponse.UsersGuide</a>
for instructions.
</p>
</html>", revisions="<html>
<ul>
<li>
March 8, 2024, by Jianjun Hu:<br/>
First implementation.
</li>
</ul>
</html>"));
end GroundResponse;
Loading
Loading