TurbulenceConvection.jl icon indicating copy to clipboard operation
TurbulenceConvection.jl copied to clipboard

Use correct field types for variables

Open charleskawczynski opened this issue 3 years ago • 3 comments

Currently, our field variables are all scalar types (e.g., Float64), but we need to change this, to be compatible with ClimaCore's API, to use

  • Contravariant12Vector for horizontal velocity components (u_h)
  • Contravariant3Vector for the vertical velocity component.
  • Covariant123Vector for , e.g., uvw vectors

This will also require changing the use of Divergence / Gradient operators throughout the code, and perhaps removing some use of unnecessary ClimaCore.Geometry.WVectors.

charleskawczynski avatar Feb 02 '22 18:02 charleskawczynski

probably with some helper functions to pull out the components you can change the underlying internal representation and not have to change too much in the source

the way we have to pull out components needs to be cleaned up in climacore so maybe we can add that functionality as part of this effort

jakebolewski avatar Feb 02 '22 18:02 jakebolewski

probably with some helper functions to pull out the components you can change the underlying internal representation and not have to change too much in the source

I was thinking a bit more about this. Won't we still need the full vector components for stencils? I'm not sure how the stencil's behavior change by changing these types. Will everything work the same if we just use scalars? If that is the case, then I agree that just writing some sort of wrapper to pull components out is easier. We can just change some of the wrapper calls.

charleskawczynski avatar Feb 04 '22 01:02 charleskawczynski

I think we would just Geometry.project() on the (Z) axis and then treat it as a scalar value vector component internal to TC? that way you could also normalize all the vectors into a WVector contribution, not sure how it's currently handled but I'm guessing this is the assumption.

jakebolewski avatar Feb 04 '22 01:02 jakebolewski