-
Notifications
You must be signed in to change notification settings - Fork 22
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
NewFeature unequal segment lengths #136
NewFeature unequal segment lengths #136
Conversation
The segments function in boreholes.py had previously only accounted for the segment lengths to be equal on a specific borehole. This modification provides the ability for the segments to have different lengths. The gfunction.py file needed to address unequal segment lengths in the _map_axial_segment_pairs function so that the boreholes.segments function could properly create bore segments. The _baseSolver object had updates to the segment_lengths(), borehole_segments() and _check_inputs() functions. - The summation of the segment lengths for each borehole are asserted to be within a tenth of a meter of the borehole height - The borehole_segments() function accesses the new variable segmentLengths (if its not None) to split boreholes into segments - The segment_lengths() function flattens the 2D segmentLengths list if segmentLengths is not None
The number of segments at each borehole can be unequal and the segment length of each borehole can be unequal.
the example file will be completed in MassimoCimmino#136
This provides no decrease in speed because the borehole lengths are computed upfront rather than in the function segment_lengths. Then, the segment lengths function can make a numpy array out of the already created list. @MassimoCimmino
@MassimoCimmino I think this is ready to go. Can you take a look? |
I see potentially similar issues as in #133 / #134:
I would suggest a list of arrays of I will move on to this PR after #132, #138 and #146. Also to be considered here is that the functionality for unequal segment lengths needs to be added to the |
I will be working on this PR on my branch. I have implemented segment length ratios, updated visualization methods, and fixed a few issues related to |
Okay sounds good, I'm glad you're open for this being in It looks like you are working hard and doing some rapid development. The progress is exciting. Thank you. |
I have also been busy with the start of the Fall semester. I have been looking into the I am excited with the results so far with the |
Thanks @j-c-cook. I just pushed my implementation. I do prefer your suggestion of imposing the For the optimal discretization parameters, I think this is a topic for another issue. |
Here is a first set of comparisons to verify the results of the current PR with the master branch. We also compare the accuracy and calculation time of the discretization method against a uniform discretization. Calculations are done with the Rectangular borefieldsComparison of g-functions using 12 segments between the PR and the master branchIt is shown here that there is no significant differences in g-function calculations when compared to the Comparison of g-functions with a high-resolution solution (
|
Here is a second set of comparisons using the Rectangular borefieldsComparison of g-functions using 12 segments between the PR and the master branchIt is shown here that there is no significant differences in g-function calculations when compared to the Comparison of g-functions with a high-resolution solution (
|
Results are updated to |
@MassimoCimmino When you say
do you mean that for the same number of segments in the g-function calculation that unequal segment lengths and equal segment lengths now take the same amount of calculation time? |
@j-c-cook Not exactly. We saw an increase in the calculation time before For the calculation time when comparing uniform and non-uniform discretizations, the increase in calculation time is simply due to more thermal response factors being evaluated (due to loss of similarities). As an example, for a pair of boreholes with 12 uniform segments, we have 78 FLS evaluations. For 12 non-uniform segments, it increases to 138. There are 60 evaluations for 8 non-uniform segments. Similarities (before fix)Equivalent (before fix) |
That equivalence method breaks the performance barrier for computing g-functions. Really incredible work by Prieto and Cimmino (2021). |
@MassimoCimmino I've looked closer at #136 (comment) and it appears that this PR is still slower for equivalent methods with 12 uniform segments. Is that an updated plot, or an old one before your fix? |
#136 (comment) shows the old results. I updated the comment to clarify. |
I just ran 28 cases ranging from 2x2 to 26x26 with the equivalent solver combined with the I'm not sure how its possible that just one case can break. I also ran these exact cases yesterday and they all ran fine. Can you take a look at the line that threw the error? Edit: This was run on a high performance computing cluster, and could very well be a fluke. Sometimes those computers throw strange errors that don't make sense, but I think its worth considering nonetheless. Error Message
Proof that all other cases run fineInput file for cluster that accepts a path to a json file containing inputsThis is basically the same as discretize_boreholes.py.
|
The error is reproducible. The field is 2x2. The attached file throws the error. |
- Corrected typos. - Removed warning for nSegments=1, since segment_ratios = [1.] is the only valid value in this case. - Added some comments. - Clarified the warning for factor < 1 to better inform the user on how to resolve the issue.
This builds on #133 and contains the commits from PR #134. This is related to #135 and should not be merged until after #134 is.
The segments function in boreholes.py had previously only accounted for the segment lengths to be equal on a specifi borehole. This modification provides the ability for the segments to have different lengths.
The gfunction.py file needed to address unequal segment lengths in the _map_axial_segment_pairs function so that the oreholes.segments function could properly create bore segments. The _baseSolver object had updates to the segment_lengths(), borehole_segments() and _check_inputs() functions.