proteus  1.8.1
C/C++/Fortran libraries
analyticalSolutions.h
Go to the documentation of this file.
1 #ifndef ANALYTICALSOLUTIONS_H
2 #define ANALYTICALSOLUTIONS_H
3 
9 #include <math.h>
10 #include <stdio.h>
11 #include <stdlib.h>
12 
13 #ifndef max
14 #define max(a,b) (((a)>(b))?(a):(b))
15 #endif
16 static const double PI = 3.1415926535897932384;
17 
18 extern int PlaneCouetteFlow_u(
19  int *iwork,
20  double *rwork,
21  int nPoints,
22  double t,
23  double *x,
24  double *u
25 );
26 extern int diffusionSin1D(
27  int *iwork,
28  double *rwork,
29  int nPoints,
30  double t,
31  double *x,
32  double *u
33 );
34 extern int diffusionSin2D(
35  int *iwork,
36  double *rwork,
37  int nPoints,
38  double t,
39  double *x,
40  double *u
41 );
42 extern int diffusionSin3D(
43  int *iwork,
44  double *rwork,
45  int nPoints,
46  double t,
47  double *x,
48  double *u
49 );
50 extern int diffusionSin1D_r(
51  int *iwork,
52  double *rwork,
53  int nPoints,
54  double t,
55  double *x,
56  double *u,
57  double *r
58 );
59 extern int diffusionSin2D_r(
60  int *iwork,
61  double *rwork,
62  int nPoints,
63  double t,
64  double *x,
65  double *u,
66  double *r
67 );
68 extern int diffusionSin3D_r(
69  int *iwork,
70  double *rwork,
71  int nPoints,
72  double t,
73  double *x,
74  double *u,
75  double *r
76 );
77 extern int LinearAD_DiracIC(
78  int *iwork,
79  double *rwork,
80  int nPoints,
81  double T,
82  double *x,
83  double *u
84 );
86  int *iwork,
87  double *rwork,
88  int nPoints,
89  double T,
90  double *x,
91  double *f
92 );
94  int *iwork,
95  double *rwork,
96  int nPoints,
97  double T,
98  double *x,
99  double *f
100 );
101 extern int LinearAD_DiracIC_du(
102  int *iwork,
103  double *rwork,
104  int nPoints,
105  double T,
106  double *x,
107  double *f
108 );
110  int *iwork,
111  double *rwork,
112  int nPoints,
113  double T,
114  double *x,
115  double *f
116 );
117 extern int LinearAD_SteadyState(
118  int *iwork,
119  double *rwork,
120  int nPoints,
121  double t,
122  double *X,
123  double *u
124 );
125 extern int LinearADR_Decay_DiracIC(
126  int *iwork,
127  double *rwork,
128  int nPoints,
129  double T,
130  double *x,
131  double *u
132 );
133 extern int LinearADR_Decay_DiracIC_dr(
134  int *iwork,
135  double *rwork,
136  int nPoints,
137  double T,
138  double *x,
139  double *u,
140  double *dr
141 );
142 extern int LinearADR_Decay_DiracIC_r(
143  int *iwork,
144  double *rwork,
145  int nPoints,
146  double T,
147  double *x,
148  double *u,
149  double *r
150 );
151 extern int LinearADR_Sine(
152  int *iwork,
153  double *rwork,
154  int nPoints,
155  double t,
156  double *x,
157  double *u
158 );
160  int *iwork,
161  double *rwork,
162  int nPoints,
163  double t,
164  double *x,
165  double *f
166 );
168  int *iwork,
169  double *rwork,
170  int nPoints,
171  double t,
172  double *x,
173  double *f
174 );
175 extern int LinearADR_Sine_dr(
176  int *iwork,
177  double *rwork,
178  int nPoints,
179  double t,
180  double *x,
181  double *u,
182  double *dr
183 );
184 extern int LinearADR_Sine_du(
185  int *iwork,
186  double *rwork,
187  int nPoints,
188  double t,
189  double *x,
190  double *f
191 );
192 extern int LinearADR_Sine_r(
193  int *iwork,
194  double *rwork,
195  int nPoints,
196  double t,
197  double *x,
198  double *u,
199  double *r
200 );
202  int *iwork,
203  double *rwork,
204  int nPoints,
205  double t,
206  double *x,
207  double *f
208 );
209 extern int NonlinearAD_SteadyState(
210  int *iwork,
211  double *rwork,
212  int nPoints,
213  double t,
214  double *X,
215  double *u
216 );
217 extern int NonlinearADR_Decay_DiracIC(
218  int *iwork,
219  double *rwork,
220  int nPoints,
221  double T,
222  double *x,
223  double *u
224 );
226  int *iwork,
227  double *rwork,
228  int nPoints,
229  double T,
230  double *x,
231  double *u,
232  double *dr
233 );
235  int *iwork,
236  double *rwork,
237  int nPoints,
238  double T,
239  double *x,
240  double *u,
241  double *r
242 );
243 extern int NonlinearDAE(
244  int *iwork,
245  double *rwork,
246  int nPoints,
247  double T,
248  double *x,
249  double *u
250 );
251 extern int NonlinearDAE_f(
252  int *iwork,
253  double *rwork,
254  int nPoints,
255  double t,
256  double *x,
257  double *f
258 );
259 extern int PlanePoiseuilleFlow_u(
260  int *iwork,
261  double *rwork,
262  int nPoints,
263  double t,
264  double *x,
265  double *u
266 );
267 extern int PoiseuillePipeFlow(
268  int *iwork,
269  double *rwork,
270  int nPoints,
271  double t,
272  double *x,
273  double *u
274 );
275 extern int PoiseuillePipeFlow_P(
276  int *iwork,
277  double *rwork,
278  int nPoints,
279  double t,
280  double *x,
281  double *u
282 );
283 extern int poissonsEquationExp1D(
284  int *iwork,
285  double *rwork,
286  int nPoints,
287  double t,
288  double *X,
289  double *u
290 );
291 extern int poissonsEquationExp2D(
292  int *iwork,
293  double *rwork,
294  int nPoints,
295  double t,
296  double *X,
297  double *u
298 );
299 extern int poissonsEquationExp3D(
300  int *iwork,
301  double *rwork,
302  int nPoints,
303  double t,
304  double *X,
305  double *u
306 );
307 extern int poissonsEquationExp3D_dr(
308  int *iwork,
309  double *rwork,
310  int nPoints,
311  double t,
312  double *X,
313  double *u,
314  double *dr
315 );
316 extern int poissonsEquationExp1D_r(
317  int *iwork,
318  double *rwork,
319  int nPoints,
320  double t,
321  double *X,
322  double *u,
323  double *r
324 );
325 extern int poissonsEquationExp2D_r(
326  int *iwork,
327  double *rwork,
328  int nPoints,
329  double t,
330  double *X,
331  double *u,
332  double *r
333 );
334 extern int poissonsEquationExp3D_r(
335  int *iwork,
336  double *rwork,
337  int nPoints,
338  double t,
339  double *X,
340  double *u,
341  double *r
342 );
343 extern int STflowSphere_P(
344  int *iwork,
345  double *rwork,
346  int nPoints,
347  double t,
348  double *x,
349  double *u
350 );
351 extern int STflowSphere_Vx(
352  int *iwork,
353  double *rwork,
354  int nPoints,
355  double t,
356  double *x,
357  double *u
358 );
359 extern int STflowSphere_Vy(
360  int *iwork,
361  double *rwork,
362  int nPoints,
363  double t,
364  double *x,
365  double *u
366 );
367 extern int STflowSphere_Vz(
368  int *iwork,
369  double *rwork,
370  int nPoints,
371  double t,
372  double *x,
373  double *u
374 );
375 extern void coords(
376  double vx,
377  double vy,
378  double vz,
379  double xS,
380  double yS,
381  double zS,
382  double *x,
383  double *r,
384  double *theta,
385  double *norm_v,
386  double *eR,
387  double *eTHETA
388 );
389 extern void vel(
390  double rS,
391  double norm_v,
392  double r,
393  double theta,
394  double *vR,
395  double *vTHETA
396 );
397 extern double uOfX_df(
398  double nlC,
399  double lu
400 );
401 extern double uOfX_f(
402  double a,
403  double b,
404  double nlC,
405  double nlD,
406  double x,
407  double lu
408 );
409 extern double f(
410  double C,
411  double b,
412  double a,
413  int q,
414  int r
415 );
416 extern double df(
417  double C,
418  double b,
419  double a,
420  int q,
421  int r
422 );
424 #endif
LinearADR_Sine_diffusiveVelocity
int LinearADR_Sine_diffusiveVelocity(int *iwork, double *rwork, int nPoints, double t, double *x, double *f)
Linear Avection Diffusion Reaction Sine function (diffusive velocity)
Definition: analyticalSolutions.c:802
STflowSphere_Vy
int STflowSphere_Vy(int *iwork, double *rwork, int nPoints, double t, double *x, double *u)
Stokes Flow around moving Sphere.
Definition: analyticalSolutions.c:1992
diffusionSin1D_r
int diffusionSin1D_r(int *iwork, double *rwork, int nPoints, double t, double *x, double *u, double *r)
Sinusoidal 1D diffusion (reaction)
Definition: analyticalSolutions.c:172
poissonsEquationExp3D
int poissonsEquationExp3D(int *iwork, double *rwork, int nPoints, double t, double *X, double *u)
Poisson Exponential Equation 3D.
Definition: analyticalSolutions.c:1690
LinearADR_Sine_dr
int LinearADR_Sine_dr(int *iwork, double *rwork, int nPoints, double t, double *x, double *u, double *dr)
Linear Avection Diffusion Reaction Sine function (dr)
Definition: analyticalSolutions.c:851
PoiseuillePipeFlow_P
int PoiseuillePipeFlow_P(int *iwork, double *rwork, int nPoints, double t, double *x, double *u)
Poiseuille Flow through a circular pipe.
Definition: analyticalSolutions.c:1554
NonlinearADR_Decay_DiracIC_dr
int NonlinearADR_Decay_DiracIC_dr(int *iwork, double *rwork, int nPoints, double T, double *x, double *u, double *dr)
Non Linear Avection Diffusion Reaction Decay Dirac Initial Condition (dr)
Definition: analyticalSolutions.c:1216
poissonsEquationExp2D
int poissonsEquationExp2D(int *iwork, double *rwork, int nPoints, double t, double *X, double *u)
Poisson Exponential Equation 2D.
Definition: analyticalSolutions.c:1659
LinearAD_DiracIC_advectiveVelocity
int LinearAD_DiracIC_advectiveVelocity(int *iwork, double *rwork, int nPoints, double T, double *x, double *f)
Linear Advective Diffusion Dirac Initial Condition(advective velocity)
Definition: analyticalSolutions.c:337
poissonsEquationExp1D_r
int poissonsEquationExp1D_r(int *iwork, double *rwork, int nPoints, double t, double *X, double *u, double *r)
Poisson Exponential Equation 1D (reaction)
Definition: analyticalSolutions.c:1754
poissonsEquationExp1D
int poissonsEquationExp1D(int *iwork, double *rwork, int nPoints, double t, double *X, double *u)
Poisson Exponential Equation 1D.
Definition: analyticalSolutions.c:1620
NonlinearDAE_f
int NonlinearDAE_f(int *iwork, double *rwork, int nPoints, double t, double *x, double *f)
Nonlinear Differential-algebraic equations.
Definition: analyticalSolutions.c:1330
NonlinearDAE
int NonlinearDAE(int *iwork, double *rwork, int nPoints, double T, double *x, double *u)
Nonlinear Differential-algebraic equations.
Definition: analyticalSolutions.c:1287
PoiseuillePipeFlow
int PoiseuillePipeFlow(int *iwork, double *rwork, int nPoints, double t, double *x, double *u)
Poiseuille Flow through a circular pipe.
Definition: analyticalSolutions.c:1466
q
Double q
Definition: Headers.h:81
df
double df(double C, double b, double a, int q, int r)
Definition: analyticalSolutions.c:2209
diffusionSin2D
int diffusionSin2D(int *iwork, double *rwork, int nPoints, double t, double *x, double *u)
Sinusoidal 2D diffusion.
Definition: analyticalSolutions.c:111
diffusionSin3D
int diffusionSin3D(int *iwork, double *rwork, int nPoints, double t, double *x, double *u)
Sinusoidal 3D diffusion.
Definition: analyticalSolutions.c:141
vel
void vel(double rS, double norm_v, double r, double theta, double *vR, double *vTHETA)
Definition: analyticalSolutions.c:2163
LinearAD_SteadyState
int LinearAD_SteadyState(int *iwork, double *rwork, int nPoints, double t, double *X, double *u)
Linear Advection-Diffusion Steady State.
Definition: analyticalSolutions.c:508
vx
Double vx
Definition: Headers.h:97
NonlinearADR_Decay_DiracIC_r
int NonlinearADR_Decay_DiracIC_r(int *iwork, double *rwork, int nPoints, double T, double *x, double *u, double *r)
Non Linear Avection Diffusion Reaction Decay Dirac Initial Condition (reaction)
Definition: analyticalSolutions.c:1257
STflowSphere_Vx
int STflowSphere_Vx(int *iwork, double *rwork, int nPoints, double t, double *x, double *u)
Stokes Flow around moving Sphere.
Definition: analyticalSolutions.c:1929
poissonsEquationExp3D_dr
int poissonsEquationExp3D_dr(int *iwork, double *rwork, int nPoints, double t, double *X, double *u, double *dr)
Poisson Exponential Equation 3D (dr)
Definition: analyticalSolutions.c:1724
LinearADR_Sine_du
int LinearADR_Sine_du(int *iwork, double *rwork, int nPoints, double t, double *x, double *f)
Linear Avection Diffusion Reaction Sine function (du)
Definition: analyticalSolutions.c:890
T
Double T
Definition: Headers.h:87
vy
Double vy
Definition: Headers.h:98
poissonsEquationExp3D_r
int poissonsEquationExp3D_r(int *iwork, double *rwork, int nPoints, double t, double *X, double *u, double *r)
Poisson Exponential Equation 3D (reaction)
Definition: analyticalSolutions.c:1822
u
Double u
Definition: Headers.h:89
LinearADR_Sine_advectiveVelocity
int LinearADR_Sine_advectiveVelocity(int *iwork, double *rwork, int nPoints, double t, double *x, double *f)
Linear Avection Diffusion Reaction Sine function (advective velocity)
Definition: analyticalSolutions.c:749
diffusionSin2D_r
int diffusionSin2D_r(int *iwork, double *rwork, int nPoints, double t, double *x, double *u, double *r)
Sinusoidal 2D diffusion (reaction)
Definition: analyticalSolutions.c:200
poissonsEquationExp2D_r
int poissonsEquationExp2D_r(int *iwork, double *rwork, int nPoints, double t, double *X, double *u, double *r)
Poisson Exponential Equation 2D (reaction)
Definition: analyticalSolutions.c:1787
NonlinearADR_Decay_DiracIC
int NonlinearADR_Decay_DiracIC(int *iwork, double *rwork, int nPoints, double T, double *x, double *u)
Non Linear Avection Diffusion Reaction Decay Dirac Initial Condition.
Definition: analyticalSolutions.c:1164
PlaneCouetteFlow_u
int PlaneCouetteFlow_u(int *iwork, double *rwork, int nPoints, double t, double *x, double *u)
Couette Flow between two parallel plates. One moving relative to the other with constant seperation (...
Definition: analyticalSolutions.c:36
LinearADR_Decay_DiracIC
int LinearADR_Decay_DiracIC(int *iwork, double *rwork, int nPoints, double T, double *x, double *u)
Linear Avection Diffusion Reaction Decay Dirac Initial Condition.
Definition: analyticalSolutions.c:566
STflowSphere_Vz
int STflowSphere_Vz(int *iwork, double *rwork, int nPoints, double t, double *x, double *u)
Stokes Flow around moving Sphere.
Definition: analyticalSolutions.c:2055
LinearAD_DiracIC_totalVelocity
int LinearAD_DiracIC_totalVelocity(int *iwork, double *rwork, int nPoints, double T, double *x, double *f)
Linear Advective Diffusion Dirac Initial Condition(total velocity)
Definition: analyticalSolutions.c:471
LinearADR_Decay_DiracIC_r
int LinearADR_Decay_DiracIC_r(int *iwork, double *rwork, int nPoints, double T, double *x, double *u, double *r)
Linear Avection Diffusion Reaction Decay Dirac Initial Condition (reaction)
Definition: analyticalSolutions.c:652
LinearADR_Sine_totalVelocity
int LinearADR_Sine_totalVelocity(int *iwork, double *rwork, int nPoints, double t, double *x, double *f)
Linear Avection Diffusion Reaction Sine function (total velocity)
Definition: analyticalSolutions.c:997
LinearADR_Sine_r
int LinearADR_Sine_r(int *iwork, double *rwork, int nPoints, double t, double *x, double *u, double *r)
Linear Avection Diffusion Reaction Sine function (reaction)
Definition: analyticalSolutions.c:938
LinearAD_DiracIC_du
int LinearAD_DiracIC_du(int *iwork, double *rwork, int nPoints, double T, double *x, double *f)
Linear Advective Diffusion Dirac Initial Condition (du)
Definition: analyticalSolutions.c:423
LinearADR_Sine
int LinearADR_Sine(int *iwork, double *rwork, int nPoints, double t, double *x, double *u)
Linear Avection Diffusion Reaction Sine function.
Definition: analyticalSolutions.c:691
LinearAD_DiracIC
int LinearAD_DiracIC(int *iwork, double *rwork, int nPoints, double T, double *x, double *u)
Linear Advective Diffusion Dirac Initial Condition.
Definition: analyticalSolutions.c:273
LinearAD_DiracIC_diffusiveVelocity
int LinearAD_DiracIC_diffusiveVelocity(int *iwork, double *rwork, int nPoints, double T, double *x, double *f)
Linear Advective Diffusion Dirac Initial Condition(diffusive velocity)
Definition: analyticalSolutions.c:381
PlanePoiseuilleFlow_u
int PlanePoiseuilleFlow_u(int *iwork, double *rwork, int nPoints, double t, double *x, double *u)
Poiseuille Flow between two parallel fixed plates with constant seperation (width).
Definition: analyticalSolutions.c:1380
r
Double r
Definition: Headers.h:83
NonlinearAD_SteadyState
int NonlinearAD_SteadyState(int *iwork, double *rwork, int nPoints, double t, double *X, double *u)
Nonlinear Advection-Diffusion Steady State.
Definition: analyticalSolutions.c:1036
LinearADR_Decay_DiracIC_dr
int LinearADR_Decay_DiracIC_dr(int *iwork, double *rwork, int nPoints, double T, double *x, double *u, double *dr)
Linear Avection Diffusion Reaction Decay Dirac Initial Condition (dr)
Definition: analyticalSolutions.c:613
STflowSphere_P
int STflowSphere_P(int *iwork, double *rwork, int nPoints, double t, double *x, double *u)
Stokes Flow around moving Sphere.
Definition: analyticalSolutions.c:1864
coords
void coords(double vx, double vy, double vz, double xS, double yS, double zS, double *x, double *r, double *theta, double *norm_v, double *eR, double *eTHETA)
Definition: analyticalSolutions.c:2093
diffusionSin3D_r
int diffusionSin3D_r(int *iwork, double *rwork, int nPoints, double t, double *x, double *u, double *r)
Sinusoidal 3D diffusion (reaction)
Definition: analyticalSolutions.c:231
f
double f(double C, double b, double a, int q, int r)
Definition: analyticalSolutions.c:2185
diffusionSin1D
int diffusionSin1D(int *iwork, double *rwork, int nPoints, double t, double *x, double *u)
Sinusoidal 1D diffusion.
Definition: analyticalSolutions.c:84
uOfX_f
double uOfX_f(double a, double b, double nlC, double nlD, double x, double lu)
Definition: analyticalSolutions.c:2181
uOfX_df
double uOfX_df(double nlC, double lu)
Definition: analyticalSolutions.c:2177