f.c File Reference

calculate fluxes, right hand side and construct ODE system More...

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include "nvector_serial.h"
#include "sundials_types.h"
#include "pihm.h"
#include "calib.h"

Include dependency graph for f.c:

Go to the source code of this file.

Defines

#define EPSILON   0.05
#define THRESH   0.00
#define GRAV   73231257600.0
#define ABS_TOL   1E-4

Functions

realtype Interpolation (TSD *Data, realtype t)
 Function interpolates the data value at time t from a given Time Series.
realtype returnVal (realtype rArea, realtype rPerem, realtype eqWid, realtype ap_Bool)
 Function returns Area, Peremeter or Equivalent Width depending on the ap_Bool identifier.
realtype CS_AreaOrPerem (int rivOrder, realtype rivDepth, realtype rivCoeff, realtype a_pBool)
 returns Area or Peremeter of a river segment cross-section
void OverlandFlow (realtype **flux, int loci, int locj, int surfmode, realtype avg_y, realtype grad_y, realtype avg_sf, realtype alfa, realtype beta, realtype crossA, realtype avg_rough, int eletypeBool, realtype avg_perem)
 Computes surface flux across the edge between two elements or two river segments.
void OLflowFromEleToRiv (realtype sideEle_y, realtype sideEle_zmax, realtype rivX, realtype sideEleX, realtype rivY, realtype sideEleY, realtype cwr, realtype rivZmax, realtype loc_yriver, realtype **fluxriv, int loc_i, int loc_j, realtype length)
 Computes surface flux interaction between an element and a river segment.
void GWflowFromEleToRiv (realtype sideEle_y, realtype sideEle_zmax, realtype sideEle_zmin, realtype rivX, realtype sideEleX, realtype rivY, realtype sideEleY, int loc_McPore, realtype loc_yriver, realtype loc_totyriver, realtype **fluxriv, int loc_i, int loc_j, realtype length, realtype loc_base, realtype loc_gama, realtype loc_perem, realtype loc_ksat, realtype ele_Thresh)
 Computes subsurface flux interaction between an element and a river segment.
int f (realtype t, N_Vector CV_Y, N_Vector CV_Ydot, void *DS)
 Function calculates fluxes, right hand side leading to construction of ODE system.

Variables

realtype Vic_CALIB
realtype rivK_CALIB
realtype Kh_CALIB
realtype Rec_CALIB
realtype et2_CALIB
realtype et1_CALIB
realtype sat_THRESH
realtype mp_MULTFH
realtype mp_MULTFV
realtype mpArea_CALIB
realtype ovl_THRESH_H
realtype ovl_THRESH_V
realtype rzd_CALIB


Detailed Description

calculate fluxes, right hand side and construct ODE system

Definition in file f.c.


Define Documentation

#define ABS_TOL   1E-4

Absolute tolerance as defined in control data

Definition at line 52 of file f.c.

Referenced by f().

#define EPSILON   0.05

Definition at line 46 of file f.c.

#define GRAV   73231257600.0

Gravitational Accelaration in m/day^2

Definition at line 50 of file f.c.

Referenced by OLflowFromEleToRiv().

#define THRESH   0.00

Definition at line 47 of file f.c.


Function Documentation

realtype CS_AreaOrPerem ( int  rivOrder,
realtype  rivDepth,
realtype  rivCoeff,
realtype  a_pBool 
)

returns Area or Peremeter of a river segment cross-section

Parameters:
rivOrder is the interpolation order of the river segment
rivDepth is the depth of water in the river segment
rivCoeff is the interpolation factor of the river segment
a_pBool is identifer for either Area or Peremeter

Definition at line 1143 of file f.c.

References EPSILON, and returnVal().

Here is the call graph for this function:

int f ( realtype  t,
N_Vector  CV_Y,
N_Vector  CV_Ydot,
void *  DS 
)

Function calculates fluxes, right hand side leading to construction of ODE system.

Parameters:
t is the time of simulation
CV_Y is state variable vector
CV_Ydot is vector of rate of change of state variables
DS is pointer to model data structure

Definition at line 83 of file f.c.

References ABS_TOL, model_data_structure::Ele, et1_CALIB, et2_CALIB, Kh_CALIB, mp_MULTFH, mp_MULTFV, mpArea_CALIB, model_data_structure::NumEle, model_data_structure::NumRiv, ovl_THRESH_H, ovl_THRESH_V, Rec_CALIB, rivK_CALIB, rzd_CALIB, sat_THRESH, setet1_CALIB(), setet2_CALIB(), setKh_CALIB(), setmp_MULTFH(), setmp_MULTFV(), setmpArea_CALIB(), setovl_THRESH_H(), setovl_THRESH_V(), setRec_CALIB(), setrivK_CALIB(), setrzd_CALIB(), setsat_THRESH(), setVic_CALIB(), Vic_CALIB, element_type::zmax, and element_type::zmin.

Referenced by main().

Here is the call graph for this function:

