Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read profile from file for RANS #1300

Open
hgopalan opened this issue Oct 17, 2024 · 8 comments
Open

Read profile from file for RANS #1300

hgopalan opened this issue Oct 17, 2024 · 8 comments
Labels
enhancement New feature or request no-issue-activity

Comments

@hgopalan
Copy link
Contributor

Is this feature request related to a problem?

For RANS simulations, we often do not need precursor simulations and can use one-dimensional profile at inflow to drive the simulations. There is support for power law profile option using UDFs but I would like to read my profile from a file and apply the inflow BC to velocity, temperature, viscosity and turbulent kinetic energy. Extending the UDF path to read from file will help but I have been struggling with the best way to set it up.

Describe the preferred solution

A custom scalar model with support for reading a profile from file.

Additional context

RANS simulations for wind siting is often performed using a 1-D profile at inflow.

@hgopalan hgopalan added the enhancement New feature or request label Oct 17, 2024
@marchdf
Copy link
Contributor

marchdf commented Nov 6, 2024

@hgopalan looks like you did that for the other PR? Can you close this now?

@hgopalan
Copy link
Contributor Author

hgopalan commented Nov 6, 2024

No this is different from that. I want an option in the UDF to read the wind speed, temperature and turbulent kinetic energy from file for the RANS model. This will make it unnecessary to run precursor RANS simulations and we can directly do inflow-outflow.

@marchdf
Copy link
Contributor

marchdf commented Nov 6, 2024

ohhhh you want a BC UDF that uses data from a file. That makes sense. And pretty trivial. Can you post an example file you would want to read?

Though why not just recast that file into a netcdf file and use the ABL boundary plane functionality?

@hgopalan
Copy link
Contributor Author

hgopalan commented Nov 6, 2024

The file will be

z u v w Temperature TKE
0 4 2 0 300 0.7
....
..

I want to keep the input to a simple text file as it may come from different sources and do not want to touch netcdf.

@moprak-nrel
Copy link
Contributor

Do these inputs come from a python code? As an easy stopgap to avoid running a precursor I can help with writing function to output a netcdf file.

@hgopalan
Copy link
Contributor Author

hgopalan commented Nov 7, 2024

There are several possible sources: (1) python code (2) WRF/ERF (3) Measurements. The idea is to use the use linear interpolation algorithm to vertically interpolate the data from the source into the vertical z locations in AMR-Wind. We are going to assume horizontally homogenous profile for now.

@rybchuk
Copy link
Contributor

rybchuk commented Nov 7, 2024

Harish pointed me this way. Me and Tony have been running AMR-Wind simulations where we use ML-generated data for our ABL.bndry_file inflow BCs. As part of this process, we had to reformat the ML-generated data into a netCDF file format that is compatible with AMR-Wind. I put together a notebook where I (1) figure out the formatting of an AMR-Wind-generated BC file, (2) arrange my ML-generated data to match the expected format, and (3) sanity check that data.

format_for_amrwind.ipynb.zip

Copy link

github-actions bot commented Dec 8, 2024

This issue is stale because it has been open 30 days with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request no-issue-activity
Projects
None yet
Development

No branches or pull requests

4 participants