Fix: no power 1/3 in enstrophy norm

This commit is contained in:
Ian Jauslin 2023-09-19 11:51:55 -04:00
parent 7a0eb20452
commit d986f86243
2 changed files with 6 additions and 6 deletions

View File

@ -177,16 +177,16 @@ It can be made by specifying the parameter {\tt adaptive\_norm}.
\begin{equation}
\|f\|:=\frac1{\mathcal N}\sqrt{\sum_k k^2|f_k|^2}
,\quad
\mathcal N:=\left(\frac{\sqrt{\sum_k k^2|\hat u_k^{(n)}|^2}+\sqrt{\sum_k k^2|\hat U_k^{(n)}|^2}}{\sum_k k^2|\hat u_k^{(n)}|^2}\right)^{\frac13}
\mathcal N:=\frac{\sqrt{\sum_k k^2|\hat u_k^{(n)}|^2}+\sqrt{\sum_k k^2|\hat U_k^{(n)}|^2}}{\sum_k k^2|\hat u_k^{(n)}|^2}
.
\end{equation}
Doing so controls the error of the enstrophy through
\begin{equation}
\mathcal N^2|\mathcal En(\hat u)-\mathcal En(\hat U)|\equiv|\|\hat u\|^2-\|\hat U\|^2|\leqslant \|\hat u-\hat U\|(\|\hat u\|+\|\hat U\|)
\frac1{\mathcal N^2}|\mathcal En(\hat u)-\mathcal En(\hat U)|\equiv|\|\hat u\|^2-\|\hat U\|^2|\leqslant \|\hat u-\hat U\|(\|\hat u\|+\|\hat U\|)
\end{equation}
so
\begin{equation}
\mathcal N^2
\frac1{\mathcal N^2}
|\mathcal En(\hat u)-\mathcal En(\hat U)|\leqslant
\|\hat u-\hat U\|\frac1{\mathcal N}\left(\sqrt{\sum_k k^2|\hat u_k|^2}+\sqrt{\sum_k k^2|\hat U_k|^2}\right)
\end{equation}

View File

@ -820,7 +820,7 @@ int ns_step_rkf45(
}
}
err=sqrt(err);
relative=pow((sqrt(sumu)+sqrt(sumU))/sumu, 1./3);
relative=(sqrt(sumu)+sqrt(sumU))/sumu;
}
else{
fprintf(stderr,"bug: unknown norm: %u, contact ian.jauslin@rutgers.edu\n", adaptive_norm);
@ -966,7 +966,7 @@ int ns_step_rkbs32(
}
}
err=sqrt(err);
relative=pow((sqrt(sumu)+sqrt(sumU))/sumu, 1./3);
relative=(sqrt(sumu)+sqrt(sumU))/sumu;
}
else{
fprintf(stderr,"bug: unknown norm: %u, contact ian.jauslin@rutgers,edu\n", adaptive_norm);
@ -1143,7 +1143,7 @@ int ns_step_rkdp54(
}
}
err=sqrt(err);
relative=pow((sqrt(sumu)+sqrt(sumU))/sumu, 1./3);
relative=(sqrt(sumu)+sqrt(sumU))/sumu;
}
else{
fprintf(stderr,"bug: unknown norm: %u, contact ian.jauslin@rutgers,edu\n", adaptive_norm);