Welcome to the forums. Please post in English or French.

You are not logged in.

## #1 2020-04-13 08:52:21

nirmaljoshi
Member
From: Japan
Registered: 2018-10-12
Posts: 186

### [solved]applying time and space varying function as boundary condition

Hi,

I want to apply hydrostatic load which depends on depth of water so i defined "P_func_Z"

PRES=P_func_Z))

Currently, I am defining the function P_func_Z  as
P_func_Z = DEFI_FONCTION(NOM_PARA='Z',
VALE=(37.3355, 1473114.0, 187.5, 0.0))

However, at each time step   (e.g. for time t=1 to t=10) I want to change VALE=(37.3355, 1473114.0, 187.5, 0.0) to VALE=(z1, p1,z2, p2) where z and p are function of time.

Could you please show me the way.

Last edited by nirmaljoshi (2020-04-15 10:42:19)

Offline

## #2 2020-04-15 02:50:17

nirmaljoshi
Member
From: Japan
Registered: 2018-10-12
Posts: 186

Any help?

Offline

## #3 2020-04-15 06:13:22

konyaro
Member
From: Genève
Registered: 2016-04-02
Posts: 255

### Re: [solved]applying time and space varying function as boundary condition

Hello,
I think you can use a formule, something like:

``````def Fnirmal(INST,Z):
x = INST * Z
return x

P_func_Z = FORMULE(NOM_PARA=('INST','Z',),
VALE='Fnirmal(INST,Z)', Fnirmal = Fnirmal);

PRES=P_func_Z))``````

Konyaro

Offline

## #4 2020-04-15 10:42:02

nirmaljoshi
Member
From: Japan
Registered: 2018-10-12
Posts: 186

### Re: [solved]applying time and space varying function as boundary condition

That means some python will come in scene. Ok, I will test it.

For now, I did work around by putting the function values in text file:
----------
Time
0.00
1.00
2.00
...

Z    P2    P3    P4    P5    P6    P7    P8    P9    P10    P11
3.7E+01    1.5E+06    2.9E+06    4.4E+06    5.9E+06    7.4E+06    8.8E+06    1.0E+07    1.2E+07    1.3E+07    1.5E+07
5.2E+01    0.0E+00    1.5E+06    2.9E+06    4.4E+06    5.9E+06    7.4E+06    8.8E+06    1.0E+07    1.2E+07    1.3E+07
6.7E+01    0.0E+00    0.0E+00    1.5E+06    2.9E+06    4.4E+06    5.9E+06    7.4E+06    8.8E+06    1.0E+07    1.2E+07
8.2E+01    0.0E+00    0.0E+00    0.0E+00    1.5E+06    2.9E+06    4.4E+06    5.9E+06    7.4E+06    8.8E+06    1.0E+07
...
-------------------

Then I read it using LIRE_FONCTION:
-----
P_func_Z = LIRE_FONCTION(
DEFI_FONCTION=(_F(
INDIC_RESU=(2, 2)
), _F(
INDIC_RESU=(2, 3)
), _F(
INDIC_RESU=(2, 4)
), _F(
INDIC_RESU=(2, 5)
), _F(
INDIC_RESU=(2, 6)
), _F(
INDIC_RESU=(2, 7)
), _F(
INDIC_RESU=(2, 8)
), _F(
INDIC_RESU=(2, 9)
), _F(
INDIC_RESU=(2, 10)
), _F(
INDIC_RESU=(2, 11)
)),
FORMAT='LIBRE',
INDIC_ABSCISSE=(2, 1),
INDIC_PARA=(1, 1),
NOM_PARA='INST',
NOM_PARA_FONC='Z',
TYPE='NAPPE',
UNITE=3
)
------

I hope it works. I will test your method and post again.

Offline

## #5 2020-04-15 13:25:02

konyaro
Member
From: Genève
Registered: 2016-04-02
Posts: 255

### Re: [solved]applying time and space varying function as boundary condition

If the formula is as simple as the one above you do not need Python:

``````P_func_Z = FORMULE(NOM_PARA=('INST','Z',),
VALE='INST * Z * 0.1');

PRES=P_func_Z))``````

Konyaro

Offline

## #6 2020-04-16 01:44:33

nirmaljoshi
Member
From: Japan
Registered: 2018-10-12
Posts: 186

### Re: [solved]applying time and space varying function as boundary condition

P_func_Z = FORMULE(NOM_PARA=('INST','Z',),
VALE='INST * Z * 0.1');

PRES=P_func_Z))

With the code shown above, the pressure "P_func_Z" will be applied thoughout the "Group_loadWater260" from Z=0 to Z=HeightOfDam. This is not the case. When water level rises (with time), the pressure should be applied upto the water level at that instant only, any other part should have pressure zero.

As  I mentioned earlier, at every time step z1, z2 and p1, p2 will change (see code below); so, the forumla mentioned above will not be correct.

P_func_Z = DEFI_FONCTION(NOM_PARA='Z',
VALE=(z1, p1, z2, p2))

Last edited by nirmaljoshi (2020-04-16 01:48:34)

Offline