lawrenceccheung / AWAKEN_summit_setup

1 stars 1 forks source link

error while running simulation #2

Open AsimUdel opened 2 weeks ago

AsimUdel commented 2 weeks ago

Hello @lawrenceccheung , I hope you are doing fine, I have some questions and problems while running the simulations. 1) I ran the Precursor and Turbine simulation while copying yours Neutral (Precursor and Turbine simulation, respectively), (Precursor https://github.com/lawrenceccheung/AWAKEN_summit_setup/blob/main/precursor/NeutralABL1/AMRWind/precursor_5x5_newWD.inp) and for turbine ( https://github.com/lawrenceccheung/AWAKEN_summit_setup/blob/main/NeutralABL_turbine1/AMR.5kmX5km_turbine1/5x5_newWD_withTurbine.inp), although these are for Neutral case I changed for the Stable case, Turbine_Stable.txt Stable_precursor.txt I have some questions apologies, If I am asking basic or silly questions(does not the ending time of simulation in your turbine should be less than the Precursor? , and fixed_dt = 0.1 in turbine, but DT = 0.1 in OpenFAST .fst file, did not you get the error for that?

2) I have got an error while running the turbine simulation. after the precursor, due to time mismatch, I guess, Error_out.txt

Thank you in advance

lawrenceccheung commented 2 weeks ago

Hi @AsimUdel,

In answer to your first question, the precursor input file precursor_5x5_newWD.inp, that is not the final precursor run. There was another precursor run after that which ran and collected the boundary data files, so the turbine run does not end after the precursor run. Also, the OpenFAST timestep that we use is 0.01 (see NREL-2p8-127.fst), which is 10 times the AMR-Wind timestep, so it should be okay.

The error message that you see here:

