Closed glwagner closed 5 years ago
I've started down the road toward figuring this out. The first step is to develop a model class which implements an 'arbitrary background flow' functionality. I've put this here:
https://github.com/glwagner/dedaLES/blob/ArbitraryBackgrounds/dedaLES/navier_stokes.py
Notice that this branch implements a number of breaking changes. I think we should work from this branch for now on.
I'm not sure the method used in navier_stokes.py
actually works in dedalus. For example, can we write dx(ub)
when ub
is not a variable of the problem, but some function instead?
If not, this interface would have to change. In particular, we may have to ask the user to supply ubx = dx(ub)
... ?
For steady background flows, we can possibly create a field and numerically differentiate it to supply the same functionality. If the field is unsteady, on the other hand, we need to be more clever / ask the user to specify the derivatives of the background field. Asking the user to specify these fields is a feasible solution, but it'd be nice if we could implement something more elegant.
Dedalus gurus, please advise! (I can also simply check to see if this works, but I'm running out of time today).
If we can indeed write dx(ub)
, our job is pretty simple.
If the problem solves for a flow perturbation around a background field --- for example, if we solve for
u
, where the total flow field isU = u + u_background
--- we may want the closure to act on the 'full' velocity fieldU
rather than justu
.There are two ways to do this perhaps. One is to write the equations in terms of a non-
u
variable (u_prime
, for example), and then to introduce a substitution:Another way is to allow the closure to accept keyword arguments; for example, changing the
ConstantSmagorinsky
definition toThe strain substitution, for example, would then be
Or something like that...
What is the best way to implement this functionality?