From 62a8e0085a46fcd638a4038a8a25edc7e0028f8d Mon Sep 17 00:00:00 2001 From: Amaury Bilocq <amaurybilocq@mac.home> Date: Fri, 21 Feb 2025 23:56:50 +0100 Subject: [PATCH] Add usage to readme.md --- README.md | 21 ++++++++++++++++++--- example.py | 4 ++-- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 68283fc..0133d8f 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ pyTurbulence is a Python package for generating synthetic compressible turbulent fields for Direct Numerical Simulation (DNS) based on the method of Ristorcelli and Blaisdell. This package provides tools to generate velocity, pressure, and thermodynamic fields, as well as to compute and plot the energy spectrum of the generated turbulence. TODO: - - add dilatational velocity fluctuations +- Add dilatational velocity fluctuations ## Features @@ -16,7 +16,22 @@ TODO: To install the package, navigate to the root directory of the project and run: -''' pip install . ''' +```sh +pip install . +``` + +## Usage + +To use the code from the `example.py` script, follow these steps: + +1. **Navigate to the Project Directory**: Open a terminal and navigate to the root directory of the project. +2. **Run the Example Script**: Execute the `example.py` script to generate synthetic turbulence data and save the results. + + ```sh + python pyTurbulence/example.py + ``` + +3. **View the Results**: The results will be saved in the `results` directory. This includes the generated data files (`u.dat`, `v.dat`, `w.dat`, `p.dat`, `T.dat`), a log file (`log.txt`), and a plot of the energy spectrum (`spectrum.png`). ## License @@ -26,6 +41,6 @@ This project is licensed under the MIT License. See the LICENSE file for details - Ristorcelli, J. R., & Blaisdell, G. A. (1997). Consistent initial conditions for the DNS of compressible turbulence. Journal of Computational Physics, 140(2), 427-466. - Sagaut, P. (2018). Homogeneous Turbulence Dynamics. Springer. -- Tony Saad, Derek Cline, Rob Stoll, and James C. Sutherland. “Scalable Tools for Generating Synthetic Isotropic Turbulence with Arbitrary Spectraâ€. ,http://dx.doi.org/10.2514/1.J055230. (available online: Aug 25, 2016). +- Tony Saad, Derek Cline, Rob Stoll, and James C. Sutherland. “Scalable Tools for Generating Synthetic Isotropic Turbulence with Arbitrary Spectraâ€. http://dx.doi.org/10.2514/1.J055230. (available online: Aug 25, 2016). - Saad, T., & Sutherland, J. C. (2016). Comment on “Diffusion by a random velocity field†[Phys. Fluids 13, 22 (1970)]. Physics of Fluids (1994-Present), 28(11), 119101. https://doi.org/10.1063/1.4968528. - Austin Richards, Tony Saad, and James C. Sutherland. “A Fast Turbulence Generator using Graphics Processing Unitsâ€, 2018 Fluid Dynamics Conference, AIAA AVIATION Forum, (AIAA 2018-3559). https://doi.org/10.2514/6.2018-3559. \ No newline at end of file diff --git a/example.py b/example.py index 703ef9f..ae55009 100644 --- a/example.py +++ b/example.py @@ -11,11 +11,11 @@ def main(): # Parameters params = { - "nbModes": 256, + "nbModes": 512, "Mt": 0.23, "Pressure": 1.0, "Temperature": 1.0, - "k0": 8.0, + "k0": 12.0, "domain_size": (2. * np.pi, 2. * np.pi, 2. * np.pi), "domain_resolution": (64, 64, 64), "seed": 42, -- GitLab