Exawind / amr-wind

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

Turbulent viscosity Smagorinsky in multiphase #987

Closed tonyinme closed 5 months ago

tonyinme commented 7 months ago

When conducting wave simulations in AMR-Wind involving sea surface interactions, the viscosity near the interaction region can exhibit unusually high values. This phenomenon arises from the Volume of Fluid (VOF) method, where viscosity is multiplied by density. Given that water density is approximately 1000 times that of air, this multiplication significantly amplifies the turbulent viscosity. Simulations of ABL + waves with the Smagorinsky model do not work because the high values of viscosity require too small a time-step, and the simulation becomes unstable and crashes.

The main challenge comes from separating the two phases for density and viscosity but using the gradients of the entire flow field. In the case of volume fractions between 0 and 1, the gradients of the flow will be dominated by the fastest moving flow (the air). The high gradients will create an artificially high turbulent viscosity that will get multiplied by the artificially high turbulent viscosity. For this reason, it makes more sense to only use the turbulent viscosity for air whenever the volume fraction is less than one. This will ensure that the turbulent viscosity will not be artificially higher when there is water in the cell.

This code is one of the ideas I have to mitigate this problem. It involves finding the minimum density in the flow and assigning it whenever the volume fraction is less than one.

I am looking to start a conversation around solving this issue and we can come up with other approaches as well.

mbkuhn commented 7 months ago

The high gradients will create an artificially high turbulent viscosity that will get multiplied by the artificially high turbulent viscosity.

For the record, this should say "The high gradients will create an artificially high turbulent [kinematic] viscosity (due to the presence of air in current and nearby cells) that will get multiplied by the artificially high density (due to the presence of water in the current cell)."

mbkuhn commented 7 months ago

Even though this approach is nice because it doesn't require references to other parts of the code, it seems like overkill to do a global operation, like the minimum, especially because it does it every time. Here are some other thoughts that may work via a different implementation.

  1. reference MultiPhase physics to get the air density upon initialization (sim is available when initializing). Then use this as the minimum density as you have it.
  2. reference MultiPhase physics to get the air density and water density. Then use a harmonic average instead of an arithmetic one to calculate the density that will be multiplied. 1/rho = vof/rho_liquid + (1-vof)/rho_gas.
  3. instead of using the local density, average the density over the strainrate stencil (requires no additional references). This could be with an arithmetic average or a harmonic one (though we may need to do a harmonic average to get the desired effect). This could be turned on via a switch detecting the vof variable, though it would have no effect on constant density simulations.

Thoughts?

tonyinme commented 7 months ago

We have tried a few different strategies to mitigate the high turbulent viscosities. We tried the harmonic averaging, but that still had a few cells with too high of a viscosity.

The latest version uses only the air density whenever there is air (vor<1) and the gradient of vof is 0. This approach ensures that the gradients of velocity in the cell will not be affected by the higher gradients from nearby cells.

@mbkuhn , let me know what further improvements we can make to this approach.

hgopalan commented 6 months ago

You can also check for the sum of shear production and buoyancy production due to density. If the sum is negative you can set turbulent viscosity to zero. RANS models add this extra production term to drive turbulent viscosity to zero near the interface.

WRF uses a similar approach with the Smagorinsky model and uses the Brunt–Vasala frequency to turn off turbulent viscosity for certain stable conditions.

Buoyancy production reference: https://www.sciencedirect.com/science/article/pii/S0378383917302107

github-actions[bot] commented 5 months ago

This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] commented 5 months ago

This PR was closed because it has been stalled for 7 days with no activity.