Welcome, Guest
Username: Password: Remember me

TOPIC: Tidal Turbine Modelling Using dragfo

Tidal Turbine Modelling Using dragfo 2 years 9 months ago #39889

  • msuryaprawira
  • msuryaprawira's Avatar
Hi, I am currently working on a tidal turbine model in a strait. I used the dragfo subroutine that I have found from this post:

www.opentelemac.org/index.php/assistance...del-tec?limitstart=0

and from the guidance from [Pham, Chi-Tuan, 2015]. hal.archives-ouvertes.fr/hal-01702806/document

I used the enclosed steering file, dragfo file, and TEC_positions.xyz file. However, with a drag coefficient and power coefficient value of 0.5, I found no difference with the model without the turbine. (green line is turbine model, the red line is the natural model)




location.png


tidalturbineresult.png




Inquiries:
1. Is there something that I miss? I understand the sequence of the dragfo FORTRAN code by reading Chi-Tuan's paper. However, I did not change the code for the dragfo subroutine due to my lack of FORTRAN writing skills. Is there anything I should change according to my model?

2. Is the turbine drag coefficient of 0.5 too small? Is this why I am not getting results?

Thank you for your time and attention.
Attachments:
The administrator has disabled public write access.

Tidal Turbine Modelling Using dragfo 2 years 8 months ago #39906

  • pham
  • pham's Avatar
  • OFFLINE
  • Administrator
  • Posts: 1559
  • Thank you received: 602
Hello Michael,

Can you upload your TEC_positions.xyz file but changing the extension to an allowed one, e.g. .txt please? It has not worked.

Is your mesh refined enough where you apply the drag force? Does the defined surface cover several nodes of the mesh?

Have you tested your implementation on a simple case, e.g. a channel, and has it worked?

Chi-Tuan
The administrator has disabled public write access.
The following user(s) said Thank You: msuryaprawira

Tidal Turbine Modelling Using dragfo 2 years 8 months ago #39970

  • msuryaprawira
  • msuryaprawira's Avatar
Hello, Chi-Tuan

1. Yes I will attach the .txt file in this reply. I wanted to enclose my .xyz file but turns out it is not possible. However, is it the right configuration to write the TEC_Positions file?

2. I think my mesh is not refined enough. the TEC area defined by W and L might not contain several nodes. I will fix this in the model.

3. I have not tried the simple case. Thank you for your suggestion.

Thank you for your help. I will come back with the results
The administrator has disabled public write access.

Tidal Turbine Modelling Using dragfo 2 years 8 months ago #39988

  • pham
  • pham's Avatar
  • OFFLINE
  • Administrator
  • Posts: 1559
  • Thank you received: 602
Hello Michael,

I cannot see any ASCII file for TEC positions.
Anyway, it has to fit what is implemented in your Fortran file.

Chi-Tuan
The administrator has disabled public write access.

Tidal Turbine Modelling Using dragfo 2 years 8 months ago #40030

  • msuryaprawira
  • msuryaprawira's Avatar
Hi, Chi-Tuan

Sorry for the delay. I have made adjustments on the TEC Positions file.

Turns out I input the wrong angle. Instead of making the TEC perpendicular to the flow, I made it parallel which obviously produce no result. here is my ASCII file (sorry I failed to attach my TEC_Positions file before):

TECPositionsFile.png


Here is the result:

ModelResults.png



However, every 16 hours, I received this error message:


GRACJG (BIEF) : EXCEEDING MAXIMUM ITERATIONS: 500 RELATIVE PRECISION: NaN

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
Traceback (most recent call last):
File "C:\opentelemac-mascaret\v8p2\scripts\python3\telemac2d.py", line 7, in <module>
main('telemac2d')
File "C:\opentelemac-mascaret\v8p2\scripts\python3\runcode.py", line 271, in main
run_study(cas_file, code_name, options)
File "C:\opentelemac-mascaret\v8p2\scripts\python3\execution\run_cas.py", line 157, in run_study
run_local_cas(my_study, options)
File "C:\opentelemac-mascaret\v8p2\scripts\python3\execution\run_cas.py", line 65, in run_local_cas
my_study.run(options)
File "C:\opentelemac-mascaret\v8p2\scripts\python3\execution\study.py", line 612, in run
self.run_local()
File "C:\opentelemac-mascaret\v8p2\scripts\python3\execution\study.py", line 440, in run_local
run_code(self.run_cmd, self.sortie_file)
File "C:\opentelemac-mascaret\v8p2\scripts\python3\execution\run.py", line 182, in run_code
raise TelemacException('Fail to run\n'+exe)
utils.exceptions.TelemacException: Fail to run
C:\Users\surya\OneDrive\Documents\TELEMAC\ntt_turbine\cas_1aa_1i_2.cas_2022-03-11-10h22min15s\out_user_fortran.exe

I tried changing the maximum iteration limit from 500 to 2000 and still no change. What is the solution to this? Am I missing something? Thanks.

P.S.: The grid area around the mesh is 3x3 meter elements using 0.5 time step


Mesh.png
Attachments:
The administrator has disabled public write access.

Tidal Turbine Modelling Using dragfo 2 years 8 months ago #40063

  • pham
  • pham's Avatar
  • OFFLINE
  • Administrator
  • Posts: 1559
  • Thank you received: 602
Hello Michael,

