underworldcode / UWGeodynamics

Underworld Geodynamics
Other
81 stars 32 forks source link

Question about variable storage #140

Closed LukeMondy closed 5 years ago

LukeMondy commented 5 years ago

Hello,

I just had a question about where particular variables are stored. In the model outputs I get, strainRate and the projStressField are put on to the submesh, e.g.,: https://github.com/underworldcode/UWGeodynamics/blob/79fe65eb26f48da91c9fa661c7fa778a351d7aa0/UWGeodynamics/_model.py#L179

Is there a particular reason for this? I thought since both of these (or at least strainRate) are derived from the normal mesh, where the velocity is stored, it would be more natural(?) to store them there too.

Just a curiosity question!

Thanks, Luke

rbeucher commented 5 years ago

Hi @LukeMondy ,

Well, the strain-rate is derived from the velocity dV/dt, so it makes sense to put it on the submesh... But that assumes a Q1/dQ0 element type. Technically I could store it on the mesh.

julesghub commented 5 years ago

"Strain rate" is a tensor, made of spatial gradients of velocity.

Velocity is a Q1 field in this case. Gradients of it are best taken at internal points within each element, thus the submesh "dQ0" is used as the locations for gradient evaluation.

UWGeo's "strainRateField" is the 2nd invariant of the strain rate tensor and it's calculated and stored where the tensor is evaluated. Hence it's on the submesh.

dQ0 fields can be "projected" onto the Q1 mesh but that will incur a smoothing effect that may be undesirable.

Hope this helps.

LukeMondy commented 5 years ago

Yep, makes sense! I think UW1 used to store the SRI on the velocity mesh, so I was getting confused.