-
Notifications
You must be signed in to change notification settings - Fork 161
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
JayHuLBL
wants to merge
47
commits into
master
Choose a base branch
from
issue1495_clean_Mo2To_Interface
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
aedf419
added coupling files
JayHuLBL f056e4c
corrected comments
JayHuLBL c086363
creating the dummy code
JayHuLBL 8ac10d6
adding user guide
JayHuLBL ee88d9f
merged master
JayHuLBL 722f65c
updated python code comments
JayHuLBL 1a7f512
updated SI units
JayHuLBL 7c8c720
created tough avatot
JayHuLBL 1b92a77
updated modelica-tough user guide
JayHuLBL 2f80ca5
Merge branch 'master' into issue1495_clean_Mo2To_Interface
JayHuLBL 2bf3b3a
added toughTemp folder
JayHuLBL 3b82fa8
dummy commit
JayHuLBL 8f71638
converting Fortran script to python
JayHuLBL 4f5090f
converting fortran code
JayHuLBL a295afc
converting script
JayHuLBL ec2a088
converted Fortran functinality to python
JayHuLBL 55b65a9
dummy commit
JayHuLBL 3322640
changed the data format to fortran style
JayHuLBL a65d87c
corrected data format, so have the right results
JayHuLBL 3d793e1
Updated user guide for TOUGH coupling
EttoreZ e8fa41b
Merge branch 'master' into issue1495_clean_Mo2To_Interface
JayHuLBL f700977
cleaned the documentation
JayHuLBL c9da375
added the toughTemp
JayHuLBL 3bd73f8
used the tough avatar code, updated reference
JayHuLBL 52b7601
updated revision note
JayHuLBL cb09d53
Merge branch 'master' into issue1495_clean_Mo2To_Interface
JayHuLBL f50d995
added release note
JayHuLBL 041bec9
updated flow chart figure
JayHuLBL 17a54f1
added to the exclusion list
JayHuLBL d8e7e38
added toughTemp folder
JayHuLBL 0015cf2
avoided delete the Dummy file
JayHuLBL 70db3f3
deleted not used files
JayHuLBL 048b8ed
sorted configuration file conf.yml
JayHuLBL 5b578e7
Merge branch 'master' into issue1495_clean_Mo2To_Interface
JayHuLBL 7e66505
increased the time out time
JayHuLBL 626cb06
merged master
JayHuLBL fe42068
temporary disabled other tests
JayHuLBL dcb2bb6
merged master
JayHuLBL 4b6f924
merged master
JayHuLBL 41c873a
removed obsolete text [ci skip]
JayHuLBL 20de026
Update TOUGH co-simulation script
EttoreZ f962393
merged master
JayHuLBL b3da830
updated reference
JayHuLBL 3cfaace
added model to exclude optimica CI test
JayHuLBL b2d89b2
enabled all ci tests
JayHuLBL b959c9a
improved documentation
JayHuLBL 9d3aacb
corrected typo, added reference
JayHuLBL File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
148 changes: 148 additions & 0 deletions
148
Buildings/Fluid/Geothermal/Borefields/TOUGHResponse/BaseClasses/GroundResponse.mo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.