-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better organization of rotation-related and buoyancy-related constants and parameters #217
Comments
Greg, I think that rho_o belongs in the EOS. And we will have to run many
problems with anisotropic diffusion etc. So we should support from the
outset. John
…On Thu, May 9, 2019, 5:55 PM Gregory L. Wagner ***@***.***> wrote:
As discussed with @jm-c <https://github.com/jm-c>, the organization of
physical constants and parameters is somewhat confusing.
Currently, constants are stored in three places:
1. PlanetaryConstants, which stores a rotation rate, gravitational
acceleration, and a Coriolis parameter used in an f-plane approximation
2. ModelConfiguration, which stores anisotropic (potentially
turbulent) viscosities and diffusivities
3. EquationOfState, of which there is only one kind:
LinearEquationOfState, which stores both parameters associated with
the equation of state in addition to a reference density
I see a few problems:
- f is not a property of a planet.
- 'Model configuration' is an obscure name for turbulent or molecular
transport coefficients.
- A reference density is not a parameter in an equation of state.
I propose that we consolidate these three types into two, removing the
reference density from EquationOfState and define a new type containing
f, g, ρ0, ν, and κ.
I'm not sure what to call the new type. One possibility is FluidParameters
or PhysicalParameters or PhysicalConstants.
I also propose that we cease support for anisotropic transport
coefficients as parameters, defined generally, at least for the moment. We
can support constant anisotropic transport coefficients as a type of LES
closure in the future.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#217>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AKXUEQW3GJUNC2CYLVWD44TPUSMUVANCNFSM4HL6JVQA>
.
|
Thanks for bringing these up! This stuff certainly needs some work, and we should probably make it clear what's e.g. a free parameter.
Agreed. Perhaps now that we're also thinking of channel models on a β-plane, we should also build a "rotation" abstraction to choose between f-plane, β-plane, and Coriolis force (possible with cosine term).
Yes. This should be addressed by incorporating a
Sounds like this issue is worth discussing and strategizing about. We could maybe get some ideas and inspiration from how CliMA.jl is handling parameters? |
I support a Do you think that we should not have the concept of a molecular transport coefficient at all? I feel we should have something like My comment about the reference density was actually my attempt to channel @jm-c and I think I mangled it. The point is that density is not a variable in a Boussinesq code and the value of the reference density has no effect on the dynamics. Buoyancy is the Boussinesq variable. It gets confusing when you add nonlinear equations of state, because you will still need to store a reference density somewhere in order to calculate boundary fluxes of temperature and velocity associated with, for example, heat fluxes and momentum fluxes. For that reason it makes sense to divorce the reference density from the equation of state and consider it separately. As long as you have a Boussinesq code you will not need to calculate density. You'll get to this point in a hurry if you try to implement nonlinear equations of state for your Europa simulation. Maybe @jm-c can weigh in so we can get these thoughts from the source. |
Ah I should have been clearer. For the Cartesian domains we might want
I think it makes sense to have this, especially so that the default is a DNS. Not sure if this is the most common use case, in which case maybe we can spit out a warning to new users so they know what they're running.
This makes sense to me, but then I'm wondering if ρ₀ is important to know to calculate diagnostics etc. where should we store it? EOS makes the most sense to me as a storage place even though it doesn't influence the dynamics. |
I'm not sure what you mean by For the sphere, a different abstraction for I think if this code is successful, DNS will be a common use case. There are no julia DNS CFD codes, and the are very few GPU DNS codes in general.
This is the question. If the EOS actually calculates buoyancy rather than density, I feel that it is an error to associate ρ₀ with the EOS. Including ρ₀ in the EOS contributes to the misconception that density is a variable in the code, which it is not. |
After talking a bit with @ali-ramadhan, I think we might have settled on the following solution:
These changes will also require us to compute buoyancy rather than a density perturbation, and may motivate us to simplify the code by defining variables in |
This is partially solved by #234 and #245. We still may want to introduce a new type for rotation. I was thinking that |
My latest thoughts: We design a rotation functionality that resembles what we do for turbulence closures. The types could look something like abstract type AbstractRotation end
struct FPlane{T} <: AbstractRotation
f :: T
end
struct BetaPlane{T} <: AbstractRotation
f0 :: T
β :: T
end
struct TiltedFPlane{T} <: AbstractRotation
fz :: T
fy :: T
end These types would then be associated with functions that add the associated terms to the @inline x_f_cross_U(i, j, k, grid, rotation::FPlane, U) = -fv(i, j, k, grid, rotation.f, U.v)
@inline y_f_cross_U(i, j, k, grid, rotation::FPlane, U) = fu(i, j, k, grid, rotation.f, U.u)
@inline z_f_cross_U(i, j, k, grid::Grid{T}, rotation::FPlane, U) where T = zero(T) I propose we add the field |
As discussed with @jm-c, the organization of physical constants and parameters is somewhat confusing.
Currently, constants are stored in three places:
PlanetaryConstants
, which stores a rotation rate, gravitational acceleration, and a Coriolis parameter used in an f-plane approximationModelConfiguration
, which stores anisotropic (potentially turbulent) viscosities and diffusivitiesEquationOfState
, of which there is only one kind:LinearEquationOfState
, which stores both parameters associated with the equation of state in addition to a reference densityI see a few problems:
f
is not a property of a planet.I propose that we consolidate these three types into two, removing the reference density from
EquationOfState
and define a new type containing f, g, ρ0, ν, and κ.I'm not sure what to call the new type. One possibility is
FluidParameters
orPhysicalParameters
orPhysicalConstants
.I also propose that we cease support for anisotropic transport coefficients as parameters, defined generally, at least for the moment. We can support constant anisotropic transport coefficients as a type of LES closure in the future.
The text was updated successfully, but these errors were encountered: