-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Turbulent inflow generation logic patch (#1695)
* Generalized size of boxes. Start implementing CPB. Still need user input + .rst documentation * Added my own folder in Exec, ABL_perturbation_inflow * Generalized BPM so it can transform into CPM. Added more user input variables. Renamed BPM and CPM tags to source and direct to keep neutrality. Need to add Ec, tp, and cell_data equations for direction add. * manually got rid of tabs * added in calc_tpi_meanMag_firstCell() function and direct field add within TimeIntegration/ERF_Advance.cpp for CPM cases. Need to implement options to swap back and forth on use side between BPM and CPM. Switch gear and start runtime optimization. * amr.v=0 helps with runtime. Added random numbers for PB_intervals. Added outputs for PB_amplitude/PB_updateTime in seperate file when erf.v=1. Need to find a good way to generalize amplitude. Currently breaks code when amplitude is too large. CONTINUE with CPM debug, fast_rhs_fun debug with PB, and documentation with .rst file. * Fixed CUDA private member issue. CONTINUE with CPM debug, fast_rhs_fun debug with PB, and documentation with .rst file * Added output format into file + verbose tags. Fixed parallel issue of boxes. Added in perturbation inflow .rst documents. CONTINUE with CPM debug, fast_rhs_fun debug with PB. * Added output format into file + verbose tags. Fixed parallel issue of boxes. Added in perturbation inflow .rst documents. CONTINUE with CPM debug, fast_rhs_fun debug with PB. * Get rid of trailing white space. Added output format into file + verbose tags. Fixed parallel issue of boxes. Added in perturbation inflow .rst documents. CONTINUE with CPM debug, fast_rhs_fun debug with PB. * update DOI links for build-and-deploy fail test. * 404 Client Error: Not Found for url error fix. * 404 Client Error: Not Found for url error fix. * 404 Client Error: Not Found for url error fix. * Error 403 with Munoz-Esparza 2015 paper. Last attempt * Added in perturbation inflow .rst documents. CONTINUE with pb tests. Currently blows up after 1st update interval. * fix for doc push * manual rerun for DOI link in docs * link replacement for syntax error * manual check for munoz link * what is going on with these links? * using link I know that works * testing DeLeon link * DeLeon: maybe it's a syntax error? * DeLeon: Trying the other way of linking * maybe special character problem? * commented out links to DeLeon et al. (2018), and Munoz-Esparza et al. (2015). DOI links return Erorror 403, actual link returns Error 404. * testing perturbation inflow method, qualitativly for now * Added trigger tags for PBM in ERF.cpp. This should fix compile error in workflow. * Document update * resolved erroneous error with pseduo gravity (ignores scales with mechancial perturbation) * resolved erroneous error with pseduo gravity (ignores scales with mechancial perturbation) * updating PR * fixing codespell * corrected math mode in .rst file * modifying test files * got rid of some weird merge conflict HEAD that remained * Should not be using sounding with incompressible flow, as it is a compressible flow algorithm. * fix to input tag * reworked apply_tpi() logic so it is now a per cell within PB assignment. Random assignment happens at the calc_tpi_update() level * white space fix * fixed unsed variable error for CI tests * changed input file. modified python file to generate ReTau180, and generate dirichlet input file. Added more description into documentation. * init perturbation in initialization to see if turbulence is sustained * Box perturbation method working with incompressible solver. * fixed codespell * fixed white space --------- Co-authored-by: Ting-Hsuan (Dustin) Ma <[email protected]>
- Loading branch information
1 parent
34b469b
commit c011b2e
Showing
21 changed files
with
251 additions
and
1,012 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
49 changes: 49 additions & 0 deletions
49
Exec/DevTests/ABL_perturbation_inflow/generateLogLawProfile.py
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,49 @@ | ||
import numpy as np | ||
|
||
# Given parameters | ||
Re_tau = 395 | ||
kinematic_viscosity = 0.001 | ||
height_start = 1e-2 | ||
height_end = 10 | ||
#height_end = 1.0 | ||
num_points = 256 | ||
kappa = 0.41 # Von Kármán constant | ||
B = 5.2 | ||
|
||
# Calculate friction velocity (u_tau) based on Re_tau, kinematic viscosity, and height_end | ||
u_tau = (Re_tau * kinematic_viscosity) / height_end | ||
print(f"u_tau = {u_tau}") | ||
|
||
# Generate heights (y) | ||
heights = np.linspace(height_start, height_end, num_points) | ||
|
||
# Calculate u values using smooth wall log law of the wall formula | ||
u = u_tau * (1. / kappa * np.log(heights * u_tau / kinematic_viscosity) + B) | ||
print(f"u = {u}") | ||
|
||
# Create v values (set all v values to 0) | ||
v = np.zeros_like(heights) | ||
w = np.zeros_like(heights) | ||
mixing_ratio = np.zeros_like(heights) | ||
potential_temp = np.full_like(heights, 300.0) | ||
|
||
# Prepare data to write to file | ||
data_sounding = np.column_stack((heights, potential_temp, mixing_ratio, u, v)) | ||
data_sponge = np.column_stack((heights, u, v)) | ||
data_inflow = np.column_stack((heights, u, v, w)) | ||
|
||
# Add the initial rows | ||
data_sounding = np.vstack([[0.0, 300.0, 0.0, 0.0, 0.0], data_sounding]) | ||
data_sponge = np.vstack([[0.0, 0.0, 0.0], data_sponge]) | ||
data_inflow = np.vstack([[0.0, 0.0, 0.0, 0.0], data_inflow]) | ||
|
||
# Save data to file | ||
filename = f"input_ReTau{Re_tau}Ana" | ||
filetype = ".txt" | ||
|
||
np.savetxt(filename + "_sounding" + filetype, data_sounding, fmt="%.8e", delimiter=' ') | ||
print(f"Data saved to {filename}_sounding{filetype}.") | ||
np.savetxt(filename + "_sponge" + filetype, data_sponge, fmt="%.8e", delimiter=' ') | ||
print(f"Data saved to {filename}_sponge{filetype}.") | ||
np.savetxt(filename + "_inflow" + filetype, data_inflow, fmt="%.8e", delimiter=' ') | ||
print(f"Data saved to {filename}_inflow{filetype}.") |
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
34 changes: 0 additions & 34 deletions
34
Exec/DevTests/ABL_perturbation_inflow/input_ReTau2000Ana_sounding.txt
This file was deleted.
Oops, something went wrong.
33 changes: 0 additions & 33 deletions
33
Exec/DevTests/ABL_perturbation_inflow/input_ReTau2000Ana_sponge.txt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.