As told in other posts, when getting NaN in your listing (Not a Number), you should use a debug configuration with debug options to investigate.
See e.g. the S9.gfortran.debug configuration in the $HOMETEL/configs/systel.edf.cfg configuration file, in particular the flag fflags_debug_gfo for gfortran compiler.
fflags_debug_gfo: -g -Wall -fcheck=all -fbacktrace -fbounds-check -finit-integer=-1 -finit-real=nan -ffpe-trap=invalid,zero,overflow

It will show in which subroutine the issue/nan occurs and may help you to change something in your computation.

Anyway, looking quickly at your TEC_positions file and what is to be read in the 2nd line by your modified DRAGFO subroutine, I can read 9 values in your file, but 10 values in the subroutine.

Hope this helps,

Chi-Tuan
The administrator has disabled public write access.
The following user(s) said Thank You: msuryaprawira

Tidal Turbine Modelling Using dragfo 2 years 8 months ago #40067

  • msuryaprawira
  • msuryaprawira's Avatar
Hi Chi-Tuan

Thank you for your reply. I have made some changes. For example, yes, I figured out the value differences (9 in the ASCII file and 10 in the dragfo file). I have added the last value, which is cut-in speed to my ASCII file.

ASCII.png


Regarding debug, I also found another post that mentions turning on the DEBUGGER = 1. Is this what you mean? If yes, then I have tried running my model using the debugger and this is the explanation that shows up when my simulation stopped:

CALLING BIEF_DESIMP F 110699 55349.500000000000
BACK FROM BIEF_DESIMP F
CALLING UTIMP_TELEMAC2D
BACK FROM UTIMP_TELEMAC2D
CALLING CHPCONV 1
BACK FROM CHPCONV 1
CALLING HPROPA
BACK FROM HPROPA
CALLING PROPIN
BACK FROM PROPIN
CALLING CORSTR
BACK FROM CORSTR
IN FRICTION_CHOICE-INIT STEP
IN FRICTION_CHOICE-CALLING UNIF
IN FRICTION_CHOICE-BACK FROM UNIF
CALLING BORD
BACK FROM BORD
CALLING PROPIN
BACK FROM PROPIN
CALLING WALL_FRICTION
BACK FROM WALL_FRICTION
CALLING THOMPS
BACK FROM THOMPS
BOUCLE 701 ISOUSI= 1
CALLING CHARAC OPTION STRONG
BACK FROM CHARAC OPTION STRONG
CALLING PROSOU
BACK FROM PROSOU
CALLING PROPAG
BACK FROM PROPAG
TRAITEMENT BANCS DECOUVRANTS
FIN DU TRAITEMENT BANCS DECOUVRANTS
CALLING CHPCONV 2
BACK FROM CHPCONV 2
PRERES: MAXIMUM COURANT NUMBER: 0.2190095
CALLING BIEF_DESIMP T 110700 55350.000000000000

Could you please help me to decipher what this error implies? Thank you very much

Michael
The administrator has disabled public write access.

Tidal Turbine Modelling Using dragfo 2 years 8 months ago #40073

  • pham
  • pham's Avatar
  • OFFLINE
  • Administrator
  • Posts: 1559
  • Thank you received: 602
Hello Michael,

No, activating DEBUGGER = 1 only writes some calls of subroutines and may help to find the last or one of the last subroutine called before crashing.

What I mean is to change the configuration file to add some options when compiling then running your computation (you can create 2 different configurations, your normal one and one debug one with the extra options to investigate when getting NaN e.g.). If using gfortran compiler, you can use what I wrote. If using another one, you can see if it exists in systel.edf.cfg and then add the debug flags.

Anyway, as already asked, have you tried with more simple case (e.g. less TEC and/or smaller extent) just to check that your personnal implementation of Fortran files works? If not, you should start with that and move to more complex configuration after.

Hope this helps,

Chi-Tuan
The administrator has disabled public write access.

Tidal Turbine Modelling Using dragfo 2 years 8 months ago #40076

  • msuryaprawira
  • msuryaprawira's Avatar
Hello Chi Tuan

Thank you for the lengthy explanation. Turns out you have answered a lot of questions regarding this topic before.

I am starting to understand what you mean by investigating what went wrong in the subroutine. So the next time I run my simulation, I write this, right?

E:\0_modelling\telemacfiles\ntt_turbine>telemac2d.py cas.cas fflags_debug_gfo:-g-Wall-fcheck=all-fbacktrace-fbounds-check-finit-integer=-1-finit-real=nan-ffpe-trap=invalid,zero,overflow

As for your suggestions, yes I have tried with only one TEC, and still produced the same error. I am trying to reduce the area of my domain (the mesh size) and use the debug configuration and I will provide the result later.

Thanks, Chi-Tuan.
The administrator has disabled public write access.

Tidal Turbine Modelling Using dragfo 2 years 8 months ago #40077

  • msuryaprawira
  • msuryaprawira's Avatar
Hello Chi-Tuan

Is the method I mentioned previously correct?

Or do you mean to go into the temporary folder and run "gdb out_user_fortran.exe"? This is one solution I found in another post.

I am confused as what to do with the line "fflags_debug_gfo: -g -Wall -fcheck=all -fbacktrace -fbounds-check -finit-integer=-1 -finit-real=nan -ffpe-trap=invalid,zero,overflow" since it is already written in my system file. Thanks.
The administrator has disabled public write access.
Moderators: pham

The open TELEMAC-MASCARET template for Joomla!2.5, the HTML 4 version.