-
Notifications
You must be signed in to change notification settings - Fork 2
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 #42 from chowland/time-averaging
Add on-the-fly time averaging for 3D fields and energy spectra
- Loading branch information
Showing
32 changed files
with
656 additions
and
69 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"source_dirs": ["src/**"], | ||
"excl_paths": ["src/old/**", "tools/**"], | ||
"include_dirs": ["obj/**"] | ||
} |
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,23 @@ | ||
# Power spectra and time-averaging | ||
|
||
## Spectrum calculation (`afid_spectra`) | ||
|
||
The module [`afid_spectra`](https://github.com/chowland/AFiD-MuRPhFi/blob/main/src/spectra.F90) is used to compute and store power spectra from the simulation fields. | ||
Since the computation of two-dimensional Fourier transforms involves the expensive operation of transposing the global 3-D arrays, spectra are not calculated by default. | ||
This option is activated by including a file `spectra.in` in the simulation directory that specifies the time from which spectra should be calculated. | ||
|
||
Fourier transforms are performed in the `y` and `z` directions in `CalcFourierCoef` to produce the discretized equivalent of the three-dimensional array | ||
|
||
$$ | ||
\hat{f}(x,k_y, k_z) = \iint f(x,y,z) e^{-i (k_y y + k_z z)} \,\mathrm{d}y \,\mathrm{d}z | ||
$$ | ||
|
||
Currently, the power spectra $\Phi_{ff}=|\hat{f}|^2$ of the three velocity components `vx`, `vy`, `vz` and temperature `temp` are computed and stored along with the co-spectrum $\Phi_{u\theta}=\hat{S}^* \hat{u}$ of the wall-normal concentration flux. | ||
Each spectrum is computed at each time step and integrated in time to provide a final time-averaged three-dimensional spectrum that is written to `outputdir` by `WriteSpectra`. | ||
|
||
## Time-averaged fields (`afid_averaging`) | ||
|
||
A similar procedure is followed by the module `afid_averaging` to provide three-dimensional fields of time-averaged variables. | ||
The same input file `spectra.in` is needed to activate this operation, and the averaging occurs from the time specified in the input file. | ||
The subroutine `UpdateTemporalAverages` integrates the four basic variables in time at each time step to construct the temporal averages. | ||
The time-averaged fields are eventually written to `outputdir/fields/xx_mean.h5`. |
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 |
---|---|---|
@@ -1,3 +1,2 @@ | ||
0.00132 0.01321 0.04028 0.012731165 0.5 | ||
! This file contains 5 values of wall-normal | ||
! position from which to generate 1D spectra | ||
! Sim time at which to start averaging | ||
100.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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,4 +59,5 @@ nav: | |
# - 'buoyancy.md' | ||
- 'interpolation.md' | ||
- 'stretched_grids.md' | ||
- 'ibm.md' | ||
- 'ibm.md' | ||
- 'spectra.md' |
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
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
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
Oops, something went wrong.