-
Notifications
You must be signed in to change notification settings - Fork 194
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
Error using ScalarDiffusivity
where the viscosity or diffusivity are functions with parameters
#3840
Comments
ScalarDiffusivity
where the viscosity or diffusivity are functions with parametersScalarDiffusivity
where the viscosity or diffusivity are functions with parameters
Hmmm, I think the issue is that nothing happens with the Oceananigans.jl/src/TurbulenceClosures/turbulence_closure_utils.jl Lines 19 to 22 in fe056fb
|
Looks like it isn't actually supported. We'd need a |
Ah less a bug and more a feature request then. I can clarify what's supported in the docstring. Can always just use the discrete form. |
What's needed is something like struct ContinuousDiffusionFunction{F, P}
func :: F
parameters :: P
end
@inline (K::ContinuousDiffusionFunction)(x, y, z, t) = K.func(x, y, z, t, K.parameters)
@inline function convert_diffusivity(FT, κ; discrete_form=false, loc=(nothing, nothing, nothing), parameters=nothing)
if discrete_form
return DiscreteDiffusionFunction(κ; loc, parameters)
elseif isnothing(parameters)
return ContinuousDiffusionFunction(κ, parameters)
else
return κ
end
end I think anyways. reduced dimensionality grids may be different |
I guess to have a continuous diffusion function that has the same features of the discrete version (with field dependency and parameters), we could implement something very similar to the |
Pretty sure what I wrote will work. May need |
I believe the below MWE should work according to the
ScalarDiffusivity
docstring, but from the error it seems to be expectingfunky_diffusion(x, y, z, t)
instead offunky_diffusion(x, y, z, t, p)
.Oceananigans.jl/src/TurbulenceClosures/turbulence_closure_implementations/scalar_diffusivity.jl
Lines 12 to 67 in fe056fb
MWE:
Error:
The text was updated successfully, but these errors were encountered: