Conversation
…ted to false for wedge elements
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #640 +/- ##
==========================================
- Coverage 73.08% 72.91% -0.18%
==========================================
Files 268 273 +5
Lines 40270 40176 -94
Branches 6738 6727 -11
==========================================
- Hits 29433 29295 -138
- Misses 10594 10659 +65
+ Partials 243 222 -21 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@dseyler the viscous stress performance improvements look good, but why is the wedge element shape function included in this PR? Also, is it possible to add a wedge element test case? |
@aabrown100-git Maybe I should have opened a 2nd PR for that, but it's just a one-line change that @ktbolt noted was mistranslated from Fortran. The connection between the two PRs is that the viscosity model now only computes once for the first gauss point of each linear element as the viscosity arrays are the same for all Gauss points in the element. This would have given incorrect results for wedge elements which had the wrong Definitely a good idea to add some wedge element test cases in the future, as there are currently none. Do you know of anyone working with them? |
|
I thought @msbazzi was working with them? If you can come up with a test case, I would create a new PR with your bug fix and a test case. |
|
A user on the SV Forum just sent me a mesh that uses wedges for the boundary layer. svMultiPhysics fails reading the mesh though; I will investigate. |
|
@aabrown100-git @ktbolt Are you suggesting creating a wedge element test case to add to this PR, or reverting the bug fix and pushing this PR through without it, which would cause the viscosity model to produce incorrect results for wedge elements (as 30 other places in the codebase already do)? I haven't worked with wedge elements before, so would defer to someone else if they already have a good wedge element case to add |
|
@dseyler Go ahead and merge this PR. I will create a separate Issue for adding a wedge element CI test and for fixing the problem reading in wedges if it is indeed a bug and not something wrong with the user's file. |
|
@aabrown100-git @dseyler Note that you can created wedges using |
|
@aabrown100-git The new "CFD mesh generator" module in VMTK Slicer extension can generate wedges as boundary layers (with multiple iterations of extrusion, smoothing, detangling). This can be useful if you want to test on complex, realistic meshes. |
…created eigen view helper
…me Eigen expressions
|
Addressing comments here and the many changes that have been made to the branch:
A few more notes:
|
|
General question, when building the solver and running the Eigen Matrices and Tensors are you compiling with the |
|
It would be nice if the |
I was not. But it looks like Apple Silicon vectorizes with Eigen by default with ARM NEON. Is there a reason why this isn't the default on Sherlock though? |
Sounds good. A lot of the templates were previously on |
It seems like someone made a note of this at some point Line 48 in c9838bd In general, I'd suspect that the |
So long as any arithmetic is properly guarded for underflow then yes I believe that |
Current situation
Address issues #633 and #634, which involve templating viscosity models on
nsdand skipping unnecessary computation when shape function gradients are constant across an element. These changes reduce assembly runtime by ~30% and fix a bug where shape function gradients were assumed to be uniform within wedge elements.Release Notes
compute_visc_stress_potentialare now templated onnsdinmat_models.cppcompute_visc_stress_and_tangentdispatches to templated models bynsdmat_symmandmat_devare alsonsdtemplated inmat_fun.hSvis,Kvis_u, andKvis_vare allocated outside of the Gauss point loop, written over for each Gauss point, and only zeroed when no viscosity model is defined for an element (sv_struct.cpp, ustruct.cpp, fsi.cpp) or when viscosity arrays can be reused.recompute_viscflag is added to indicate when viscosity computation can be skipped (shape function gradient are uniform for all Gauss points within an element, soKvis_u,Kvis_v, andSvisvalues can be reused).compute_visc_stress_and_tangentskips viscosity computation whenrecompute_visc == Falsecompute_visc_stress_and_tangentso viscosity arrays are zeroed and do not carry the previous element's values when an element doesn't have a viscosity model definedstruct_2d,struct_3d,ustruct_2d_m,ustruct_3d_mnow require four new arguments:Svis,Kvis_u,Kvis_v, andrecompute_visccompute_visc_stress_and_tangentnow takesrecompute_visclShpFshould be False for wedge elements.Testing
All test cases pass. Eigen operations were verified in isolation to be within machine precision of the operations they replaced.
Code of Conduct & Contributing Guidelines