Closed sbidadi9 closed 1 year ago
I've been digging into the implementation of SST in AMR-Wind and I have some questions/notes. I am going to document them here and hopefully someone else can verify my thinking. I am going to refer to https://turbmodels.larc.nasa.gov/sst.html notation and the SST-2003 model since that is what is implemented in Nalu-Wind.
fvm::strainrate
computes $S = \sqrt{2 S{ij} S{ij}}$ and that gets stored in tmp4
. tmp4
is then used in the denominator for mu_arr
, multiplied by f2
. This is all consistent with SST-2003. And then because this is an incompressible code, we make the assumption $P=\mu_t S^2$. All good.sdr_src_arr(i, j, k) = rho_arr(i, j, k) * alpha * tmp4 * tmp4 + ...
is missing a division by mut
and shouldn't be using tmp4
but the limited P
. I think this is due to the fact that the code was based on the paper and there is a typo in the paper. So the code here is the correct version for sdr_src_arr
.sdr_lhs_arr = 0.5 * rho_arr(i, j, k) * beta * sdr_arr(i, j, k) * deltaT;
. In nalu-wind, we do lhs(0, 0) += (2.0 * beta * density * sdr + stk::math::max(Sw / sdr, 0.0)) * dVol;
. So in that sense amr-wind is missing the second term. Though maybe I don't understand the LHS in amr-wind...Hi Marc and Shreyas! Thanks for documenting, and I think this makes sense. One thing though....what's the rationale for adding a zero limiter on the $\mu_t S^2$ term? Which can only be negative if $\mu_t$ is negative? And there is no such protection on the other term in the min for $\tilde{P}$? That's not there in any of the models or corrections that I can see? Even though we expect the production term to be positive, I think forcing it to be positive might just make the equation system less flexible?
Hi Nate, I think Shreyas was just mimicking Nalu-Wind for the "zero limiter on the $\mu_t S^2$ term": https://github.com/Exawind/nalu-wind/blob/master/src/node_kernels/SDRSSTNodeKernel.C#L105. All the terms in that $\tilde{P}$ should be >0 by construction... So I am not sure how much that matters. I think that's less important than using the $\tilde{P}$ in the SDR source (`sdr_src_arr) (which that code fixes). Am I making sense?
Update on this: SUST seems to be helping. I am running everything out but the 20m/s is at 10k + steps (used to crash at 4k)
That's awesome! Yeah, what you said makes sense, I haven't worked through the terms enough to know if it is impossible to end up with a negative mu_t (i.e. given some choice initial conditions) or just highly unlikely. Even though it probably does nothing, I think I'd still advocate removing it from both codes for consistency with the literature though.
Another question...for the case you're running how are you handling wall distance? Constant value? Or with a physics that returns actual values?
amr-wind doesn't do wall distance I believe so it's a constant value. And the assumption is that the switch doesn't matter in the amr-wind region because it happens in nalu-wind. I have no idea if that's a good assumption but it's probably reasonable.
Yeah, we coded it into the channel flow physics where it definitely matters, but for abl type flows I think you may be right. I can go back and look at what we did for TCF...but I'm not sure we ever verified that.
Discussion with @sbidadi9 : The sdr equation also diverges for the channel_kwsst reg tests!!
This issue is stale because it has been open 30 days with no activity.
The cases diverge when production term of SDR equation is limited. The limiting of the production term is necessary to make the AMR-Wind SDR equation consistent with Nalu-Wind implementation.
More information can be found below: https://github.com/gantech/nrelvi_debug