Gems3k  3.1
GEMS3K standalone solver for geochemical equilibria
 All Classes Files Functions Variables Enumerations Enumerator
/Users/kulik/DevGEMS/trunk/standalone/GEMS3K/databr.h
Go to the documentation of this file.
00001 //-------------------------------------------------------------------
00002 // $Id: databr.h 725 2012-10-02 15:43:37Z kulik $
00006 //
00011 //
00012 // Copyright (c) 2003-2011 by D.Kulik, S.Dmytriyeva, F.Enzmann, W.Pfingsten
00013 // <GEMS Development Team, mailto:gems2.support@psi.ch>
00014 //
00015 // This file is part of the GEMS3K code for thermodynamic modelling
00016 // by Gibbs energy minimization <http://gems.web.psi.ch/GEMS3K/>
00017 //
00018 // GEMS3K is free software: you can redistribute it and/or modify
00019 // it under the terms of the GNU Lesser General Public License as
00020 // published by the Free Software Foundation, either version 3 of
00021 // the License, or (at your option) any later version.
00022 
00023 // GEMS3K is distributed in the hope that it will be useful,
00024 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00025 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00026 // GNU Lesser General Public License for more details.
00027 
00028 // You should have received a copy of the GNU General Public License
00029 // along with GEMS3K code. If not, see <http://www.gnu.org/licenses/>.
00030 //-------------------------------------------------------------------
00031 //
00032 #ifndef _DataBr_H_
00033 #define _DataBr_H_
00034 
00035 
00036 
00037 typedef struct  
00038 {
00039    long int
00040      NodeHandle,    
00041      NodeTypeHY,    
00042      NodeTypeMT,    
00043      NodeStatusFMT, 
00044      NodeStatusCH,  
00045      IterDone;      
00046 
00047 /*  these important data array dimensions are provided in the DATACH structure
00048    long int
00049     nICb,       ///< Number of Independent Components kept in the DATABR memory structure (<= nIC)
00050     nDCb,       ///< Number of Dependent Components kept in the DATABR memory structure (<=nDC)
00051     nPHb,       ///< Number of Phases to be kept in the DATABR structure (<= nPH)
00052     nPSb,       ///< Number of Phases-solutions (multicomponent phases) to be kept in the DATABR memory structure (<= nPS)
00053 */
00054 //      Usage of this variable (DB - data bridge)                      MT-DB DB-GEM GEM-DB DB-MT
00055    double
00056 // \section Chemical scalar variables
00057     TK,     
00058     P,      
00059     Vs,     
00060     Vi,     
00061     Ms,     
00062     Mi,     
00063 
00064     Gs,     
00065     Hs,         
00066     Hi,     
00067 
00068     IC,     
00069     pH,     
00070     pe,     
00071     Eh,     
00072     Tm,     
00073     dt      
00074 #ifdef NODEARRAYLEVEL
00075       ,
00076 // \section  FMT variables (units or dimensionsless) - to be used for storing them
00077 //  at the nodearray level, normally not used in the single-node FMT-GEM coupling
00078     Dif,    
00079     Vt,         
00080     vp,         
00081     eps,        
00082     Km,         
00083     Kf,         
00084     S,          
00085 
00086 
00087     Tr,     
00088     h,          
00089     rho,        
00090     al,         
00091     at,         
00092     av,         
00093     hDl,        
00094     hDt,        
00095     hDv,        
00096     nto     
00097 #endif
00098    ;
00099 // \section Data arrays - dimensions nICb, nDCb, nPHb, nPSb see in the DATACH structure
00100 // exchange of values occurs through lists of indices, e.g. xIC, xDC, xPH from DATACH
00101 
00102 //      Usage of this variable (DB = data bridge)                                               MT-DB DB-GEM GEM-DB DB-MT
00103    double
00104 // IC (stoichiometry units)
00105     *bIC,  
00106     *rMB,  
00107     *uIC,  
00108 // DC (species) in reactive subsystem
00109     *xDC,  
00110     *gam,  
00111 // Metastability/kinetic controls
00112     *dul,  
00113     *dll,  
00114 // Phases in reactive subsystem
00115     *aPH,  
00116     *xPH,  
00117     *vPS,  
00118     *mPS,  
00119     *bPS,  
00120     *xPA,  
00121 
00122     *bSP;  
00123 }
00124 DATABR;
00125 
00126 typedef DATABR*  DATABRPTR;
00127 
00129 /*typedef*/ enum NODECODECH {
00130  NO_GEM_SOLVER= 0,   
00131  NEED_GEM_AIA = 1,   
00132  OK_GEM_AIA   = 2,   
00133  BAD_GEM_AIA  = 3,   
00134  ERR_GEM_AIA  = 4,   
00135  NEED_GEM_SIA = 5,   
00136 
00137  OK_GEM_SIA   = 6,   
00138  BAD_GEM_SIA  = 7,   
00139  ERR_GEM_SIA  = 8,   
00140  T_ERROR_GEM  = 9    
00141 } /*NODECODECH*/;
00142 
00143 
00144 // \typedef NODECODEFMT Node status codes set by the FMT (FluidMassTransport) part
00145 typedef enum {
00146  No_nodearray  = -1, 
00147  No_transport  = 0,  
00148  Initial_RUN   = 1,
00149  OK_Hydraulic  = 2,
00150  BAD_Hydraulic = 3,  
00151  OK_Transport  = 4,
00152  BAD_Transport = 5,  
00153  NEED_RecalcMT = 6,
00154  OK_MassBal    = 7,
00155  OK_RecalcPar  = 8,
00156  Bad_Recalc    = 9,
00157  OK_Time       = 10
00158 } NODECODEFMT; 
00159 
00160 typedef enum {  
00161   normal       = 0, 
00162 // boundary condition node
00163   NBC1source   = 1, 
00164   NBC1sink    = -1, 
00165   NBC2source   = 2, 
00166   NBC2sink    = -2, 
00167   NBC3source   = 3, 
00168   NBC3sink    = -3, 
00169   INIT_FUNK    = 4  
00170 } NODETYPE;
00171 
00172 
00173 typedef enum {  
00174    undefi  = 0, 
00175    nICbi   = -1,   
00176    nDCbi   = -2,   
00177    nPHbi   = -3,   
00178    nPSbi   = -4,   
00179    nPSbnICbi = -5  
00180  } NODEINEX;
00181 
00182 typedef enum {  
00183 f_NodeHandle = 0,f_NodeTypeHY,f_NodeTypeMT,f_NodeStatusFMT,f_NodeStatusCH,
00184 f_IterDone, f_TK, f_P, f_Vs,f_Vi,
00185 f_Ms, f_Mi, f_Hs, f_Hi, f_Gs,
00186 f_IS, f_pH, f_pe, f_Eh,
00187 f_Tm, f_dt,
00188 //#ifdef NODEARRAYLEVEL
00189 f_Dif,f_Vt, f_vp, f_eps,
00190 f_Km, f_Kf, f_S,  f_Tr, f_h,
00191 f_rho,f_al, f_at, f_av, f_hDl,
00192 f_hDt, f_hDv, f_nto,
00193 //#endif
00194     // dynamic arrays (52-38=14)
00195 f_bIC, f_rMB, f_uIC, f_xDC, f_gam,
00196 f_dll, f_dul, f_aPH, f_xPH, f_vPS,
00197 f_mPS, f_bPS, f_xPA, f_bSP,
00198 // only for VTK format output
00199 f_mPH, f_vPH, f_m_t, f_con, f_mju, f_lga
00200 
00201 } DATABR_FIELDS;
00202 
00203 
00204 #endif
00205 
00206 // -----------------------------------------------------------------------------
00207 // end of _DataBr_h
00208