Skip to content

Inflow specified from file to enable turbulent inflow#84

Merged
eyoung55 merged 59 commits into
NatLabRockies:devfrom
brookeslawski:feature/turb_inflow
Sep 10, 2025
Merged

Inflow specified from file to enable turbulent inflow#84
eyoung55 merged 59 commits into
NatLabRockies:devfrom
brookeslawski:feature/turb_inflow

Conversation

@brookeslawski
Copy link
Copy Markdown
Collaborator

@brookeslawski brookeslawski commented May 1, 2025

This pull request enables the user to specify a file that defines the time-varying inflow boundary conditions. The primary purpose of this feature is to run PVade with turbulent inflow, but the functionality is general enough that users can specify any inflow data externally and then feed it in as inflow boundary conditions.

Note: You'll need to install h5py in your conda/mamba environment to be able to run this.

In this example, I use pyconturb to generate turbulent inflow data of shape (nt, ny, nz) where nt = number of timesteps, ny = number of gridpoints in the spanwise direction, and nz = number of gridpoints in the vertical direction. At each timestep, pvade selects the y-z slice of turbulent inflow for that timestep and applies it as inflow BCs.

This functionality only works for 3D simulations at the moment.

image

To do:

  • u_ref is still required, but could lead to errors if value differs from .h5 u_ref
  • test if t_final exceeds h5 file's duration
  • change ramp_window name and reconcile with time_varying_inflow input option
  • initialize flow field to be mean log law profile everywhere in domain except inlet
  • in a future PR, integrate the use of pyconturb directly in the code -> Issue Integrate pyconturb directly into PVade #86 has been created
  • add example to documentation using a small input file
  • test on HPC and add bash script to example
  • add to documentation (specified from file only works in 3D right now, what it is)
  • add / edit tests

brookeslawski and others added 30 commits April 16, 2025 09:19
…n and how array inputs are unrolled (x-major order)
…k all tables are laid out and tilted correctly
Comment thread input/panels3d.yaml
save_text_interval: .1 #0.01
save_xdmf_interval: .1 #0.01
fluid:
velocity_profile_type: uniform
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding for transparency so that user knows what kind of inflow is being applied in this example.

description: "If true, use the inflow boundary condition to interpolate a non-zero initial velocity throughout the domain (even if that does not respect interior boundary conditions), if false, initial velocity is zero."
time_varying_inflow_window:
description: "If true, use the inflow boundary condition to interpolate a non-zero initial velocity throughout the domain (even if that does not respect interior boundary conditions), if false, initial velocity is zero. If `velocity_profile_type` is `specified_from_file`, the velocity at each point is a time-averaged value of that gripoint's velocity data from the .h5 file."
ramp_window:
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing this variable name to ramp_window since time_varying_inflow_window is now confusing with the addition of the specified_from_file option that is also a time-varying inflow

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty sure this file isn't used, but added special treatment of u_ref for specified_from_file mode just in case

@brookeslawski brookeslawski marked this pull request as ready for review May 13, 2025 17:36
@brookeslawski
Copy link
Copy Markdown
Collaborator Author

Hmm, the tests are failing at the build conda environment step. They all pass locally, so I'm not sure what's going on.

@eyoung55
Copy link
Copy Markdown
Collaborator

eyoung55 commented May 14, 2025

Hmm, the tests are failing at the build conda environment step. They all pass locally, so I'm not sure what's going on.

got it, it seems to hang on #83 too in the same spot (so probably not related to h5py), will try to fix it there.

@eyoung55
Copy link
Copy Markdown
Collaborator

@arswalid @eyoung55 go through and review before friday!

Copy link
Copy Markdown
Collaborator

@eyoung55 eyoung55 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you for your patience! Tests are fixed and this is ready to merge.

@eyoung55 eyoung55 merged commit f177b8a into NatLabRockies:dev Sep 10, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants