Hello!
I want to calculate the flow rate in a DFN model. I used the function flowplane.zone.discharge to obtain the flow vectors within a loop foreach over flowplane.zone.list, with block fluid crack-flow on enabled. Then, I applied math.mag to compute the discharge magnitude in m²/s. Finally, I multiplied this value by the fracture aperture to calculate the flow rate in m³/s. Is this approach correct?
You need to multiply the discharge by the width of the zone (perpendicular to the vector) to get a volumetric flow rate. The safest way to determine the volumetric flow rate is to sum the knot unbalanced volumes along an edge (or joint boundary).
1 Like
Thank you for the response. How does the joint aperture influence the calculation of unbalanced volumes at knots? I did not define this property explicitly in my FISH function, I simply summed all knot unbalanced volumes along the joint boundary.
Yes, the aperture is accounted for in the knot volume. Have a look at this example to calculate inflow and outflow
flow_only.dat (1.3 KB)
1 Like
Thank you for your support and for sharing the explanation code.
I have a few questions regarding this specific code:
-
Is unbalanced volume (flowknot.vol.unbal) referring to the volume or the flow at the flowknot (i.e., what is its unit)? Why is it multiplied by fluid.timestep rather than divided?
-
Regarding the callback add command, specifically the value 0.1: what exactly does this represent? Since the model runs in cycles, at what interval within the cycle would the function be called?
Thank you very much for taking the time to answer and help clarify my doubts.
Yes, I think you are correct. The SI units for unbalanced volume are m^3, so the volumetric flow rate would be volume / timestep. To get the total inflow and outflow, you can just sum the volumes. See new FISH below. I think this is now correct. If you plot the flow knot extra variables, you see the volumetric flow rate, which is around 5e-5 m^3/s. If you look at the discharge it is around 2e-4 m^2/s. The dimension of the zone perpendicular to flow is around 0.25 m, so the volumetric flow calculated this way is also is close to 5e-5 m^3/s.
The number in the callback refers to the location in the calculation cycle. See [here]. It doesn’t actually matter which number you use, you just want to call this function every step.
fish def flow
flow_in = 0
flow_out = 0
loop foreach fk flowknot.list
local unbal_vol = flowknot.vol.unbal(fk)
if unbal_vol < 0
flow_in += unbal_vol; /fluid.timestep
endif
if unbal_vol > 0
flow_out += unbal_vol; /fluid.timestep
endif
; this is volumetric flow rate, for plotting
flowknot.extra(fk) = flowknot.vol.unbal(fk)/fluid.timestep
end_loop
end
1 Like