root/trunk/EBaporate/ebsurf.h

Revision 449, 3.6 kB (checked in by hazelsct, 6 years ago)

Separated shorts.c into new file, documented it. Other doc changes.

  • Property svn:keywords set to Author Date Id Revision
Line 
1/***************************************
2  $Header$
3
4  This header file contains definitions, structures and function prototypes for
5  ebsurf.c and shorts.c.
6***************************************/
7
8
9#ifndef EBSURF_H
10#define EBSURF_H    /*+ To stop multiple inclusions. +*/
11
12#include <stdio.h>
13#include <stdlib.h> /* For getenv() */
14#include <math.h>
15#define MALLOC(a,b) (a *)malloc((b)*sizeof(a))
16#define MIN(x,y) (((x)>(y))?(y):(x))
17#ifndef M_PI
18#define M_PI 3.141592653589793
19#endif
20#ifndef _ABS
21#define _ABS(x) (((x)<0)?-(x):(x))
22#endif
23#define GR 8.314e7               /* Gas constant in cgs units    */
24#define TORR2CGSP (1013000./760.)/* Torr to dyn/cm^2 conversion  */
25#define SIGMA 5.67e-5            /* Radiation constant in cgs    */
26#define MAXCYC 30                /* Max number of cycles in auto */
27
28/* Messages passed to output() */
29#define GENZ 0 /* Graph beam heat gen vs. depth z */
30#define GENT 5 /* Graph beam heat gen vs. time t */
31#define TMPS 1 /* Graph temperatures vs. z and t (3-D) */
32#define SURF 2 /* Graph surface temperatures vs. t */
33#define ONEC 3 /* Graph one cycle's temperatures vs. z and t */
34#define FLUX 4 /* Graph evaporative flux from surface vs. t */
35#define PATT 6 /* Graph x-y pattern */
36#define PSDIR     "/home/hazelsct/cvs/EBaporate/" /* Dir with PS templates */
37#define OUTPUTDIR "/home/hazelsct/cvs/EBaporate/" /* Dir to put PS output in */
38#define OUTPUTURLDIR OUTPUTDIR                    /* Dir for graph links */
39
40/* Flags to pass to cycles() */
41#define GREET 1
42#define OUTPUT 2
43#define TSUR 4   /* T0 = surface temperature, not layer bottom temperature */
44
45struct param {
46  unsigned long zs,ts,cyc,ptyp,xw,yw;
47  double (*gtime)(); /* gen(time) function pointer */
48  double (*xpat)(), (*ypat)(); /* x(t) and y(t) function pointers */
49  double al,k,   /* Material props: alpha(=k/rho cp), therm conductivity */
50    rho,mu,dsig, /* Dens, visc and Marangoni dsigma/dt to test regime III/IV */
51    Ma,eps,Tenv, /* Molar mass, radiative emissivity, env temp for radiation */
52    Q0,S,        /* Heat of vaporiz, modeled as Q0 exp (ST) */
53    A,B,C,D,E;   /* Clausius-Clapeyron evap coefficients, Langmuir coeff */
54  double pow,volt,dp,   /* Run parameters: power, voltage, penetration depth */
55    tfin,xfrq,yfrq,plen,pwid, /* period, x and y freqs, pattern length * wid */
56    vb,spx,spy,               /* beam veloc, x and y spot size */
57    x,y,tres; /* x and y point where our model runs, beam dwell time */
58  double zr,tr,b,ap,bp,w,th,it,ct,Tin,Tsurf; /* Sim params */
59  char *gout,*gtou,*tout,*sout,*lout,*fout,*pout; }; /* Output file names */
60
61/* Function prototypes from ebsurf.c */
62int cycles (double *X, double *t, double *T, double T0, double *big,
63            struct param *p, int m, double *ou, FILE *fule, int pt);
64double timestep (struct param p, double *X, double *t, double *T, double *big,
65                 double Gto, int s, int m);
66char *paraminp (struct param *pars, char *qstring);
67void initcond (double *X, double *t, double *T, double T0, double TS,
68               double *big, struct param *p);
69void output (struct param *p, double *X, double *t, double *T, int msg);
70void tridag (double *a, double *b, double *c, double *r, double *u, int n);
71void errer (char *strong);
72
73/* Function prototypes from shorts.c */
74double radloss (double T, struct param *p);
75double loss (double T, struct param *p);
76double vloss (double T, double E, double A, double C, double D);
77double vloss2 (double T, double E, double A, double C, double D);
78double gtnorm (double t, struct param *p);
79double gtliss (double t, struct param *p);
80double gtdisk (double t, struct param *p);
81double sino(double t, double freq);
82double triang(double t, double freq);
83double sawt(double t, double freq);
84
85#endif /* EBSURF_H */
Note: See TracBrowser for help on using the browser.