add tdc uq into HLLC#883
Conversation
Co-authored-by: Warrick Ball <W.H.Ball@bham.ac.uk>
| if (k < s% nz) then | ||
| TDC_eturb_cell_start = 0.5d0*(pow2(s% mlt_vc_old(k)/sqrt_2_div_3) + & | ||
| pow2(s% mlt_vc_old(k+1)/sqrt_2_div_3)) | ||
| TDC_eturb_cell = 0.5d0*(pow2(s% mlt_vc_ad(k)/sqrt_2_div_3) + & | ||
| pow2(shift_p1(s% mlt_vc_ad(k+1))/sqrt_2_div_3)) | ||
| else ! center cell averaged with 0 for inner face | ||
| TDC_eturb_cell_start = 0.5d0*pow2(s% mlt_vc_old(k)/sqrt_2_div_3) | ||
| TDC_eturb_cell = 0.5d0*pow2(s% mlt_vc(k)/sqrt_2_div_3) |
There was a problem hiding this comment.
I feel like there's some simple factorisation of the constants available here. We've got (√(3/2))² from the pow2 expressions and ½ out front, so is this not the same as
| if (k < s% nz) then | |
| TDC_eturb_cell_start = 0.5d0*(pow2(s% mlt_vc_old(k)/sqrt_2_div_3) + & | |
| pow2(s% mlt_vc_old(k+1)/sqrt_2_div_3)) | |
| TDC_eturb_cell = 0.5d0*(pow2(s% mlt_vc_ad(k)/sqrt_2_div_3) + & | |
| pow2(shift_p1(s% mlt_vc_ad(k+1))/sqrt_2_div_3)) | |
| else ! center cell averaged with 0 for inner face | |
| TDC_eturb_cell_start = 0.5d0*pow2(s% mlt_vc_old(k)/sqrt_2_div_3) | |
| TDC_eturb_cell = 0.5d0*pow2(s% mlt_vc(k)/sqrt_2_div_3) | |
| if (k < s% nz) then | |
| TDC_eturb_cell_start = 0.75d0*(pow2(s% mlt_vc_old(k)) + & | |
| pow2(s% mlt_vc_old(k+1))) | |
| TDC_eturb_cell = 0.75d0*(pow2(s% mlt_vc_ad(k)) + & | |
| pow2(shift_p1(s% mlt_vc_ad(k+1)))) | |
| else ! center cell averaged with 0 for inner face | |
| TDC_eturb_cell_start = 0.75d0*pow2(s% mlt_vc_old(k)) | |
| TDC_eturb_cell = 0.75d0*pow2(s% mlt_vc(k)) |
There was a problem hiding this comment.
Ahh yes, I didn't even consider reducing this. Good catch. (3/2) * (1/2) -> 3/4
| @@ -46,6 +46,15 @@ subroutine set_viscosity_vars_TDC(s, ierr) | |||
| ierr = 0 | |||
| op_err = 0 | |||
There was a problem hiding this comment.
Do we actually use op_err? It looks like both it and ierr and initialised as zero, then ierr is changed to match op_err whenever the latter is non-zero. But that seems the same as just using ierr instead of op_err.
|
This branch is more or less ready for merge. However, I'm not sure if maybe I should add a subroutine for calculating nonlinear work integrals. Might need to copy some utilites from the RSP functionality over? something like this: Lines 860 to 940 in c9e7dca |
Correctly includes tdc Uq into HLLC as a non-HSE source in the du/dt eqn, and fixes other bugs. Needs further polish before merge.