Repository navigation
Fimbul v0.5.0
Fimbul v0.5.0
Breaking changes
- Closed-loop wells are now a single merged multisegment well instead of separate
<name>_supplyand<name>_returnwells coupled by a cross term. The supply and return parts are merged withJutulDarcy.WellMerging.merge_well_domainsand connected by a regular well segment.setup_closed_loop_well(andsetup_btes_well,setup_vertical_btes_well) returns one well domain named<name>, and states and the model use this name. The two parts are controlled under names with a type-dependent suffix (seeclosed_loop_well_names):_supply/_returnfor generic and 1U wells, and_inner/_outerfor coaxial wells. For example,coaxial_bhenow usesCoaxialWell_innerandCoaxialWell_outer. The return node comes after the supply nodes and has tag:return. ClosedLoopGenericWell(formerlyclosed_loop_type = :simple) without a given topology is now a single pipe from the first to the last reservoir cell instead of a U-shaped pipe. The:simplealias is removed.- By default, the return part is perforated in the reservoir cell of the supply end node (if perforated).
- Consistent keyword arguments for the closed-loop setup:
wall_thickness(generic) is renamed towall_thickness_pipe, andinner_pipe_thermal_conductivity/outer_pipe_thermal_conductivity(coaxial) topipe_thermal_conductivity_inner/pipe_thermal_conductivity_outer. Topology arguments (cell groups,well_cell_centers,end_nodes) withoutneighborshipnow give an error for all types instead of being ignored. setup_btes_wellandsetup_vertical_btes_welldefault to 1U wells (closed_loop_type = :u1).fibonacci_pattern_2d: pointnis placed at radiussqrt((n - 1/2)/(N - 1/2))times the outer radius instead ofsqrt(n/N), which closes the gap at the center of the pattern, andspacingis the median distance between neighboring points. The sunflower pattern ofbtestherefore places the wells slightly differently.btes:num_wellsandwell_spacingcan no longer both be given to the pattern form, since one follows from the other and the field size. Without a field size, the missing one defaults to 48 wells or 5 m.btes: withtopology = :sectors_parallel, each sector is by default a single closed-loop wellS<n>with its boreholes in series (well_grouping = :sector), instead of one wellB<n>per borehole chained withReinjectionTargetcontrols. Usewell_grouping = :boreholefor the previous behavior, e.g. to control individual boreholes. Withreversed_discharge = true, a sector well is discharged by injecting into its return part and producing from its supply part.btes: the sectors ininput_data[:sectors]list the closed-loop wells instead of the supply and return names.btes: the wells are perforated in layer 2 only by default (well_layers = [2]), so the boreholes start below the insulation layer. During rest periods, the supply parts of the closed-loop wells are put underClosedLoopRestControland the return parts are disabled, instead of disabling all wells. By default, discharging runs through each sector in the same direction as charging (reversed_discharge = false), whereas it previously ran from the outermost to the innermost well.- Borehole geometry and fill of closed-loop wells: 1U wells take the borehole radius
radius_borehole(formerlyradius_grout), and coaxial wells take the fill thickness outside the outer pipegrouting_thickness(formerlyradius_grout), as generic wells. The fill properties are set withfill_material,fill_thermal_conductivity,fill_densityandfill_heat_capacity(formerlygrouting_thermal_conductivity,grouting_densityandgrouting_heat_capacity). The old keyword arguments are removed and give an error. - Coaxial wells: the default fill is
:grout(density 2000 kg/m³ and heat capacity 1500 J/(kg K), as for 1U wells, instead of 1500 kg/m³ and 1460 J/(kg K)), and the default fill thickness is 30 mm (borehole radius ≈ 100.7 mm instead of 100 mm).
New features
- New abstract type
AbstractClosedLoopWellwith the concrete typesClosedLoopGenericWell,ClosedLoop1UWellandClosedLoopCoaxialWell. The type is stored as thetypeof theMultiSegmentWell, andclosed_loop_typeaccepts either a type or:generic,:u1and:coaxial. New closed-loop types implementsetup_closed_loop_supply. agsusesClosedLoopGenericWellwith a general well topology.btes: configurable well fields. The wells are placed with a built-in pattern (btes(pattern; ...)with:sunflower,:rectangularor:circular), or given explicitly as sectors of well trajectories (btes(field; ...)). The sectors are coupled in parallel with the boreholes of each sector in series (topology = :sectors_parallel), or in series with the boreholes of each sector in parallel between a shared inlet and outlet (topology = :sectors_series). New keyword argumentsreversed_discharge,well_groupingandpermeability. A sector modelled as a single well needs far fewer timesteps than chained wells, since the coupling between its boreholes is resolved within the well.btes: the patterns take a field size (radiusfor:sunflowerand:circular,extent = (Lx, Ly)for:rectangular) and eithernum_wellsorwell_spacing. The other one follows from the field size, and the number of wells is always honored exactly. The wells are grouped into sectors withsector_grouping: bundles of adjacent spiral spines (:spiral, default for:sunflower), circle sectors (:angular, default for:circular), consecutive wells from the center outwards (:sequential, for:sunflowerand:circular), or blocks of the grid (:cartesian, for:rectangular: blocks ofsector_dimswells, by default as square as possible, tile the full rows from the bottom up, and the remaining wells at the top form the last sectors; withoutextent, the field is a whole number of blocks wide). Spiral sectors are rebalanced by moving outermost wells between neighboring sectors, so that their sizes differ by at most one.plot_btes_fieldandplot_btes_field!(GLMakie extension): plot the wells of a BTES field colored by sector, with the flow path through each sector and the structure of the pattern (sunflower spines, circular rings or rectangular grid).btesstores the well field, pattern and spacing ininput_data.ClosedLoopRestControl: control for closed-loop wells at rest, which holds the wellhead pressure so that the fluid in the loop can expand and contract with temperature.- Borehole fill materials for closed-loop wells (
fill_material = :groutby default, or a named tuple of properties), seeFimbul.borehole_fill_properties. - Coaxial wells without grout (
grouting_thickness = 0): the outer pipe exchanges heat directly with the reservoir through its wall. - All closed-loop types accept
dir(also per reservoir cell), generic wells tag their nodes:pipe, andsetup_vertical_closed_loop_wellis exported. The setup for each type is documented insetup_closed_loop_supply.
Improvements
H2OSystem: adapted to the upwinding on potential differences in the compositional fluxes of JutulDarcy 0.4.1, and accepts (and ignores) the flash-specific variable defaults that JutulDarcy passes on.well_mismatch_thermalworks with merged closed-loop wells: a part (e.g.CoaxialWell_inner) is looked up in the merged well, and the temperature is taken at the top node of that part. This is needed to calibrate against the production temperature of a closed-loop well.
Documentation
- New API page for closed-loop wells (setup functions, closed-loop well types, controls and borehole fill).
- Reworked coaxial BHE demo (
examples/production/coaxial_bhe_demo.jl): a layered reservoir, a study of the inner pipe conductivity, and calibration of a homogeneous digital twin against the production temperature and against the temperature along the well. - New example: design optimization of a system of tilted coaxial BHEs (
examples/production/coaxial_bhe_design_demo.jl), which minimizes the drilling cost under a constraint on the thermal power, with the drilling cost correlation of Lukawski et al. (2014). - Reworked BTES demo (
examples/storage/btes_demo.jl): compares the sunflower, circular and rectangular patterns, with plots of the well fields, the thermal plume over the charge cycles, and the charged and discharged energy and recovery factor per cycle. - Example notebooks are published with each documentation version and preview, and example scripts link to the documented revision instead of
main. - Versioned documentation: released versions get their own documentation, selectable alongside
dev.
Development
- The code is formatted with Runic. CI checks the formatting and suggests fixes on pull requests, and a pre-commit hook is provided. The formatting commit is listed in
.git-blame-ignore-revs.
Compatibility
- Requires Jutul ≥ 0.5.5, whose
find_enclosing_cellsfinds all cells along a trajectory.btesrelies on it to give every borehole the same cells. - Requires JutulDarcy ≥ 0.4.1 (and < 0.5), where
setup_reservoir_modeladds the original names of merged wells to the facility. Fimbul 0.4.0 does not work with JutulDarcy 0.4.1 (H2OSystemmodels fail to set up and simulate).
Merged pull requests:
- Coaxial BHE demo updates (#63) (@strene)
- Merged closed loop wells (#64) (@strene)
- Update docs build to match JutulDarcy (#65) (@strene)
- Flatten API docs navigation so the Manual dropdown shows its pages (#66) (@strene)
- Closed-loop borehole fill (#67) (@strene)
- Btes pattern (#68) (@strene)
- Apply Runic formatting (#69) (@strene)
- Update Runic formatting hash in .git-blame-ignore-revs (#70) (@strene)
- Release 0.5.0 (#71) (@strene)
- Documentation update (#72) (@strene)