flextool icon indicating copy to clipboard operation
flextool copied to clipboard

Hourly flow unequal between input file and results.

Open hbshrestha opened this issue 9 months ago • 4 comments

Hello. I am currently running a single node model in FlexTool 3.0 with nodeA. I have defined the following parameters in node_c sheet:

has_balance: yes Entity Alternative: TRUE inflow_method: scale_to_annual_flow has_storage: yes node_type: balance_within_period invest_method: not_allowed

Image

My annual_flow values (245311826.240498) is basically the sum of hourly inflow values in node_t sheet. Image

NodeA is grouped as JustA in the input file. However, after running the model, in the results file, I see the hourly inflow values are quite different in group_flows_t sheet as shown below. I also tested using the use_original for inflow_method. However, the issue remains the same. What could have caused this and what could be the potential fix?

Image

hbshrestha avatar Apr 17 '25 09:04 hbshrestha

Are you using a sample period of the timeline or full year timeline? The scaling of annual flow does not see the part outside the sample. It linearly scales the part that it sees. The scaling factor is:
(the length of the period / 8760) / (sum of the inflow in the period / annual flow)

However, "use_original" should fix this. If you are using the sample period, check that the imported "alternative" in the "to_excel" filter is correct. If you are using "scenario" filter and you have multiple runs of the same scenario in the results database, it will export them all.

ArttuTupala avatar Apr 22 '25 11:04 ArttuTupala

You have set has_storage to 'yes', but if this is a regular electricity node, it should have no storage. However, as long as you don't have storage capacity, it shouldn't use any storage and therefore has_storage set to 'yes' does not affect results (but might make the model slower).

You have also set node_type to 'balance_within_period' - this is meant for storages that do not care about temporal dynamics - the balance is not maintained by the hour, but for the whole period. This is meant to replicate the behaviour of time slice models that do not have temporal dynamics in their storages. But again, if no storage capacity, there should not be any effect either.

So, neither of those explains what your result shows. The fact that the inflow is sometimes positive would suggest that the applied scaling method includes an addition/subtraction (that would be the case in scale_to_annual_and_peak_flow).

Or then your group JustA is not just nodeA, but that seems doubtful. Does node_balance_t show the same behaviour for NodeA?

I can't replicate this with a small example (using Base scenario from the examples database).

jkiviluo avatar Apr 25 '25 05:04 jkiviluo

Thank you for the response Arttu and Juha!

I removed the annual_flow and peak_inflow values in the node_c sheet, and I used use_original for the inflow_method.

With these changes, the hourly inflow values in the results file is equivalent to that in the input file in the node_t sheet now.

hbshrestha avatar Apr 28 '25 08:04 hbshrestha

It should of course be sufficient if one just has use_original as the inflow_method. I was able to replicate the issue when those parameters were given (annual_flow and peak_inflow). Not sure what's going wrong there, but needs to be fixed.

Good that your workaround is working though.

jkiviluo avatar Apr 28 '25 09:04 jkiviluo