/[ascend]/branches/jacob/models/johnpye/fprops/mixtures/init_mixfuncs.h
ViewVC logotype

Contents of /branches/jacob/models/johnpye/fprops/mixtures/init_mixfuncs.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3062 - (show annotations) (download) (as text)
Fri Aug 14 00:03:58 2015 UTC (4 years, 1 month ago) by jacob
File MIME type: text/x-chdr
File size: 2765 byte(s)
Extended dew and bubble-point functions further to check that mixture is not below triple-point conditions (temperature or pressure).

Corrected dew-temperature and bubble-temperature functions to work correctly (at first, these functions tended to wander into the critical region and fail).

Added component-specific property functions in API.

1 /* ASCEND modelling environment
2 Copyright (C) Carnegie Mellon University
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2, or (at your option)
7 any later version.
8
9 This program is distributed in the hope that it will be useful, but
10 WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation --
17
18 Free Software Foundation, Inc.
19 59 Temple Place - Suite 330
20 Boston, MA 02111-1307, USA.
21 *//*
22 by Jacob Shealy, June 5-, 2015
23
24 Function headers for initial model of ideal-solution mixing. Removed these
25 from the test files init_mix1, init_mix2, etc. to de-clutter them.
26 */
27
28 #ifndef INIT_MIXTURE_HEADER
29 #define INIT_MIXTURE_HEADER
30
31 #include "mixture_struct.h"
32 #include "../helmholtz.h"
33 #include "../fluids.h"
34 #include "../fprops.h"
35 #include "../refstate.h"
36 #include "../sat.h"
37
38 #include <stdio.h>
39 #include <math.h>
40
41 typedef struct MixtureState_Struct {
42 double T; /* mixture temperature */
43 double *rhos; /* (current) mass densities of components */
44 MixtureSpec *X; /* specification of pure-component members of mixture */
45 } MixtureState;
46
47 /* Function prototypes */
48 /* void ig_rhos(MixtureState *M, double P); */
49 /* void initial_rhos(MixtureState *M, double P, FpropsError *err); */
50 /* void pressure_rhos(MixtureState *M, double P, double tol, FpropsError *err); */
51 /* void densities_to_mixture(MixtureState *M, double tol, FpropsError *err); */
52
53 double amixture_rho(MixtureState *M);
54 double amixture_u(MixtureState *M, FpropsError *err);
55 double amixture_h(MixtureState *M, FpropsError *err);
56 double amixture_cp(MixtureState *M, FpropsError *err);
57 double amixture_cv(MixtureState *M, FpropsError *err);
58 double mixture_x_ln_x(unsigned nPure, double *Xs, PureFluid **PFs);
59 double amixture_s(MixtureState *M, FpropsError *err);
60 double amixture_g(MixtureState *M, FpropsError *err);
61 double amixture_a(MixtureState *M, FpropsError *err);
62
63 /* void print_mixture_properties(char *how_calc, double rho, double u, double h, double cp, double cv, double s, double g, double a); */
64 /* void print_substances_properties(unsigned subst, char **headers, double *Xs, double *rhos, double *ps, double *us, double *hs, double *cps, double *cvs, double *ss, double *gs, double *as); */
65 /* void print_cases_properties(unsigned cases, char **headers, double *rhos, double *ps, double *us, double *hs, double *cps, double *cvs, double *ss, double *gs, double *as); */
66
67 #endif

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22