[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[TRNSYS-users] pb while creating a type



Dear users,

I'm writing a user Type for trnsys and I' facing a problem.
Xe is an input of the type (outside relative humidity).
Xsouffl is an output and can be equal to 0 or to Xe while another condition is equal to 0.

Here, the condition is equal to 0 and Xsouffl should be equal to Xe or to 0 which is fast the case...
You can see in the table below, a move back of one time step between the value of Xe and the value of Xsouffl. And sometimes the move back disapears. I didn't found any rules and I don't know where this problem could come from.

 

TIME                   

Xsouffl c

Xe  

1

0

0.00625815

2

0

0.00617362

3

0

0.0061206

4

0

0.00613734

5

0

0.00612341

6

0

0.00606683

7

0

0.00607641

8

0

0.00612489

9

0.00612489

0.00612833

10

0.0063213

0.0063213

11

0.0064191

0.0064191

12

0.0064191

0.00654528

13

0.00654528

0.0066564

14

0.0066564

0.00674369

15

0.00674369

0.00669912

16

0.00669912

0.00670094

17

0.00670094

0.00660211

18

0.00660211

0.00650828

19

0.00650828

0.00650828

20

0.00650828

0.00650134

21

0.00650134

0.00637111

22

0.00637111

0.00636302

23

0.00627747

0.00627747

 Here is the fortran code concerning Xsouffl :


    If (Qsouffl.GT.(0)) then

        if((signalBF.EQ.(1)).and.(Trec_postvent>Tsouffl)) then
            If(Xfr<Xext) then
                Xsouffl = max((Xfr-Xext)/(T_point_froid-Trec_postvent)*Tsouffl+(T_point_froid*Xext-Xfr*Trec_postvent)/(T_point_froid-Trec_postvent),Xfr)
            else
                Xsouffl = Xext
            endif
        else
            Xsouffl = Xext
        endif
   
    else
            Xsouffl = 0

    Endif


Do you have any idea ?

Best,

Ewen