Exawind / amr-wind

AMReX-based structured wind solver
https://exawind.github.io/amr-wind
Other
103 stars 78 forks source link

Enable changing velocity in turbine simulations from precurors #1022

Closed genevievestarke closed 2 months ago

genevievestarke commented 2 months ago

Can we add the ability to prescribe varying wind speeds and wind directions in the precursor, and then use in turbine simulations? @mbkuhn and I think this could be accomplished by adding two features: 1) The ability to prescribe the wind speed value at the hub height as a time series rather than a constant value in the precursor simulation 2) Allowing the forcing for driving the flow (body forcing) to be a time series. This would involve collecting it as a time series in the precursor simulations, and then implementing it as a time series in the turbine simulation.

tonyinme commented 2 months ago

Hi @genevievestarke , I believe the feature you are requesting is already available in the code. This PR has the information.

mbkuhn commented 2 months ago

This is great, @tonyinme, thanks for chiming in! I think that this PR addresses point 1 from Gen's request. However, I would think in a simulation where the target velocity is changing, the abl forcing value would be changing quite a bit too. Therefore, it would seem that in a subsequent inflow-outflow simulation, applying a uniform, constant bodyforce would be insufficient. Gen's point 2 is asking for the ability to output the abl forcing value during the precursor sim and then read it in during the inflow/outflow simulation. We don't have that, right?

tonyinme commented 2 months ago

Oh, that's a good point. The PR I shared only addresses the first issue. It can also be used as a guide to implement the feature requested in the second point.

lawrenceccheung commented 2 months ago

Hi @genevievestarke, @mbkuhn,

It could be worth asking @ewquon, what you're asking for might be very closely related to the meso-microscale coupling. Beyond just specifying the MMC profiles, there is also an (undocumented) option to put in a bodyforce-file file https://github.com/Exawind/amr-wind/blob/main/amr-wind/equation_systems/icns/source_terms/BodyForce.cpp which reads in a z-varying body-force height. BodyForce can also be sinusoidal, so the next logical step might be to make it vary in time and z and be usable for multiple scenarios.

Lawrence

mbkuhn commented 2 months ago

@lawrenceccheung, thanks for the input. I noticed that there's no reg test for the height-varying body force; do you know of any one using that capability? I know that the meso-microscale coupling has inputs to change the forcing in a periodic simulation, but I'm trying to address the need for replicating the forcing from a periodic simulation in a subsequent inflow-outflow simulation. I like the concept of making the Body Force implementation as general as possible, but I'm not seeing a good way to harmonize a uniform, time-varying body force with the height-varying approach (because the first needs only 1 file, the second would have to use multiple files to vary in time as well), or harmonizing a time-varying body force that follows an analytical profile (sinusoidal) with one that follows a time table. That's why I think I'll keep these three as distinct options.

ewquon commented 2 months ago

For the MMC profile assimilation in practice, you would save the time- and height-varying body force from the precursor, and then you can re-apply those to be consistent with your saved boundary inflow data in the inflow-outflow simulation.

mbkuhn commented 2 months ago

I think it would be great to be able to save time- and space-varying forcing data to reapply in an inflow-outflow sim. However, I think that is beyond the scope of this PR because in the short term we still need to be able to save time-varying, uniform forcing data and be able to reapply it.

ewquon commented 2 months ago

Oh, I thought that already existed. We implemented that a long time ago in SOWFA and it even predates the MMC work.

mbkuhn commented 2 months ago

This is a helpful discussion, and it points to a need for having a more complete implementation in the future, one that uses time- and space-varying force data. However, for now, PR #1025 addresses the original impetus behind this issue, and it includes the ability to output ABLForcing as a uniform, time-varying vector, the ability to input BodyForce as a uniform, time-varying vector, and the ability to input the target velocity of Geostrophic forcing as a function of time. When a need arises for the combination of time- and space-varying, we will create a new issue.