void GWflowFromEleToRiv ( realtype  sideEle_y,
realtype  sideEle_zmax,
realtype  sideEle_zmin,
realtype  rivX,
realtype  sideEleX,
realtype  rivY,
realtype  sideEleY,
int  loc_McPore,
realtype  loc_yriver,
realtype  loc_totyriver,
realtype **  fluxriv,
int  loc_i,
int  loc_j,
realtype  length,
realtype  loc_base,
realtype  loc_gama,
realtype  loc_perem,
realtype  loc_ksat,
realtype  ele_Thresh 
)

Computes subsurface flux interaction between an element and a river segment.

Parameters:
sideEle_y is the surface water head at the side element
sideEle_zmax is surface elevation of the side element
sideEle_zmin is bed elevation of the side element
rivX is x co-ordinate of the river segment
sideEleX is y co-ordinate of the side element
rivY is the y co-ordinate of the river segment
sideEleY is the y co-ordinate of the side element
loc_McPore is the identifier for Macropore
loc_yriver is the river water head
loc_totyriver is the river water elevation
fluxriv is the pointer to river flux
loc_i is the river segment number
loc_j is 4 for left element & 5 for right element
length is the length of the river segment
loc_base is soil base paramter : dummy
loc_gama is macropore factor
loc_perem is the wetted perimeter
loc_ksat is the saturated hydraulic conductivity
ele_Thresh is the

Definition at line 1348 of file f.c.

References rivK_CALIB.

realtype Interpolation ( TSD Data,
realtype  t 
)

Function interpolates the data value at time t from a given Time Series.

Parameters:
Data is the pointer to a time series data
t is the time of simulation

void OLflowFromEleToRiv ( realtype  sideEle_y,
realtype  sideEle_zmax,
realtype  rivX,
realtype  sideEleX,
realtype  rivY,
realtype  sideEleY,
realtype  cwr,
realtype  rivZmax,
realtype  loc_yriver,
realtype **  fluxriv,
int  loc_i,
int  loc_j,
realtype  length 
)

Computes surface flux interaction between an element and a river segment.

Parameters:
sideEle_y is the surface water head at the side element
sideEle_zmax is surface elevation of the side element
rivX is x co-ordinate of the river segment
sideEleX is y co-ordinate of the side element
rivY is the y co-ordinate of the river segment
sideEleY is the y co-ordinate of the side element
cwr is the coefficient of discharge
rivZmax is the full bank elevation of the river segment
loc_yriver is the river water head in the river
fluxriv is the pointer to the river flux
loc_i is the river segment number
loc_j is 2 for left element 3 for right element
length is the lenght of the river segment

Definition at line 1272 of file f.c.

References GRAV.

void OverlandFlow ( realtype **  flux,
int  loci,
int  locj,
int  surfmode,
realtype  avg_y,
realtype  grad_y,
realtype  avg_sf,
realtype  alfa,
realtype  beta,
realtype  crossA,
realtype  avg_rough,
int  eletypeBool,
realtype  avg_perem 
)

Computes surface flux across the edge between two elements or two river segments.

Parameters:
flux is the pointer to FluxSurf or FluxRiv
loci is Element/River Segment Number
locj is the Neighbour Number of the Element / 1 for River outflow
surfmode is identifier to the Surface Flow mode
avg_y is the avarage head between the elements
grad_y is the hydraulic gradient between the elements
avg_sf is the avarage friction slope of the elements
alfa is dummy variable
beta is dummy variable
crossA is average area of cross-section
avg_rough is avarage manning's roughness coefficient
eletypeBool is an identifier to element mode 1: Element 0: River
avg_perem is the avarage wetted perimeter

Definition at line 1182 of file f.c.

realtype returnVal ( realtype  rArea,
realtype  rPerem,
realtype  eqWid,
realtype  ap_Bool 
)

Function returns Area, Peremeter or Equivalent Width depending on the ap_Bool identifier.

Parameters:
rArea is the area
rPerem is the peremeter
eqWid is the equivalent width
ap_Bool is the identifier to return type

Definition at line 1120 of file f.c.

Referenced by CS_AreaOrPerem().


Variable Documentation

realtype et1_CALIB

Definition at line 59 of file f.c.

realtype et2_CALIB

Definition at line 58 of file f.c.

realtype Kh_CALIB

Definition at line 56 of file f.c.

realtype mp_MULTFH

Definition at line 61 of file f.c.

realtype mp_MULTFV

Definition at line 62 of file f.c.

realtype mpArea_CALIB

Definition at line 63 of file f.c.

realtype ovl_THRESH_H

Definition at line 64 of file f.c.

realtype ovl_THRESH_V

Definition at line 65 of file f.c.

realtype Rec_CALIB

Definition at line 57 of file f.c.

realtype rivK_CALIB

Definition at line 55 of file f.c.

realtype rzd_CALIB

Definition at line 66 of file f.c.

realtype sat_THRESH

Definition at line 60 of file f.c.

realtype Vic_CALIB

Definition at line 54 of file f.c.


Generated on Thu Jul 12 14:34:19 2007 for PIHM by  doxygen 1.5.2