terminate called after throwing an instance of 'std::runtime_error'
  what():  Assertion `(m_in_times[0] <= time) && (time < m_in_times.back())' failed, file "/work/archer/sw/rawcof_1/src/amr-wind/amr-wind/wind_energy/ABLBoundaryPlane.cpp", line 771

Means that the turbine simulation is requesting boundary plane data beyond the time period which it was captured, so it can't find the right data to use.

Lawrence

AsimUdel commented 2 weeks ago

Hi @lawrenceccheung , Thank you so much for your response, I got it, and also by any chance do you have final precursor and turbine simulations run which you have used, I would be grateful if you could share those.

lawrenceccheung commented 2 weeks ago

Hi @AsimUdel,

The final setup for the neutral precursor is available here: precursor_5x5_newWD_restartwithPlanes.inp -- this one includes the planes.

The final setup for the turbine run is already online at 5x5_newWD_withTurbine.inp, it's the same one you mentioned before.

Lawrence

AsimUdel commented 2 weeks ago

Hi @lawrenceccheung , Thank you so very much. Let me try these files with my settings for atmospheric stabilities and will get back to you if I got some errors. Asim

AsimUdel commented 2 weeks ago

Hello @lawrenceccheung , I ran simulations using your input files as a reference, while modifying some parts. When I wanted to run turbine simulations I am getting "BodyForce.magnitude not found in table" error and it crashed, I noticed in your turbine simulation value of BodyForce.magnitude was not present, did you get that error too ? error_out.txt precursor_Neutral.txt Turbine_Neutral.txt Asim

lawrenceccheung commented 2 weeks ago

Hi @AsimUdel,

It looks like in your run, you have specified that a BodyForce force be used, but did not specify BodyForce.magnitude. In the error_out.txt file, I see the line

ICNS.source_terms(nvals = 5)  :: [BoussinesqBuoyancy, CoriolisForcing, ActuatorForcing, BodyForce, ABLMeanBoussinesq]

but of course, there is no BodyForce.magnitude specified. However, Turbine_Neutral.txt does comment it out, so maybe there is some confusion about which input file is being used?

In our setup, we have used both BodyForce and BodyForce.magnitude. You can find the relevant lines here: https://github.com/lawrenceccheung/AWAKEN_summit_setup/blob/6311e244c9272525f8b91d55dc3ceb3dfed2be72/NeutralABL_turbine1/AMR.5kmX5km_turbine1/5x5_newWD_withTurbine.inp#L53 and https://github.com/lawrenceccheung/AWAKEN_summit_setup/blob/6311e244c9272525f8b91d55dc3ceb3dfed2be72/NeutralABL_turbine1/AMR.5kmX5km_turbine1/5x5_newWD_withTurbine.inp#L78

Lawrence

AsimUdel commented 2 weeks ago

Hi @lawrenceccheung, thank you, my bad, actually I commented it out and tried to run after that error that's why there is confusion. [https://github.com/lawrenceccheung/AWAKEN_summit_setup/blob/6311e244c9272525f8b91d55dc3ceb3dfed2be72/NeutralABL_turbine1/AMR.5kmX5km_turbine1/5x5_newWD_withTurbine.inp#L78] (how did you calculate the BodyForce.magnitude ?

AsimUdel commented 1 week ago

Hi @lawrenceccheung , Not related to the issue above, but regarding the tke calculations following your work "https://github.com/lawrenceccheung/AWAKEN_summit_setup/blob/main/NeutralABL_turbine1/AMR.5kmX5km_turbine1/post_processing/HH_profiles.ipynb" , can you please explain a bit ? Does it mean total tke is calculated by summation of resolved and unresolved part ? and tke production is calculated by subtracting turbine to no turbine ? Thank you in advance Asim

lawrenceccheung commented 1 week ago

Hi @lawrenceccheung, thank you, my bad, actually I commented it out and tried to run after that error that's why there is confusion. [https://github.com/lawrenceccheung/AWAKEN_summit_setup/blob/6311e244c9272525f8b91d55dc3ceb3dfed2be72/NeutralABL_turbine1/AMR.5kmX5km_turbine1/5x5_newWD_withTurbine.inp#L78] (how did you calculate the BodyForce.magnitude ?

Hi @AsimUdel, I calculated the BodyForce.magnitude by time averaging the abl_forcing_x and abl_forcing_y variables that are in the ABL statistics file in the precursor. I have a function in the amr-wind-frontend which does this, and also sets up a few other things for the restart. You can see it in cell 8 of this notebook where I call case.boundaryplane_restart(): https://github.com/lawrenceccheung/AWAKEN_summit_setup/blob/main/NeutralABL_turbine1/AMR.5kmX5km_turbine1/farmrun1_JRSE.ipynb

Lawrence

lawrenceccheung commented 1 week ago

Hi @lawrenceccheung , Not related to the issue above, but regarding the tke calculations following your work "https://github.com/lawrenceccheung/AWAKEN_summit_setup/blob/main/NeutralABL_turbine1/AMR.5kmX5km_turbine1/post_processing/HH_profiles.ipynb" , can you please explain a bit ? Does it mean total tke is calculated by summation of resolved and unresolved part ? and tke production is calculated by subtracting turbine to no turbine ? Thank you in advance Asim

Yes, that's right. I first calculated the mean flow-field and also the Reynolds stresses for the various sampling planes using this script here: https://github.com/lawrenceccheung/AWAKEN_summit_setup/blob/main/NeutralABL_turbine1/AMR.5kmX5km_turbine1/post_processing/means/avgplanes.py Then, to compute the resolved TKE, I did

TKEres = 0.5*(hhds['uu_avg'][iplane,:,:] + hhds['vv_avg'][iplane,:,:] + hhds['ww_avg'][iplane,:,:])

in the HH_profiles.ipynb notebook. However, there's also a contribution of TKE coming from the subgrid scale model, so I added that to TKEres to get the total TKE:

TKEsgs = hhds['tke_avg'][iplane,:,:]
TKEtot = TKEres + TKEsgs

You can repeat this calculation for the precursor planes as well, and then the difference in the total TKE between the two is the wake-added turbulence, as you were suggesting.

AsimUdel commented 1 week ago

Hi @lawrenceccheung , Thank you so much. I got it. Just a quick question, it it better to take the difference between turbine and precursor or turbine and no turbine ? provided the boundary conditions (their periodicity) are different in precursor and turbine or no turbine case. Asim

AsimUdel commented 1 week ago

Hi @lawrenceccheung, thank you, my bad, actually I commented it out and tried to run after that error that's why there is confusion. [https://github.com/lawrenceccheung/AWAKEN_summit_setup/blob/6311e244c9272525f8b91d55dc3ceb3dfed2be72/NeutralABL_turbine1/AMR.5kmX5km_turbine1/5x5_newWD_withTurbine.inp#L78] (how did you calculate the BodyForce.magnitude ?

Hi @AsimUdel, I calculated the BodyForce.magnitude by time averaging the abl_forcing_x and abl_forcing_y variables that are in the ABL statistics file in the precursor. I have a function in the amr-wind-frontend which does this, and also sets up a few other things for the restart. You can see it in cell 8 of this notebook where I call case.boundaryplane_restart(): https://github.com/lawrenceccheung/AWAKEN_summit_setup/blob/main/NeutralABL_turbine1/AMR.5kmX5km_turbine1/farmrun1_JRSE.ipynb

Lawrence

Thank you so much

lawrenceccheung commented 1 week ago

Hi @lawrenceccheung , Thank you so much. I got it. Just a quick question, it it better to take the difference between turbine and precursor or turbine and no turbine ? provided the boundary conditions (their periodicity) are different in precursor and turbine or no turbine case. Asim

This is good point. Right now for wake-added turbulence statistics, we've been comparing against the "no-turbine" runs, where "no-turbine" means the exact same setup without any turbines in it -- so same mesh refinements, time-steps, etc. That way any differences due to the numerics can be eliminated.

AsimUdel commented 1 week ago

Yes, Thank you @lawrenceccheung for your time and efforts.

AsimUdel commented 1 week ago

Hello @lawrenceccheung, I have run simulation following your steps to run, (I made some changes, which are (I split precursor simulation and added spinup before that (with dt =0.5 dt and no mesh resolution in that), reduced the domain size and some changes like in surface roughness, temperature etc). I have attached the input files, spinup_unstable.txt precursor_unstable.txt Turbine_unstable.txt No_turbine_unstable.txt

the xy plane velocity of spinup is Spinup_hub_height_xy_unstable

the xy plane velocity and tke plots of precursor simulation are Precursor_XY_hub_height Precusror_tke_xy

I have got some problems 1) I have a feeling that, the inflow/outflows condition which are being saved after the precursor run are not saved properly and when those conditions are read in turbine simulation flow returns at (xhi, yhi and zhi) side. 2) This problem has predominately appeared when I try to plot Avg TKE and vaguely appears in Avg velocity plots. Turbine_tke_xy Turbine_xy_plane

3)When I run the No_turbine simulation using (the same turbine simulation setting except suppressing the ActuatorForcing and Turbine input parameters), I also get the flow reversal behavior . No_Turbine_xy_plane No_Turbine_tke_xy

What do you suggest, what possibly I am doing wrong, should I avoid running Spinup simulation and only run Precursor? And what should I change in ABL.bndry_planes planes or any change in boundary conditions ? Thank you in advance for your time. Asim