-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #246 from FourierFlows/ncc/proper-dealias
Dealias `sol` before computing nonlinear terms
- Loading branch information
Showing
10 changed files
with
63 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Aliasing | ||
|
||
|
||
In pseudospectral methods, computing nonlinear terms results in aliasing errors. (Read more about | ||
aliasing errors in the [FourierFlows.jl Documentation](https://fourierflows.github.io/FourierFlowsDocumentation/stable/aliasing/).) To avoid aliasing errors, we need to apply some dealiasing to our fields | ||
in Fourier space before transforming to physical space to compute nonlinear terms. | ||
|
||
!!! info "De-aliasing scheme" | ||
FourierFlows.jl curently implements dealiasing by zeroing out the highest-`aliased_fraction` | ||
wavenumber components on a `grid`. By default in FourierFlows.jl, `aliased_fraction=1/3`. | ||
Users can construct a grid with different `aliased_fraction`, e.g., | ||
|
||
```julia | ||
julia> grid = OneDGrid(64, 2π, aliased_fraction=1/2) | ||
|
||
julia> OneDimensionalGrid | ||
├─────────── Device: CPU | ||
├──────── FloatType: Float64 | ||
├────────── size Lx: 6.283185307179586 | ||
├──── resolution nx: 64 | ||
├── grid spacing dx: 0.09817477042468103 | ||
├─────────── domain: x ∈ [-3.141592653589793, 3.0434178831651124] | ||
└─ aliased fraction: 0.5 | ||
``` | ||
|
||
Currently, all nonlinearities in all modules included in GeophysicalFlows.jl modules are quadratic | ||
nonlinearities. Therefore, the default `aliased_fraction` of 1/3 is appropriate. | ||
|
||
All modules apply de-aliasing by calling, e.g., `dealias!(prob.sol, prob.grid)` both before | ||
computing any nonlinear terms and also during updating all variable, i.e., within `updatevars!`. | ||
|
||
To disable de-aliasing you need to create a problem with a grid that has been constructed with | ||
the keyword `aliased_fraction=0`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bf62e73
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register
bf62e73
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request created: JuliaRegistries/General/38135
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via: