Flow123d  jenkins-Flow123d-linux-release-multijob-282
che_semchem.h
Go to the documentation of this file.
1 #ifndef BIGHEAD
2 #define BIGHEAD
3 /********************************************************************/
4 /* BIG-HEAD.H GEN-TRAN Verse 1.0 */
5 /********************************************************************/
6 #define DOS /* Prepinac DOS X UNIX */
7 #define VERB /* Upovidany vystup */
8 #define S_BOOL int
9 
10 #ifdef MAIN
11  #define EX
12 #else
13  #define EX extern
14 #endif
15 
16 #ifndef MAXPATH
17  #define MAXPATH 2048
18 #endif
19 #define MAX_POC_LATEK 200
20 #define MAX_POC_PARAM_SORPCE 5
21 #define ACCURACY 1e-12
22 
23 #define fnsplit _splitpath // ! Dressler 24.08.2001
24 #define fnmerge _makepath // ! Dressler 24.08.2001
25 #ifdef DOS
26  #include <dirent.h>
27 #endif
28 #include <stdlib.h> // ! Dressler 24.08.2001
29 #include <math.h>
30 #include <stdio.h>
31 #include <time.h>
32 #ifdef MAIN
33  #define EX
34 #else
35  #define EX extern
36 #endif
37 
38 /********************************************************************/
39 
40 // mh: kompiluju flow/tran
41 #define PROGRAM_TRAN
42 
43 /********************************************************************/
44 
45 #ifndef SKUPINY_MATERIALU
46  #define SKUPINY_MATERIALU
47 #endif //SKUPINY_MATERIALU
48 /*------------------------------------------------------------------*/
49 
50 #ifndef SKUPINA_SCENAR
51  #define SKUPINA_SCENAR
52 #endif // SKUPINA_SCENAR
53 /*------------------------------------------------------------------*/
54 
55 #ifndef SKUPINA_STENY
56  #define SKUPINA_STENY
57 #endif // SKUPINA_STENY
58 /*------------------------------------------------------------------*/
59 
60 #ifndef SKUPINA_RESICE
61  #define SKUPINA_RESICE
62 #endif // SKUPINA_RESICE
63 /*------------------------------------------------------------------*/
64 
65 #ifndef SKUPINA_TRANSPORT
66  #define SKUPINA_TRANSPORT
67 #endif // SKUPINA_TRANSPORT
68 /*------------------------------------------------------------------*/
69 
70 #ifndef SKUPINA_DUALPOROSITY
71  #define SKUPINA_DUALPOROSITY
72 #endif // SKUPINA_DUALPOROSITY
73 
74 /*------------------------------------------------------------------*/
75 
76 #ifndef SKUPINA_REAKCE
77  #define SKUPINA_REAKCE
78 #endif // SKUPINA_REAKCE
79 /********************************************************************/
80 #define MAXK1LM1 2 /* Max. pocet koeficientu v MELM */
81 #define MAXELKOEF 10 /* Max. pocet koeficientu v ELM */
82 #define MAXMATRKOEF 7 /* Max. pocet koef. v matr. */
83 #define MAXDPORKOEF 3 /* Max. pocet koef. v DUAL POROSITY */
84 /********************************************************************/
85 #define NLENSPO 16 /* Pocet znaku popisu slozky R + H */
86 #define NLENPVR 5 /* Maximalni delka popisu vrstev */
87 /********************************************************************/
88 #define RUN_OK 0
89 #define RUN_ERROR 1
90 /********************************************************************/
91 // mh: kompiluju flow/tran
92 #define PRG_NAME "tran"
93 /********************************************************************/
94 /********************************************************************/
95 /* Definice globalnich promennych */
96 /********************************************************************/
97 /* Vseobecne paramatry */
98 /********************************************************************/
99 EX int G_argc;
100 EX char **G_argv;
104 EX int NULA;
106 /*------------------------------------------------------------------*/
107 #ifdef SKUPINA_RESICE
109 #endif // SKUPINA_RESICE
110 /*------------------------------------------------------------------*/
111 #ifdef SKUPINA_CHEMIE
112 EX int G_cas_chemie;
113 #endif // SKUPINA_CHEMIE
114 /********************************************************************/
115 /* Seznam sousedu danych sten ( -1 = vnejsi stena ) */
116 /********************************************************************/
117 #ifdef SKUPINA_STENY
118  EX int *P_Steny;
119 #endif // SKUPINA_STENY
120 /********************************************************************/
121 /* Vektory pro ulozeni soustavy linearnich rovnic */
122 /********************************************************************/
123 #ifdef SKUPINA_RESICE
124  EX int *P_i, *P_j;
125  EX double *P_MM, *P_MR, *P_MX;
126 #endif // SKUPINA_RESICE
127 /********************************************************************/
128 /* Vektory pro ulozeni slozek pro transport */
129 /********************************************************************/
130 #ifdef SKUPINA_TRANSPORT
131  EX double *P_rslo;
132  EX double *P_rslo_new;
133  #ifdef SKUPINA_DUALPOROSITY
134  EX double *P_rslo_por;
135  #endif // SKUPINA_DUALPOROSITY
136  EX double *P_sod;
137 #endif // SKUPINA_TRANSPORT
138 /********************************************************************/
139 /* Definice datovych struktur */
140 /********************************************************************/
141 /* Globalni parametry modelu */
142 /********************************************************************/
143 struct S_glp
144 {
146 /*------------------------------------------------------------------*/
148 /*------------------------------------------------------------------*/
149  int nmuzl; /* pocet multiuzlu rovinnych */
150  int nuzl; /* pocet uzlu prostorovych */
151  int nmelm; /* pocet multielm rovinnych */
152  int nmkoef; /* pocet koeficientu pro MElm */
153  int nelm; /* pocet elementu prostorovych */
154  int nelm_0; /* pocet placatych elementu */
155  int nkoef; /* pocet koeficientu pro element */
156  int nsmume; /* pocet sousedu MU->ME */
157 /*------------------------------------------------------------------*/
158  int nstnex; /* pocet vnejsich sten */
159  int nstnin; /* pocet vnitrnich sten */
160 /*------------------------------------------------------------------*/
161  int nvrst; /* pocet vrstev v siti */
162 /*------------------------------------------------------------------*/
163  int nsez; /* pocet kroku scenare vypoctu */
164  int noke; /* pocet radku OKE */
165 /*------------------------------------------------------------------*/
166 #ifdef SKUPINY_MATERIALU
167  int nmatr; /* pocet skupin materialu */
168 #endif // SKUPINY_MATERIALU
169 /*------------------------------------------------------------------*/
170 #ifdef SKUPINA_DUALPOROSITY
171  S_BOOL sw_DP_apply; /* pocitat s dvoji porozitou */
172  int ndpor; /* pocet skupin DUAL_POROSITY */
173 #endif // SKUPINA_DUALPOROSITY
174 /*------------------------------------------------------------------*/
175 #ifdef SKUPINA_INTERTRANSFER
176  S_BOOL sw_CTR_apply; /* pocitat INTERTRANSFER */
177  int nctr; /* pocet skupin INTERTRANSFER */
178 #endif // SKUPINA_INTERTRANSFER
179 /*------------------------------------------------------------------*/
180 #ifdef SKUPINA_TRANSPORT
181  int nvod; /* pocet typu vod */
182 /*------------------------------------------------------------------*/
183  S_BOOL time_analysis; /* rozbor casoveho kroku */
184  S_BOOL quazi_unsteady; /* kvazi nestacionarni uloha */
185  S_BOOL write_waters; /* vypsat nalezene vody */
186 /*..................................................................*/
189 #ifdef SKUPINA_DUALPOROSITY
190  char jmeno_sini[ MAXPATH ]; // mh: zvlast POC pro slepe pory
191  char jmeno_spop[ MAXPATH ]; // mh: zvlast POP pro slepe pory
192 #endif // SKUPINA_DUALPOROSITY
193  int nrslo; /* pocet slozek Roztoku - POP */
194 /*..................................................................*/
195  int nrlimit; /* pocet limitu Roztoku */
196  char plimit[ NLENSPO +1 ]; /* popis limitni slozky Roztoku */
197  double *rlimit; /* hodnoty limitu Roztoku */
198  int irlimit; /* index limitni slozky Roztoku */
199 /*..................................................................*/
200  double Eps_Qs; /* Maximalni chyba bilance vnitrni steny */
201  double Eps_Qe; /* Maximalni chyba bilance Elementu */
202 #endif // SKUPINA_TRANSPORT
203 /*------------------------------------------------------------------*/
204 #ifdef SKUPINA_CHEMIE
205  S_BOOL sw_Chem_WriteSet; /* Vypsat nastaveni chemie 0-NE, 1-ano */
206  S_BOOL sw_Chem_Consist; /* Vyzadovat konzistenci 0-ne, 1-ANO */
207  char jmeno_chem_cfg[ MAXPATH ];
208  char jmeno_chem_err[ MAXPATH ];
209  TChemie *Chem_Chem;
210  TChemieBloku **Chem_Blok;
211  char jmeno_hini[ MAXPATH ];
212  char jmeno_hpop[ MAXPATH ];
213  int nhslo; /* pocet slozek Horniny - POP */
214  S_BOOL sw_kapalna; /* Pocita se s KAPALNOU fazi */
215  S_BOOL sw_pevna; /* Pocita se s PEVNOU fazi */
216  S_BOOL sw_plyn; /* Pocita se s PLYNNOU fazi */
217 // S_BOOL sw_sorpce; /* Pocita se s SORBOVANOU fazi */
218  S_BOOL sw_redox; /* Pocita se s REDOX fazi */
219  S_BOOL sw_radio; /* Pocita se s RADIO fazi */
220  S_BOOL sw_vlastnosti; /* Pocita se s VLASTNOSTMI */
221 #endif // SKUPINA_CHEMIE
222 /*------------------------------------------------------------------*/
223  int pis_log;
224 /*------------------------------------------------------------------*/
225  char sit_popis[ 80 ]; /* popis site */
226  float sit_alfa; /* uhel anizotropie */
227  int sit_nvrst; /* max. pocet vrstev site */
228 };
229 EX struct S_glp G_glp;
230 /********************************************************************/
231 /* Popis MultiElementu a Elementu ( soubor .STE ) */
232 /********************************************************************/
233 struct S_melm // multielement
234 {
235  int oznac; /* oznaceni Melementu < 0 zrusen */
236  int ipelm; /* inter. cislo prvniho elementu */
237  int npelm; /* pocet elementu v tomtom Melm */
238  int muzl[ 3 ]; /* interni cisla prirazenych Muzlu */
239  int ipz0[ 3 ]; /* poradove cislo startovni z-ovky */
240  float k1lm1[ MAXK1LM1 ]; /* koeficienty MElm */
241  int oblast; /* cislo oblasti obsahujici Melm */
242  int odv; /**/
243  int dov; /**/
244 /*------------------------------------------------------------------*/
245  double sumtok; /* souhrny prutok MELM do okoli */
246 };
247 EX struct S_melm *P_melm;
248 /********************************************************************/
249 struct S_elm // element
250 {
251  int imelm; /* interni cislo Multielementu */
252  int ivrst; /* cislo vrtvy */
253  int imatr; /* cislo materialu */
254  // sem je nactena hodnota z *.stm, je kopirovano do idpor (pro dvoji porozitu, jinak se nepouziva)
255  float koef[ MAXELKOEF ]; /* koeficienty elementu */
256 /*------------------------------------------------------------------*/
257 #ifdef SKUPINA_DUALPOROSITY
258  int idpor; /* index S_DPOR */
259 #endif // SKUPINA_DUALPOROSITY
260 /*------------------------------------------------------------------*/
261  double vyska; /* piezometricka vyska v T ELM */
262  double tlak; /* tlak v T ELM */
263  double stntlk[ 5 ]; /* tlak v T steny */
264  double stntok[ 5 ]; /* pretok stenou */
265  double bilance; /* bilance ELM */
266  int stnvod[ 6 ]; /* typ vody prochazejici stenou */
267 /*------------------------------------------------------------------*/
268  double objem; /* objem ELM */
269  double porobjm; /* porovy objem ELM */
270  double porobjm_por; /* porovy objem ELM poru */
271 /*------------------------------------------------------------------*/
272 #ifdef SKUPINA_TRANSPORT
273  double *rslo; /* koncentrace slozek roztoku */
274  double *rslonew; /* koncentrace slozek roztoku */
275  #ifdef SKUPINA_DUALPOROSITY
276  double *rslo_por; /* koncentrace slozek poroveho roztoku */
277  double *rslonew_por; /* koncentrace slozek poroveho roztoku */
278  #endif // SKUPINA_DUALPOROSITY
279 #endif // SKUPINA_TRANSPORT
280 /*------------------------------------------------------------------*/
281 #ifdef SKUPINA_CHEMIE
282  TChemieElementuD *Chem;
283  double *vslo; /* slozky vlastnost */
284  double *hslo; /* koncentrace slozek horniny */
285  double *pslo; /* koncentrace slozek plynny */
286  #ifdef SKUPINA_DUALPOROSITY
287  TChemieElementuD *Chem_por;
288  double *vslo_por; /* slozky porove vlastnost */
289  double *hslo_por; /* koncentrace slozek porove horniny */
290  double *pslo_por; /* koncentrace slozek porove plynny */
291  #endif // SKUPINA_DUALPOROSITY
292 #endif // SKUPINA_CHEMIE
293 /*------------------------------------------------------------------*/
294 #ifdef SKUPINA_REAKCE
295  double sorpcni_plocha; /* sorpcni plocha ELM poru */
296  double *hslo; /* koncentrace slozek horniny */
297  double *pslo; /* koncentrace slozek plynny */
298  #ifdef SKUPINA_DUALPOROSITY
299  double sorpcni_plocha_por; /* sorpcni plocha ELM porove horniny*/
300  double *hslo_por; /* koncentrace slozek porove horniny */
301  double *pslo_por; /* koncentrace slozek porove plynny */
302  #endif // SKUPINA_DUALPOROSITY
303 #endif // SKUPINA_REAKCE
304 /*------------------------------------------------------------------*/
305  double cas_koef;
307 };
308 EX struct S_elm *P_elm;
309 /********************************************************************/
310 /* Popis MultiUzlu a Uzlu ( soubor .STU ) */
311 /********************************************************************/
312 struct S_muzl
313 {
314  int oznac; /* oznaceni multiuzlu */
315  int ismelm; /* prvni sousedni multielem */
316  int nsmelm; /* pocet sousednich multielem */
317  int ipuzl; /* interni cislo prvniho uzlu */
318  int npuzl; /* pocet uzlu v multiuzlu */
319  double x, y; /* souradnice multiuzlu */
320  double z_povrch; /* Z-tova souradnice povrchu */
321  int odp; /**/
322  int dop; /**/
323 };
324 EX struct S_muzl *P_muzl;
325 /********************************************************************/
326 struct S_uzl
327 {
328  int imuzl; /* interni cislo MultiUzlu */
329  double z0; /* vyska daneho uzlu */
330 };
331 EX struct S_uzl *P_uzl;
332 /********************************************************************/
333 /* Popis sousednich MultiElm k danemu MultiUzl */
334 /********************************************************************/
335 struct S_smume
336 {
337  int muzl; /* multiuzel */
338  int melm; /* sousedni multielement */
339 };
341 /********************************************************************/
342 /* Popis typu cerpanych a vtlacenych vod */
343 /********************************************************************/
344 struct S_vod
345 {
346  int typ; /* typ vody */
347  char nazev[ 128 ]; /* nazev typu vody */
348 /*------------------------------------------------------------------*/
349  S_BOOL sw_OSM; /* Zapisovat hmotnosti vy. latek */
350  S_BOOL sw_OSC; /* Zapisovat koncentraci */
351 /*------------------------------------------------------------------*/
352 // Okamzite koncentrace
353  double *vrslo; /* koncentrace slozek vtlaceneho ROZTOKU */
354  double *crslo; /* koncentrace slozek cerpaneho ROZTOKU */
355 /*------------------------------------------------------------------*/
356 // Absolutni objemy a hmotnosti od casu NULA
357  double Cobjem; /* objem cerpane vody */
358  double *Chmota; /* hmotnost cerpanych slozek */
359  double Vobjem; /* objem vtlacene vody */
360  double *Vhmota; /* hmotnost vtlacenych slozek */
361 /*------------------------------------------------------------------*/
362 // Relativni objemy a hmotnosti od zacatku kroku TRAN
363  double CKobjem; /* objem cerpane vody */
364  double *CKhmota; /* hmotnost cerpanych slozek */
365  double VKobjem; /* objem vtlacene vody */
366  double *VKhmota; /* hmotnost vtlacenych slozek */
367 /*------------------------------------------------------------------*/
368 // Pracovni objemy a hmotnosti
369  double WCobjem; /* objem cerpane vody */
370  double *WChmota; /* hmotnost cerpanych slozek */
371  double WVobjem; /* objem vtlacene vody */
372  double *WVhmota; /* hmotnost vtlacenych slozek */
373 };
374 #ifdef SKUPINA_TRANSPORT
375 EX struct S_vod *P_vod;
376 #endif // SKUPINA_TRANSPORT
377 /********************************************************************/
378 /* Popis a obsah vrstev */
379 /********************************************************************/
380 struct S_pvr
381 {
382  char popis[ NLENPVR +1 ]; /* popis (oznaceni) vrstvy */
383  int ipslo; /* interni cislo prvni slozky */
384 };
385 EX struct S_pvr *P_pvr;
386 /********************************************************************/
387 /* Popis slozek Roztoku */
388 /********************************************************************/
389 struct S_rpo
390 {
391  char popis[ NLENSPO +1 ]; /* popis slozky Roztoku */
392  char unit[ 5 ]; /* jednotka slozky [g/l mg/l] */
393  int to_chem; /* ukazatel do vektoru chemie */
394 #ifdef SKUPINA_DUALPOROSITY
395  // mh:
396  double difus_koef_DP; /* relativni koef difuze pro dualni porozitu*/
397 #endif // SKUPINA_DUALPOROSITY
398 
399 /*------------------------------------------------------------------*/
400 };
401 #ifdef SKUPINA_TRANSPORT
402  EX struct S_rpo *P_rpo;
403 #endif // SKUPINA_TRANSPORT
404 /********************************************************************/
405 /* Popis slozek Horniny */
406 /********************************************************************/
407 struct S_hpo
408 {
409  char popis[ NLENSPO +1 ]; /* popis slozky Horniny */
410  char unit[ 4 ]; /* jednotka slozky [hm%] */
411  int to_chem; /* ukazatel do vektoru chemie */
412 /*------------------------------------------------------------------*/
413 };
414 #ifdef SKUPINA_CHEMIE
415  EX struct S_hpo *P_hpo;
416 #endif // SKUPINA_CHEMIE
417 /********************************************************************/
418 /* Seznam okrajovych podminek */
419 /********************************************************************/
420 struct S_sez
421 {
422  char fname[ MAXPATH ];
423  char txt[ 80 ]; /* Popis dane OKP */
424  int ipoke; /* interni cislo OKE */
425  int npoke; /* Pocet OKE */
426  double srazky; /* Destove srazky v mm . rok^-1 */
427  double dt; /* Casovy krok */
428  int NK_Flow; /* Pocet casovych kroku FLOW */
429 /*------------------------------------------------------------------*/
430 #ifdef SKUPINA_TRANSPORT
431  char iname[ MAXPATH ]; /* Jmeno INI souboru OKP */
432  int NK_Tran; /* Pocet casovych kroku TRAN */
433 #endif // SKUPINA_TRANSPORT
434 /*------------------------------------------------------------------*/
435 #ifdef SKUPINA_CHEMIE
436  int NK_Chem; /* Pocet casovych kroku CHEM */
437 #endif // SKUPINA_CHEMIE
438 /*------------------------------------------------------------------*/
439  int NK_Result; // pocet casovych kroku pro vystup do TS3 a BIN
440  int NK_sez; /* Pocet casovych kroku F_T_Ch */
441 };
442 #ifdef SKUPINA_SCENAR
443  EX struct S_sez *P_sez;
444 #endif // SKUPINA_SCENAR
445 /********************************************************************/
446 /* Popis okrajovych podminek - novy typ OKE */
447 /********************************************************************/
448 struct S_oke
449 {
450  int typ; /* typ okrajove podminky */
451  int ivoda; /* typ vody */
452  float hodnota_oke; /* zadana hodnota OKE */
453  float koeficient_oke; /* koeficient OKE */
454 /*------------------------------------------------------------------*/
455  int ie_od; /* interni cislo Elm (dolniho) */
456  int ie_do; /* interni cislo Elm (horniho) */
457  int iis; /* interni cislo steny */
458 /*------------------------------------------------------------------*/
459  int zapnuto; /* priznak zapnuti OKE */
460 };
461 #ifdef SKUPINA_SCENAR
462  EX struct S_oke *P_oke;
463 #endif // SKUPINA_SCENAR
464 /********************************************************************/
465 /* Popis typu materialu pro nenasycene proudeni (z INI souboru) */
466 /********************************************************************/
467 struct S_matr
468 {
469  int typ; /* typ materialu */
470  int funkce; /* funkce pro dany material */
471  double S_min; /* Minimalni saturace */
472  double Kr_min; /* Minimalni koef. rel. prop. */
473  int nkoef; /* pocet koef dane funkce */
474  double koef[ MAXMATRKOEF ]; /* koeficienty pro danou funkci */
475 };
476 #ifdef SKUPINY_MATERIALU
477  EX struct S_matr *P_matr;
478 #endif // SKUPINY_MATERIALU
479 /********************************************************************/
480 /* Popis typu materialu pro DUAL POROSITY (z INI souboru) */
481 /********************************************************************/
482 struct S_dpor
483 {
484  int typ; /* typ materialu */
485  int funkce; /* funkce pro dany material */
486  int nkoef; /* pocet koef. dane funkce */
487  double koef[ MAXDPORKOEF ]; /* koeficienty pro danou funkci */
488 };
489 #ifdef SKUPINA_DUALPOROSITY
490  EX struct S_dpor *P_dpor;
491 #endif // SKUPINA_DUALPOROSITY
492 /********************************************************************/
493 /* Popis prechodu pro INTERTRANSFER (z INI souboru) */
494 /********************************************************************/
495 struct S_ctr
496 {
497  int ivrst; /* index sledovane vrstvy */
498  int ikoef_melm; /* index prepocivaciho koef. */
499  double UP_hmota;
500  double DOWN_hmota;
501 };
502 #ifdef SKUPINA_INTERTRANSFER
503  EX struct S_ctr *P_ctr;
504 #endif // SKUPINA_INTERTRANSFER
505 //
506 /********************************************************************/
507 /* Definice funkci */
508 /********************************************************************/
509 /* Cteni vstupnich dat */
510 /********************************************************************/
511 void ctimmf( void ); /* Nacteni parametru ze souboru .INI */
512 void ctiuzl( void ); /* Nacteni uzlu ze souboru .UZL */
513 void ctielm( void ); /* Nacteni elementu ze souboru .ELM */
514 void ctistu( void ); /* Nacteni uzlu ze souboru .STU */
515 void ctiste( void ); /* Nacteni elementu ze souboru .STE */
516 void ctistm( void ); /* Nacteni koef. Elm ze souboru .STM */
517 void smume( void ); /* Vytvoreni struktury SMUME */
518 /*------------------------------------------------------------------*/
519 void ctihdm( int, int ); /* Nacteni souboru hydrodynamiky .HDM */
520 void nastav_slozky( void );
521 void uvolni_slozky( void );
522 void ctipop( int ); /* Nacteni pocatecnich podminek .POP */
523 /*------------------------------------------------------------------*/
524 void inicializace_S_vod( void );
525 void uvolneni_S_vod( void );
526 /*------------------------------------------------------------------*/
527 void sumace( double );
528 
529 //mh:
530 #ifdef SKUPINA_DUALPOROSITY
531  void init_DP_mater( void ); // nastaveni indexu materialu pro DP
532 #endif // SKUPINA_DUALPOROSITY
533 
534 /********************************************************************/
535 /* Zapis vystupnich dat */
536 /********************************************************************/
537 void pis_TS2( double ); /* Zapis souboru roztoku po vrst. .TS2 */
538 #ifdef SKUPINA_DUALPOROSITY
539  int pisTS34( int, int, double ); /* Zapis vysledku do .TS3 nebo .TS4 */
540  #else //SKUPINA_DUALPOROSITY
541  int pisTS34( int, double ); /* Zapis vysledku do .TS3 nebo .TS4 */
542 #endif // SKUPINA_DUALPOROSITY
543 int pisDF0( double, double, int ); /* Zapis vysledku do .DF0 */
544 int pisDF1( double, double, int ); /* Zapis vysledku do .DF1 */
545 int pisDF2( double, double, int ); /* Zapis vysledku do .DF2 */
546 // mh: (doplneno df3 na vystup koncentraci)
547 int pisDF3( double, double, int ); /* Zapis vysledku do .DF3 */
548 void otevri_bin( int );
549 void pis_bin( int, float * );
550 void zavri_bin( void );
551 int pisPOP(char*) ; // zapis POP z hodnot na konci vypoctu
552 /********************************************************************/
553 /* Pripravne vypocty */
554 /********************************************************************/
555 void *seznam_sten( int ); /* Vytvari seznam sousednich sten */
556 /********************************************************************/
557 /* Utility pro pripravne vypocty */
558 /********************************************************************/
559 int uzl_pro_elm( int, int ); /* vraci cislo uzlu pro ELM a iUZL */
560 int iuzl_pro_elm( int, int ); /* vraci iUZL pro ELM a UZL */
561 void buble_sort( int *, int ); /* Bublinove trideni */
562 /********************************************************************/
563 /* Vlastni vypocet */
564 /********************************************************************/
565 void vypocet( void ); /* Ridici program vypoctu */
566 void sestmat( void ); /* Sestaveni globalni matice */
567 void objemy( void ); /* vypocet objemu elementu */
568 void nej_spolky( int, int, int, int *, int * );
569 int caskrok( double ); /* vypocet casoveho kroku */
570 /********************************************************************/
571 /* Souborove UTILITY */
572 /********************************************************************/
573 char *fjmeno( char *, char * ); /* Cele jmenu souboru */
574 FILE *fotevri( char *, const char * ); /* Otevreni souboru */
575 int aktualnejsi_soubor( char *, char * );
576 /********************************************************************/
577 /* Behove UTILITY */
578 /********************************************************************/
579 void Start_programu( char * ); /* Pocatecni hlavicka programu */
580 void Konec_programu( char * ); /* Hlavicka ukonceni behu program */
581 void Prerus_program( char *, int ); /* Hlavicka ukonceni behu programu */
582 /********************************************************************/
583 /* Casove UTILITY */
584 /********************************************************************/
585 char *mezi_cas( int ); /* Vraci string - mezicas vypoctu */
586 /********************************************************************/
587 /* Pametove UTILITY */
588 /********************************************************************/
589 void malo_pameti( char *, char *, int ); /* Hlaska malo pameti */
590 void pole_je_male( int, char *, int, char * ); /* Hlaska male pole */
591 /********************************************************************/
592 /* Logovaci UTILITY */
593 /********************************************************************/
594 void smazlog( void );
595 void pislog( char *, ... );
596 void pisscr( char *, ... );
597 /********************************************************************/
598 /* Vystup na obrazovku pro TRANSPORT */
599 /********************************************************************/
600 void win_tran_START( char * );
601 void win_tran_STOP( void );
602 void pis_Tran( char *fmt, ... );
603 /*------------------------------------------------------------------*/
604 /* Testy */
605 /*------------------------------------------------------------------*/
606 void cesta_k_souboru_sestav( char *, char *, char * );
607 /********************************************************************/
608 /* copied from che_head.h to simplify structure of inclusions */
609 /********************************************************************/
610 /* vim: set ts=3 sw=3 expandtab: */
611 
612 struct TS_prm //typedef struct
613 {
623  double T; //long long double
624  double TGf; //long long double
625  double Afi; //long double
626  double b; //long double
627  double epsilon; //long double
628  double omega; //long double
629  double deltaT; //long double
630  double objem; //long double
631  double splocha; //long double
633  int vypisy;
637 }; //TS_prm;
638 
639 struct TS_lat //typedef struct
640 {
641  char nazev[ 80 ]; /* Jmeno latky */
642  double m0; /* pocatecni molalita *///long double
643  double m; /* konecna molalita *///long double
644  double M; /* molarni hmotnost *///long double
645  double dGf; /* prispevek ke Gibbsove energii *///long double
646  double dHf; /* prispevek k entalpii *///long double
647  int Q; /* naboj */
648  double aktivita; /* aktivita *///long double
649  int typ_sorpce; /* typ sorpce */
650  double param_sorpce[MAX_POC_PARAM_SORPCE];//long double
651 }; //TS_lat;
652 
653 struct TS_che //typedef struct
654 {
655  char nazev[ 80 ]; /* Jmeno reakce */
656  int stech_koef_p[MAX_POC_LATEK]; /* Stechiom.koef.slozek vpravo*/
657  double K; /*rovnovazna, nebo kineticka konstanta, nebo bilance*///long double
658  int typ_reakce; /* 0==rovnovazna, 1==kineticka, 2==bilancni, 3==pomala kinetika */
659  double exponent[MAX_POC_LATEK]; /* exponenty pro kinetiku*///long double
660  double zeta0; /*pocatecni posunuti reakce*///long double
661 }; //TS_che;
662 
663 //---------------------------------------------------------------------------
664 // Funkce z che_semchem.cpp
665 //---------------------------------------------------------------------------
666 void che_nactenichemie( void ); /* funkce nacteni chemie */
667 void ctiich (void); /*pomocna funkce nacteni chemie*/
668 
669 /********************************************************************/
670 /* copied from cti_ichnew.c to simplify structure of inclusions */
671 /********************************************************************/
672 
673 float che_poradi(int param1, double param2, double param3);
674 void ctiich_obecne(void);
675 void ctiich_latkyvefazi(void);
676 void ctiich_dalsilatky(void);
677 void ctiich_reakce(void);
678 float che_poradi (int typ_reakce, double max, double K);
679 void che_pocitej_soubor(char *soubor, int *poc_krok);
680 void che_presun_poc_p_(void);
681 
682 /********************************************************************/
683 /* copied from semchem_interface.hh to simplify structure of inclusions */
684 /********************************************************************/
685 void che_outpocp_soubor(FILE *fw);
686 void che_pocitej_soubor(char *soubor, int *poc_krok);
687 void che_vypis_soubor(char *soubor);
688 void che_presun_poc_p_(void);
689 void che_vypis__soubor(char *soubor);
690 
691 
692 #endif
int oblast
Definition: che_semchem.h:241
double Cobjem
Definition: che_semchem.h:357
int oznac
Definition: che_semchem.h:314
double * hslo_por
Definition: che_semchem.h:300
void win_tran_STOP(void)
int ipelm
Definition: che_semchem.h:236
double * rslonew
Definition: che_semchem.h:274
double omega
Definition: che_semchem.h:628
char unit[4]
Definition: che_semchem.h:410
EX struct S_dpor * P_dpor
Definition: che_semchem.h:490
FILE * fotevri(char *, const char *)
int melm
Definition: che_semchem.h:338
double difus_koef_DP
Definition: che_semchem.h:396
#define MAX_POC_LATEK
Definition: che_semchem.h:19
void che_vypis_soubor(char *soubor)
Definition: che_semchem.cc:23
double K
Definition: che_semchem.h:657
int pisDF1(double, double, int)
int pocet_kinetik
Definition: che_semchem.h:620
int ipuzl
Definition: che_semchem.h:317
int nsmelm
Definition: che_semchem.h:316
int muzl
Definition: che_semchem.h:337
char jmeno_spop[MAXPATH]
Definition: che_semchem.h:191
double porobjm_por
Definition: che_semchem.h:270
int odv
Definition: che_semchem.h:242
int pocet_latekvefazi
Definition: che_semchem.h:616
double * VKhmota
Definition: che_semchem.h:366
double * CKhmota
Definition: che_semchem.h:364
char plimit[NLENSPO+1]
Definition: che_semchem.h:196
EX int G_cas_resice
Definition: che_semchem.h:108
int skaluj_matici
Definition: che_semchem.h:635
EX double * P_rslo_new
Definition: che_semchem.h:132
int typ
Definition: che_semchem.h:469
void smume(void)
void win_tran_START(char *)
void che_presun_poc_p_(void)
#define MAXMATRKOEF
Definition: che_semchem.h:82
int muzl[3]
Definition: che_semchem.h:238
int pisDF2(double, double, int)
int ivrst
Definition: che_semchem.h:497
void ctiich_reakce(void)
Definition: che_read.cc:403
int imelm
Definition: che_semchem.h:251
#define MAXELKOEF
Definition: che_semchem.h:81
int typ
Definition: che_semchem.h:346
int stnvod[6]
Definition: che_semchem.h:266
void uvolni_slozky(void)
void smazlog(void)
EX char ** G_argv
Definition: che_semchem.h:100
int typ_reakce
Definition: che_semchem.h:658
int nkoef
Definition: che_semchem.h:473
S_BOOL sw_OSC
Definition: che_semchem.h:350
char jmeno_MMF[MAXPATH]
Definition: che_semchem.h:145
int typ
Definition: che_semchem.h:484
double Eps_Qs
Definition: che_semchem.h:200
void pisscr(char *,...)
int ie_od
Definition: che_semchem.h:455
char jmeno_site[MAXPATH]
Definition: che_semchem.h:147
int NK_sez
Definition: che_semchem.h:440
int pisDF0(double, double, int)
EX int G_argc
Definition: che_semchem.h:99
double WVobjem
Definition: che_semchem.h:371
double sorpcni_plocha_por
Definition: che_semchem.h:299
double z0
Definition: che_semchem.h:329
int dop
Definition: che_semchem.h:322
char jmeno_rpop[MAXPATH]
Definition: che_semchem.h:188
void ctiich_obecne(void)
Definition: che_read.cc:10
int npelm
Definition: che_semchem.h:237
int iis
Definition: che_semchem.h:457
#define MAX_POC_PARAM_SORPCE
Definition: che_semchem.h:20
void objemy(void)
int nmelm
Definition: che_semchem.h:151
void ctipop(int)
int nelm_0
Definition: che_semchem.h:154
S_BOOL sw_OSM
Definition: che_semchem.h:349
char txt[80]
Definition: che_semchem.h:423
EX struct S_melm * P_melm
Definition: che_semchem.h:247
EX struct S_uzl * P_uzl
Definition: che_semchem.h:331
char popis[NLENSPO+1]
Definition: che_semchem.h:409
char unit[5]
Definition: che_semchem.h:392
int cas_kroku
Definition: che_semchem.h:632
double * hslo
Definition: che_semchem.h:296
void uvolneni_S_vod(void)
double * rslo
Definition: che_semchem.h:273
int funkce
Definition: che_semchem.h:485
EX struct S_elm * P_elm
Definition: che_semchem.h:308
char * fjmeno(char *, char *)
EX char * G_mezi_cas
Definition: che_semchem.h:103
double y
Definition: che_semchem.h:319
#define MAXDPORKOEF
Definition: che_semchem.h:83
double deltaT
Definition: che_semchem.h:629
#define NLENSPO
Definition: che_semchem.h:85
int uzl_pro_elm(int, int)
EX int * P_j
Definition: che_semchem.h:124
void pislog(char *,...)
char * mezi_cas(int)
int nrslo
Definition: che_semchem.h:193
int ismelm
Definition: che_semchem.h:315
void che_pocitej_soubor(char *soubor, int *poc_krok)
int iuzl_pro_elm(int, int)
int pisTS34(int, int, double)
double epsilon
Definition: che_semchem.h:627
int pocet_pom_kin
Definition: che_semchem.h:621
#define S_BOOL
Definition: che_semchem.h:8
int pocet_reakci_pro_matici
Definition: che_semchem.h:618
double tlak
Definition: che_semchem.h:262
double b
Definition: che_semchem.h:626
void ctielm(void)
void malo_pameti(char *, char *, int)
int ivrst
Definition: che_semchem.h:252
int vypisy
Definition: che_semchem.h:633
char nazev[128]
Definition: che_semchem.h:347
int npoke
Definition: che_semchem.h:425
double Afi
Definition: che_semchem.h:625
int oznac
Definition: che_semchem.h:235
void ctihdm(int, int)
EX struct S_smume * P_smume
Definition: che_semchem.h:340
char iname[MAXPATH]
Definition: che_semchem.h:431
int nvrst
Definition: che_semchem.h:161
EX int * P_i
Definition: che_semchem.h:124
int odp
Definition: che_semchem.h:321
void che_outpocp_soubor(FILE *fw)
Definition: che_semchem.cc:48
#define MAXK1LM1
Definition: che_semchem.h:80
void otevri_bin(int)
EX char * G_Program_name
Definition: che_semchem.h:101
int pocet_rovnovah
Definition: che_semchem.h:619
char nazev[80]
Definition: che_semchem.h:641
EX struct S_vod * P_vod
Definition: che_semchem.h:375
int typ
Definition: che_semchem.h:450
double * crslo
Definition: che_semchem.h:354
EX struct S_matr * P_matr
Definition: che_semchem.h:477
S_BOOL quazi_unsteady
Definition: che_semchem.h:184
EX int G_exit_code
Definition: che_semchem.h:105
int pis_log
Definition: che_semchem.h:223
EX time_t G_start_time
Definition: che_semchem.h:102
double M
Definition: che_semchem.h:644
int nkoef
Definition: che_semchem.h:155
void ctiich_latkyvefazi(void)
Definition: che_read.cc:144
double * Vhmota
Definition: che_semchem.h:360
char nazev[80]
Definition: che_semchem.h:655
double dt
Definition: che_semchem.h:427
int npuzl
Definition: che_semchem.h:318
int ndpor
Definition: che_semchem.h:172
int nvod
Definition: che_semchem.h:181
double * pslo
Definition: che_semchem.h:297
EX struct S_muzl * P_muzl
Definition: che_semchem.h:324
int nrlimit
Definition: che_semchem.h:195
double Eps_Qe
Definition: che_semchem.h:201
double * pslo_por
Definition: che_semchem.h:301
int imatr
Definition: che_semchem.h:253
int nuzl
Definition: che_semchem.h:150
int celkovy_pocet_reakci
Definition: che_semchem.h:617
EX double * P_rslo
Definition: che_semchem.h:131
int pisDF3(double, double, int)
int noke
Definition: che_semchem.h:164
#define MAXPATH
Definition: che_semchem.h:17
int ivoda
Definition: che_semchem.h:451
EX struct S_oke * P_oke
Definition: che_semchem.h:462
double splocha
Definition: che_semchem.h:631
double exponent[MAX_POC_LATEK]
Definition: che_semchem.h:659
double dGf
Definition: che_semchem.h:645
double Kr_min
Definition: che_semchem.h:472
double aktivita
Definition: che_semchem.h:648
double sorpcni_plocha
Definition: che_semchem.h:295
int to_chem
Definition: che_semchem.h:393
void Start_programu(char *)
int sit_nvrst
Definition: che_semchem.h:227
char popis[NLENSPO+1]
Definition: che_semchem.h:391
double * Chmota
Definition: che_semchem.h:358
int ipoke
Definition: che_semchem.h:424
double T
Definition: che_semchem.h:623
void pis_bin(int, float *)
int ipz0[3]
Definition: che_semchem.h:239
double x
Definition: che_semchem.h:319
double z_povrch
Definition: che_semchem.h:320
int nsmume
Definition: che_semchem.h:156
void Prerus_program(char *, int)
char fname[MAXPATH]
Definition: che_semchem.h:422
int aktualnejsi_soubor(char *, char *)
int nelm
Definition: che_semchem.h:153
double stntok[5]
Definition: che_semchem.h:264
EX double * P_MX
Definition: che_semchem.h:125
int abs_norma
Definition: che_semchem.h:636
int nmuzl
Definition: che_semchem.h:149
double WCobjem
Definition: che_semchem.h:369
int caskrok(double)
int nmatr
Definition: che_semchem.h:167
int funkce
Definition: che_semchem.h:470
int pocet_latek
Definition: che_semchem.h:615
float hodnota_oke
Definition: che_semchem.h:452
EX struct S_rpo * P_rpo
Definition: che_semchem.h:402
int idpor
Definition: che_semchem.h:258
S_BOOL cas_typ
Definition: che_semchem.h:306
EX struct S_pvr * P_pvr
Definition: che_semchem.h:385
void ctistm(void)
int imuzl
Definition: che_semchem.h:328
void inicializace_S_vod(void)
void sumace(double)
int NK_Result
Definition: che_semchem.h:439
double UP_hmota
Definition: che_semchem.h:499
int nkoef
Definition: che_semchem.h:486
void cesta_k_souboru_sestav(char *, char *, char *)
#define NLENPVR
Definition: che_semchem.h:86
double vyska
Definition: che_semchem.h:261
double sumtok
Definition: che_semchem.h:245
double stntlk[5]
Definition: che_semchem.h:263
void che_nactenichemie(void)
void nej_spolky(int, int, int, int *, int *)
void Konec_programu(char *)
#define EX
Definition: che_semchem.h:35
double param_sorpce[MAX_POC_PARAM_SORPCE]
Definition: che_semchem.h:650
double * WVhmota
Definition: che_semchem.h:372
int nsez
Definition: che_semchem.h:163
double cas_koef
Definition: che_semchem.h:305
double m
Definition: che_semchem.h:643
int ipslo
Definition: che_semchem.h:383
void pis_TS2(double)
double objem
Definition: che_semchem.h:268
EX struct S_sez * P_sez
Definition: che_semchem.h:443
void pole_je_male(int, char *, int, char *)
char sit_popis[80]
Definition: che_semchem.h:225
EX double * P_MM
Definition: che_semchem.h:125
int nstnin
Definition: che_semchem.h:159
void zavri_bin(void)
int ie_do
Definition: che_semchem.h:456
EX double * P_rslo_por
Definition: che_semchem.h:134
float che_poradi(int typ_reakce, double max, double K)
char jmeno_sini[MAXPATH]
Definition: che_semchem.h:190
int dov
Definition: che_semchem.h:243
double * rlimit
Definition: che_semchem.h:197
double TGf
Definition: che_semchem.h:624
int NK_Tran
Definition: che_semchem.h:432
void ctiuzl(void)
EX int * P_Steny
Definition: che_semchem.h:118
int pisPOP(char *)
int zapnuto
Definition: che_semchem.h:459
void ctiste(void)
double * WChmota
Definition: che_semchem.h:370
EX double * P_MR
Definition: che_semchem.h:125
double zeta0
Definition: che_semchem.h:660
EX double * P_sod
Definition: che_semchem.h:136
int NK_Flow
Definition: che_semchem.h:428
char jmeno_ich[MAXPATH]
Definition: che_semchem.h:614
float koef[MAXELKOEF]
Definition: che_semchem.h:255
char popis[NLENPVR+1]
Definition: che_semchem.h:382
void * seznam_sten(int)
void nastav_slozky(void)
EX struct S_glp G_glp
Definition: che_semchem.h:229
int pocet_rozpadu
Definition: che_semchem.h:622
void ctiich(void)
Definition: che_read.cc:560
float k1lm1[MAXK1LM1]
Definition: che_semchem.h:240
double srazky
Definition: che_semchem.h:426
double dHf
Definition: che_semchem.h:646
double koef[MAXDPORKOEF]
Definition: che_semchem.h:487
char jmeno_rini[MAXPATH]
Definition: che_semchem.h:187
double porobjm
Definition: che_semchem.h:269
S_BOOL sw_DP_apply
Definition: che_semchem.h:171
double objem
Definition: che_semchem.h:630
void ctistu(void)
double DOWN_hmota
Definition: che_semchem.h:500
void ctimmf(void)
double m0
Definition: che_semchem.h:642
double bilance
Definition: che_semchem.h:265
int nstnex
Definition: che_semchem.h:158
float koeficient_oke
Definition: che_semchem.h:453
S_BOOL write_waters
Definition: che_semchem.h:185
void sestmat(void)
double * vrslo
Definition: che_semchem.h:353
void pis_Tran(char *fmt,...)
void init_DP_mater(void)
void buble_sort(int *, int)
double * rslo_por
Definition: che_semchem.h:276
EX int NULA
Definition: che_semchem.h:104
int to_chem
Definition: che_semchem.h:411
double S_min
Definition: che_semchem.h:471
S_BOOL time_analysis
Definition: che_semchem.h:183
double Vobjem
Definition: che_semchem.h:359
int deleni_RK
Definition: che_semchem.h:634
int typ_sorpce
Definition: che_semchem.h:649
double koef[MAXMATRKOEF]
Definition: che_semchem.h:474
double CKobjem
Definition: che_semchem.h:363
void che_vypis__soubor(char *soubor)
Definition: che_semchem.cc:35
EX int G_cas_rozhrani
Definition: che_semchem.h:108
double * rslonew_por
Definition: che_semchem.h:277
double VKobjem
Definition: che_semchem.h:365
float sit_alfa
Definition: che_semchem.h:226
int irlimit
Definition: che_semchem.h:198
int stech_koef_p[MAX_POC_LATEK]
Definition: che_semchem.h:656
void ctiich_dalsilatky(void)
Definition: che_read.cc:268
int ikoef_melm
Definition: che_semchem.h:498
void vypocet(void)
int nmkoef
Definition: che_semchem.h:152