Welcome, Guest
Username: Password: Remember me

TOPIC: Implementing Variable Liquid Boundary in Telemac2D API

Implementing Variable Liquid Boundary in Telemac2D API 2 hours 3 minutes ago #45745

Hello everyone,

I'm currently working with the Telemac2D API and trying to implement a variable liquid boundary at the upstream boundary using an equation defined in my code.

I am not sure which Variable name should be used.

I tried to change the prescribed discharge, but it seems not a very good strategy.

I tried the following code:
 for i in range(number_of_time_steps):
    sys.stdout.write('\r')
    # the exact output you're looking for:
    percent = 100*i//(max(number_of_time_steps-1,1))
    sys.stdout.write("[%-20s] %d%%" % ('='*(percent//5), percent))
    sys.stdout.flush()
  
    original_Q = project.get('MODEL.DEBIT',i=0)  
    new_Q = equation(original_Q, defined_equation)
    project.set('MODEL.DEBIT', new_Q)
    project.run_one_time_step()

I encountered the following error:
Traceback (most recent call last):
File "Project.py", line 70, in <module>
project.set('MODEL.DEBIT', new_Q)
File "/home/telemac/scripts/python3/telapy/api/api_module.py", line 841, in set
raise TelemacException(
utils.exceptions.TelemacException: i=-1 is not within [0,30]

Could anyone please provide some advice on how to resolve this issue?

Kind regards,
Mohamed
The administrator has disabled public write access.

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