Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
8106f5d
Merge pull request #3 from NREL/dev
arswalid Mar 5, 2024
5c62d11
working version of standalone script
brookeslawski Apr 16, 2025
4345d31
make a call to the start_print_and_log function
eyoung55 Apr 18, 2025
cbb9dc9
fix typo
eyoung55 Apr 18, 2025
90fb005
add a new function that captures all printed messages to a log file
eyoung55 Apr 18, 2025
5eaaf15
only print initialization from rank 0
eyoung55 Apr 18, 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
aa158d6
update to v4
eyoung55 May 14, 2025
cf007c7
back to micromamba
eyoung55 May 14, 2025
317dddc
remove defaults from env, auto update conda
eyoung55 May 14, 2025
ad56d63
specify python version
eyoung55 May 14, 2025
063739e
try nodefaults option
eyoung55 May 14, 2025
b6bf7f4
make python version string
eyoung55 May 14, 2025
13794a9
add activate-environment option
eyoung55 May 15, 2025
cf7a622
update to python 3.11
eyoung55 May 15, 2025
1338cdc
revert to v3 checkout
eyoung55 May 15, 2025
6505889
removing hpc environment yaml and updating existing environment.yaml
brookeslawski May 16, 2025
3e9a13c
addition of pythonpath to access pvade_main
arswalid May 28, 2025
e229fc0
rename greek variables, rename duplicate k fn, comment unused fns
eyoung55 May 29, 2025
05e2882
remove unused imports, create linear problem, solve and write tensor …
eyoung55 May 29, 2025
ab35b41
add form for projecting P_, remove ufl.dx from k_nominal and add dire…
eyoung55 May 29, 2025
03a149a
remove unused code now moved to elasticityAnalysis, renaming greek vars
eyoung55 May 29, 2025
bd25235
pull updated gha file from logging branch
eyoung55 May 29, 2025
b268192
pull updated gha from logging branch
eyoung55 May 29, 2025
3c51786
remove the von mises stress function
eyoung55 May 29, 2025
08db451
save the velocity and acceleration functions directly, remove saving …
eyoung55 May 29, 2025
d713434
remember to save old, which after solve is equiv to new, since new is…
eyoung55 May 29, 2025
6f94f80
name things to reduce confusion when postprocessing, remove names fro…
eyoung55 May 29, 2025
c9ea617
Merge pull request #83 from eyoung55/logging
eyoung55 May 30, 2025
2d5ef38
Merge branch 'dev' into feature/turb_inflow
eyoung55 May 30, 2025
a97b91d
Merge branch 'dev' into struct-tensor
eyoung55 May 30, 2025
1fe88b6
black formatting
eyoung55 May 30, 2025
14390dc
adding psi
brookeslawski Jun 17, 2025
625ae3b
minor correction
brookeslawski Jun 17, 2025
8cb3700
Merge pull request #94 from brookeslawski/vel_prof_stability
eyoung55 Jun 18, 2025
cc48568
Merge branch 'dev' into struct-tensor
eyoung55 Jun 18, 2025
d20d462
Merge branch 'dev' into feature/turb_inflow
eyoung55 Jun 18, 2025
5cf42ce
adjusted limits of psi and z0 to prevent negative u values
brookeslawski Jun 19, 2025
85d782a
Merge pull request #6 from NREL/dev
arswalid Jun 22, 2025
f2e4aa3
Merge branch 'dev' into vel_prof_stability
eyoung55 Jun 23, 2025
4d03482
Merge pull request #95 from brookeslawski/vel_prof_stability
eyoung55 Jun 23, 2025
569df4d
Merge branch 'dev' into struct-tensor
eyoung55 Jun 23, 2025
6bb554b
Merge branch 'dev' into feature/turb_inflow
eyoung55 Jun 23, 2025
9c5a5de
avoid reading the mesh if analysis set to false
arswalid Jun 23, 2025
121fc5e
black formatted
arswalid Jun 23, 2025
eb90544
initial push to prep PR
arswalid Jun 25, 2025
75669b8
black format
arswalid Jun 25, 2025
31208d1
black format main
arswalid Jun 25, 2025
97d6a6a
fixing input files
arswalid Jun 25, 2025
472610a
testing all inputs
arswalid Jun 25, 2025
6db2333
Merge pull request #7 from eyoung55/struct-tensor
arswalid Jun 25, 2025
110ebc1
missing self in structure for hmin
arswalid Jun 25, 2025
454e998
fix test_all
arswalid Jun 26, 2025
85050c4
Stop tracking input
arswalid Jun 26, 2025
498555a
black format
arswalid Jun 26, 2025
cc11fae
conftest
arswalid Jun 26, 2025
3928f0d
update location of input
arswalid Jun 26, 2025
fcd4c56
black format
arswalid Jun 26, 2025
ec4e351
reduce from 8 to 4 cores for test all
arswalid Jun 26, 2025
0a05747
removing 4 cores runs
arswalid Jun 30, 2025
f03a4ab
fixing errors and removing unnecessary print statements
brookeslawski Jun 30, 2025
c1a91cd
addition of structure anlysis in panel3d
arswalid Jun 30, 2025
c0313e6
Merge pull request #98 from arswalid/domain_restructuing
eyoung55 Jul 10, 2025
059ee81
Merge branch 'dev' into feature/turb_inflow
eyoung55 Jul 10, 2025
5daae6b
Merge branch 'main' into dev
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
f177b8a
Merge pull request #84 from brookeslawski/feature/turb_inflow
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
8 changes: 7 additions & 1 deletion .github/workflows/test_pvade.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,16 @@ jobs:
- name: Build Conda environment
uses: conda-incubator/setup-miniconda@v3
with:
# auto-update-conda: true
python-version: "3.10"
environment-file: environment.yaml
activate-environment: pvade
- name: Run pytest
shell: bash -l {0}
run: pytest -sv pvade/tests/
run: PYTHONPATH=. pytest -sv pvade/tests/
- name: test all inputs
shell: bash -l {0}
run: pytest -sv test_all_inputs.py

# Job 2 of 2 - enforce Black formatting
formatting:
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
*.h5

docs/_build/
results/
results/input/
input/
29 changes: 29 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from pathlib import Path


def pytest_addoption(parser):
parser.addoption(
"--input-file",
action="store",
default=None,
help="Run test only for a specific input YAML file",
)


def pytest_generate_tests(metafunc):
if "input_file" not in metafunc.fixturenames:
return

input_file_arg = metafunc.config.getoption("input_file")

if input_file_arg:
metafunc.parametrize("input_file", [Path(input_file_arg)])
else:
# 🔧 Always resolve input/ relative to location of conftest.py (PVade/)
this_dir = Path(__file__).resolve().parent # PVade/
input_dir = this_dir / "input"

all_files = sorted(input_dir.glob("*.yaml"))
if not all_files:
raise RuntimeError(f"No input files found in {input_dir}")
metafunc.parametrize("input_file", all_files)
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
7 changes: 5 additions & 2 deletions environment.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
name: pvade
name: pvade-test
channels:
- conda-forge
- defaults
- 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