Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
5c62d11
working version of standalone script
brookeslawski Apr 16, 2025
95a1a79
integrating specified_from_file option into velocity BCs
brookeslawski Apr 21, 2025
c7ae6f1
correct mask for inlet bc and making vel prof type explicit in panels3d
brookeslawski Apr 25, 2025
3942e7c
creating test input file with linear vel profile
brookeslawski Apr 25, 2025
3081138
update input schema to allow array inputs for tracker_angle
eyoung55 Mar 27, 2025
fb651e3
revert mistakenly pushed test_parameters file
eyoung55 Apr 16, 2025
edd37e7
add special treatment for CLI options with multiple types (number or …
eyoung55 Apr 16, 2025
c3188df
restructure how edges are found in 2d, change rotation to be about tr…
eyoung55 Apr 16, 2025
8d8e7e8
check for the tilt angle of the leading edge if multiple angles are p…
eyoung55 Apr 16, 2025
c86dd33
change path to import simparams
eyoung55 Apr 16, 2025
29cd96d
remove exit
eyoung55 Apr 16, 2025
4c802ce
upgrade to black 25.1 and fix files
eyoung55 Apr 16, 2025
2111c82
remove print statement
eyoung55 Apr 16, 2025
7d85b24
fix bug about rotation being applied after translation, change bbox i…
eyoung55 Apr 16, 2025
d5a7182
dump the complete input dictionary to file before starting the solve
eyoung55 Apr 16, 2025
bdf2e38
re add missing single_row input file
eyoung55 Apr 16, 2025
c824f76
updating default values
eyoung55 Apr 16, 2025
26b45b3
update micromamba version
eyoung55 Apr 16, 2025
26e2d2e
updating deprecated time_varying_inflow_bc to time_varying_inflow_window
eyoung55 Apr 16, 2025
addd8d3
only print from rank 0
eyoung55 Apr 16, 2025
53d3361
changing solver options from 4 to 5 to skip the temperature solve spec
eyoung55 Apr 16, 2025
13ebb8d
add generate-run-shell: false to workflow
eyoung55 Apr 17, 2025
600e43f
try miniconda which should be as fast as mamba now
eyoung55 Apr 17, 2025
776b656
adding info to description of tracker_angle to explain sign conventio…
eyoung55 Apr 18, 2025
522e6a6
assert that length of tracker_angle vector matches number of tables
eyoung55 Apr 18, 2025
346de1d
rename input file, clean up formatting
eyoung55 Apr 18, 2025
9fe12a9
adding a new test for different wind directions, array sizes, to chec…
eyoung55 Apr 18, 2025
7b14a01
working version, but flow explodes at high wind speeds and dt 0.05
brookeslawski May 1, 2025
29595cc
smaller dt to avoid explosion
brookeslawski May 2, 2025
53286b0
reconciling ramp_window with duration of input inflow file
brookeslawski May 7, 2025
d8de4f9
replaced u_ref with calculated u_ref from input file
brookeslawski May 8, 2025
ac59a6e
handling when t_final exceeds inflow input file duration
brookeslawski May 8, 2025
8beab80
adding example to documentation, unfinished
brookeslawski May 8, 2025
b972875
initialize flow with mean profile from turb data in file
brookeslawski May 9, 2025
886243e
adding notebook for generating h5 turbulence file using pyconturb
brookeslawski May 12, 2025
ecde75e
minor change
brookeslawski May 12, 2025
96b9159
removing unnecessary files
brookeslawski May 13, 2025
68c41d1
removing more unnecesssary files
brookeslawski May 13, 2025
3df80bb
Merge branch 'dev' into feature/turb_inflow
eyoung55 May 13, 2025
9583121
updating ramp_window variable name in all input files
brookeslawski May 13, 2025
07d1174
added input .h5 file
brookeslawski May 13, 2025
06d3f46
using calculated u_ref insead of input file u_ref when specified_from…
brookeslawski May 13, 2025
fb78507
adding to example and black formatting
brookeslawski May 13, 2025
e1a0049
updating docs
brookeslawski May 13, 2025
a224850
docs formatting
brookeslawski May 13, 2025
1097224
updating environment.yaml
brookeslawski May 13, 2025
5f41a44
adding environment yaml file for hpc
brookeslawski May 13, 2025
312bcb4
doc updates from running on hpc
brookeslawski May 13, 2025
6505889
removing hpc environment yaml and updating existing environment.yaml
brookeslawski May 16, 2025
b268192
pull updated gha from logging branch
eyoung55 May 29, 2025
2d5ef38
Merge branch 'dev' into feature/turb_inflow
eyoung55 May 30, 2025
d20d462
Merge branch 'dev' into feature/turb_inflow
eyoung55 Jun 18, 2025
6bb554b
Merge branch 'dev' into feature/turb_inflow
eyoung55 Jun 23, 2025
059ee81
Merge branch 'dev' into feature/turb_inflow
eyoung55 Jul 10, 2025
d9d3cf3
Merge branch 'dev' into feature/turb_inflow
eyoung55 Jul 25, 2025
d6c0ba2
add reading h5 code
brookeslawski Aug 12, 2025
65e164f
add more and unbuffered outputs to test_all_inputs
eyoung55 Sep 10, 2025
c383888
coarsen turbinflow test case, black formatting
eyoung55 Sep 10, 2025
1bcc594
only print stderr if it exists
eyoung55 Sep 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions docs/how_to_guides/examples/Turbulent_Inflow_Panels_3D.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
PV Panels 3D with Turbulent Inflow
===========
This example demonstrates the use of PVade to simulate dynamic PV loading amidst a turbulent inflow velocity field.

Currently, this feature only works in 3D simulations.

Geometry Definition
-------------------


This example consists of a turbulent atmospheric flow in which the fluid interacts with a single row of PV panels. The domain setup and geometry are described in the figure below.

.. image:: pictures/turbinflow3d/duramat_dimensions.png
:alt: Alternative text

where:

chord is the length of the solar panel,
span is the width of the solar panel,
elevation is the height of the mounting point, and
tracker angle is the tilt angle of the solar panel.


.. image:: pictures/turbinflow3d/turb_inflow_domain_setup.png
:alt: Alternative text

L is the length of the domain and
H is the height of the domain.


For this example, the following values are used, as shown in the input file (``input/turbinflow_duramat_case_study.yaml``):

.. container::
:name: tab:geometry

.. table:: Parameter settings

==================================== =====
parameter [units] Value
==================================== =====
L [m] 80
H [m] 20
chord [m] 4.1
span [m] 10.0
elevation [m] 2.1
tracker angle [degrees] 0
==================================== =====


Synthetic Turbulence Generation
-------------------------------

The turbulent inflow velocity field is generated externally using `pyconturb` [1]_. This example uses unconstrained turbulence generated using the notebook here: ``examples/synthetic_turbulent_inflow/generate_turbulent_inflow_h5_file.ipynb``.

The generated turbulent velocity field is written to an .h5 file (e.g. ``input/pct_turb_ny80_nz80_unconstrained_1.0s_dt0.01_uref20.h5``) so that it can be read in by `pvade`. This file contains velocity 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 the boundary condition at the inlet.

Currently, this functionality only works for 3D simulations.

Running this example locally
----------------------------

This example is executed in parallel using::

mpirun -n 8 python pvade_main.py --input_file input/turbinflow_duramat_case_study.yaml

For testing purposes, this example can be run for less time using::

mpirun -n 8 python pvade_main.py --input_file input/turbinflow_duramat_case_study.yaml --domain.l_char 2.5 --solver.t_final 0.2


Running this example on HPC
---------------------------

This example is best run on a supercomputer using the included batch script as an example(``PVade/docs/how_to_guides/examples/runscripts/run.sh``). You will need to change the environment path and the paths to the files to your own.

First, create a symbolic link to the ``input`` folder from where you are launching the simulation::

ln -s <path_to_PVade>/input input

Then, edit and run the following script to launch the simulation::

sbatch run.sh

For more details on running on HPC, please refer to :ref:`Running on HPC`.

This example yields the following result:

.. image:: pictures/turbinflow3d/turb_inflow_slices.gif
:alt: Alternative text


References
----------
.. [1] J. M. Rinker, “PyConTurb: Constrained Stochastic Turbulence for Wind Energy Applications,” 2017, https://gitlab.windenergy.dtu.dk/pyconturb/pyconturb
1 change: 1 addition & 0 deletions docs/how_to_guides/examples/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Examples
:maxdepth: 1

Flag_2D
Turbulent_Inflow_Panels_3D
Heliostat_3D
.. Cylinder_2D
.. Cylinder_3D
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions docs/how_to_guides/examples/runscripts/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

#SBATCH --ntasks-per-node=104
#SBATCH --time=08:00:00
#SBATCH --account=csphfm
#SBATCH --job-name=heliostat_u2
#SBATCH --account=pvopt
#SBATCH --job-name=jobname
#SBATCH --nodes=1
#SBATCH --error=heliostat-0.err
#SBATCH --output=heliostat-0.out
#SBATCH --error=jobname.err
#SBATCH --output=jobname.out
#SBATCH --mem=0
#SBATCH --exclusive

Expand All @@ -15,4 +15,4 @@ module load mamba
mamba activate pvade
export OMP_NUM_THREADS=1

mpirun -np 104 python -u /home/bstanisl/pvade/PVade/ns_main.py --input_file /home/bstanisl/pvade/PVade/input/single_heliostat.yaml
mpirun -np 104 python -u /home/bstanisl/pvade/PVade/pvade_main.py --input_file /home/bstanisl/pvade/PVade/input/<input_yaml_file>
4 changes: 3 additions & 1 deletion docs/how_to_guides/pvade_input_file.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ solver:
fluid:
The fluid Category sets the CFD parameters for the fluid simulation

- velocity_profile_type: General shape of inflow velocity profile
- initialize_with_inflow_bc: Boolean flag to set the velocity everywhere in the domain to match the inflow BC velocity.
- u_ref: Reference velocity at the center of the panel
- nu: Dynamic viscosity
- turbulence_model: can be set to smagorinsky or null for no turbulence
Expand All @@ -114,7 +116,7 @@ structure:

- dt : set the time step for the CSD simulation
- elasticity_modulus: set the Elasticity modulus for the structure
- poissons_ratio: set poisson's ration for the structure
- poissons_ratio: set poisson's ratio for the structure
- body_force_x: set the x component of the body force
- body_force_y: set the y component of the body force
- body_force_z: set the z component of the body force
Expand Down
5 changes: 4 additions & 1 deletion environment.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
name: pvade
name: pvade-test
channels:
- conda-forge
- nodefaults
dependencies:
# Dependencies should be kept as loosely pinned to version numbers as possible
- python >=3.10,<3.11
- alive-progress
- black
- fenics-dolfinx=0.6
- h5py
- jsonschema
- jupyter
- matplotlib
Expand All @@ -21,6 +23,7 @@ dependencies:
- sphinx
- tqdm
- pip
- mpich >=4.0,<5.0
- pip:
- sphinx-rtd-theme
- sphinxcontrib.datatemplates
Expand Down
Loading
Loading