Gems3k  3.1
GEMS3K standalone solver for geochemical equilibria
 All Classes Files Functions Variables Enumerations Enumerator
/Users/kulik/DevGEMS/trunk/standalone/GEMS3K/datach.h
Go to the documentation of this file.
00001 //-------------------------------------------------------------------
00002 // $Id: datach.h 724 2012-10-02 14:25:25Z kulik $
00003 //
00010 //      CH: chemical structure in GEM IPM
00011 //      FMT: fluid mass transport
00012 //
00013 // Copyright (c) 2006-2012 D.Kulik, S.Dmytriyeva, F.Enzmann, W.Pfingsten
00014 // <GEMS Development Team, mailto:gems2.support@psi.ch>
00015 //
00016 // This file is part of the GEMS3K code for thermodynamic modelling
00017 // by Gibbs energy minimization <http://gems.web.psi.ch/GEMS3K/>
00018 //
00019 // GEMS3K is free software: you can redistribute it and/or modify
00020 // it under the terms of the GNU Lesser General Public License as
00021 // published by the Free Software Foundation, either version 3 of
00022 // the License, or (at your option) any later version.
00023 
00024 // GEMS3K is distributed in the hope that it will be useful,
00025 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00026 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00027 // GNU Lesser General Public License for more details.
00028 
00029 // You should have received a copy of the GNU General Public License
00030 // along with GEMS3K code. If not, see <http://www.gnu.org/licenses/>.
00031 //------------------------------------------------------------------------------
00032 //
00033 #ifndef _DataCh_H_
00034 #define _DataCh_H_
00035 
00036 const long int
00037     MaxICN =      6,      // IC name length
00038     MaxDCN =      16,     // DC name length
00039     MaxPHN =      16;     // PH name length
00040 
00042 typedef struct
00043 {
00044   long int     // Dimensionalities of chemical system definition
00045 //  These dimensionalities should be the same as in the GEMIPM work structure (MULTI)
00046     nIC,    
00047     nDC,    
00048     nPH,    
00049     nPS,    
00050     nDCs,   
00051     nTp,    
00052     nPp,    
00053     iGrd,   
00054     nAalp,  
00055 
00056   // These dimensionalities define sizes of packed arrays in DATABR structures
00057   // describing nodes. They are needed to save on the storage demand for nodes.
00058   // Connection between any node and DATACH occurs through the xIC, xPH and xDC
00059   // index lists (see below)
00060     nICb,   
00061     nDCb,   
00062     nPHb,   
00063     nPSb,   
00064     mLook,  
00065 
00066 
00067 // Lists, vectors and matrices
00068     *nDCinPH,  
00069 
00070   // Indices connecting the lists used in nodes (DATABR structure), see
00071   //    databr.h, with the lists in this (DATACH) structure
00072     *xic,   
00073     *xdc,   
00074     *xph;   
00075 
00076   double
00077     Ttol,    
00078     Ptol,    
00079     dRes1,   
00080     dRes2,   
00081 
00082 // Data vectors - must be loaded before calling GEMS3K
00083     *TKval,  
00084     *Pval,   
00085     *Psat,   
00086     *A,      
00087 
00088    // Values for IC (independent components)
00089     *ICmm,   
00090 
00091     // DC - related values
00092     *DCmm,   
00093     *DD,     
00094 
00095     // Look-up grid arrays of thermodynamic data require a Lagrange interpolation subroutine to extract data
00096     // for a given P,T point (new interpolation is done when P or T differs
00097     // from the previous P,T by more than Ptol, Ttol)
00098     *denW,  
00099     *denWg, 
00100 //  *visW, // Optional lookup array for the viscosity of liquid water (units?) [5][nPp][nTp] reserved
00101     *epsW,  
00102     *epsWg, 
00103     *G0,    
00104     *V0,    
00105     *S0,    
00106     *H0,    
00107     *Cp0,   
00108     *A0,    
00109     *U0;    
00110 
00111 // Name lists
00112   char (*ICNL)[MaxICN]; 
00113   char (*DCNL)[MaxDCN]; 
00114   char (*PHNL)[MaxPHN]; 
00115 
00116 // Class code lists
00117    char *ccIC,   
00118         *ccDC,   
00119         *ccPH;   
00120 }
00121 DATACH;
00122 
00123 typedef enum {  
00124   f_nIC = 0, f_nDC,  f_nPH,  f_nPS,  f_nDCs,
00125   f_nICb,  f_nDCb,  f_nPHb,  f_nPSb,  f_nTp,
00126   f_nPp,  f_iGrd,  f_fAalp,  f_mLook
00127 } DATACH_STATIC_FIELDS;
00128 
00129 typedef enum {  
00130   f_xic = 0,  f_xdc,  f_xph,  f_ICNL,  f_ccIC,
00131   f_ICmm,  f_DCNL,  f_ccDC,  f_DCmm,  f_PHNL,
00132   f_ccPH,  f_nDCinPH,  f_A,  f_Ttol,  f_TKval,
00133   f_Ptol,  f_Pval,  f_denW,  f_denWg,  f_epsW,
00134   f_epsWg, //   { "visW",  1, 0, 0 },
00135   f_V0,  f_G0,  f_H0,  f_S0,  f_Cp0,
00136   f_A0,  f_U0,  f_DD,  f_Psat
00137 } DATACH_DYNAMIC_FIELDS;
00138 
00139 #endif
00140 // -----------------------------------------------------------------------------
00141 // End of datach.h
00142 
00143