Welcome, Guest
Username: Password: Remember me

TOPIC: api source

api source 2 years 10 months ago #39614

  • haozailao
  • haozailao's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 86
  • Thank you received: 1
Hello.
I want to use API to run a simulation so that I can add a changeable source in every time step.
I used my_case.set('MODEL.FLOWRATEQ',0.3,243) but it fail.
0.3 is the suppose flow to be added,243 is the node number where I want to add the source
the error shows that""i=%i is not within [0,%i]" % (i, dim1)"
Did I use the wrong variable?
Thanks advanced!
The administrator has disabled public write access.

api source 2 years 10 months ago #39616

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

I am not an API specialist, but I have a few questions or suggestions.

Where have you found the name FLOWRATEQ?
Reading the TelApy user manual available here:
wiki.opentelemac.org/doku.php?id=documentation_latest
or the api_handle_var_t2d subroutine (in $HOMETEL/sources/api folder),
I can read that this variable is for solid transport flowrate, not for source discharge. This latter variable seems to be currently available for TELEMAC-3D, not for TELEMAC-2D.
If you need to add a variable not available, you should read the TelApy user manual, in particular the subsection "How to add access to a new variable".

Hope this helps,

Chi-Tuan
The administrator has disabled public write access.

api source 2 years 10 months ago #39618

  • haozailao
  • haozailao's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 86
  • Thank you received: 1
Thanks for your reply.
Firstly,
I found flowrateq used the function 'my_case.list_variables()'
I also found it in api_handle_var_t2d.
It is strange that the node number is not within [0,0].
Secondly,
I also read the telapy_user.but the description is too vague to follow,because I'm not very familiar with Fortran.
Anyway,I think adding source to the domain is a more conventional operation, so I think there should be a function to implement.I'm afraid I'm missing something.
I'll try to follow the guide of telapy_user.
Thanks again.
The administrator has disabled public write access.

api source 2 years 10 months ago #39621

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

Hopefully, this feature (discharge of source) does exist in standard TELEMAC-2D without API and can be used. As no user needed it before with API, it is not currently implemented in 2D.

Anyway, if the manuals are not clear enough, do not hesitate to give suggestions or corrections in the dedicated section of this forum:
www.opentelemac.org/index.php/kunena/10-documentation

If you have code ready to be integrated, do not hesitate to contact the TELEMAC-MASCARET development team, this can help other users trying to do the same thing as you.

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

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