Last change
on this file since 977 was
977,
checked in by Argimiro Resende Secchi, 6 years ago
|
examples of finite difference
|
File size:
1.4 KB
|
Line | |
---|
1 | #*--------------------------------------------------------------------- |
---|
2 | * EMSO Model Library (EML) Copyright (C) 2004 - 2016 ALSOC. |
---|
3 | * |
---|
4 | * This LIBRARY is free software; you can distribute it and/or modify |
---|
5 | * it under the therms of the ALSOC FREE LICENSE as available at |
---|
6 | * http://www.enq.ufrgs.br/alsoc. |
---|
7 | * |
---|
8 | * EMSO Copyright (C) 2004 - 2016 ALSOC, original code |
---|
9 | * from http://www.rps.eng.br Copyright (C) 2002-2004. |
---|
10 | * All rights reserved. |
---|
11 | * |
---|
12 | * EMSO is distributed under the therms of the ALSOC LICENSE as |
---|
13 | * available at http://www.enq.ufrgs.br/alsoc. |
---|
14 | * |
---|
15 | *---------------------------------------------------------------------- |
---|
16 | * Author: Argimiro R. Secchi |
---|
17 | * COPPE/UFRJ - Group of Modeling, Simulation, Control, |
---|
18 | * and Optimization of Processes |
---|
19 | * $Id$ |
---|
20 | *--------------------------------------------------------------------*# |
---|
21 | |
---|
22 | using "FDM"; |
---|
23 | |
---|
24 | FlowSheet FDM_ss |
---|
25 | |
---|
26 | PARAMETERS |
---|
27 | Da as Real; |
---|
28 | Pe as Real; |
---|
29 | m as Real; |
---|
30 | |
---|
31 | DEVICES |
---|
32 | #Carregando o modulo de diferencas finitas |
---|
33 | ex as MDF; |
---|
34 | |
---|
35 | SET |
---|
36 | #Especificando o valor de x0 |
---|
37 | ex.xi = 0; |
---|
38 | #Especificando o valor de xf |
---|
39 | ex.xf = 1; |
---|
40 | #Especificando o valor de N |
---|
41 | ex.N = 20; |
---|
42 | |
---|
43 | Da = 5; |
---|
44 | m = 1; |
---|
45 | Pe = 200; |
---|
46 | |
---|
47 | EQUATIONS |
---|
48 | #Equacao do modelo |
---|
49 | (1/Pe)*ex.dif2x - ex.dif1x - Da*ex.y^m = 0; |
---|
50 | |
---|
51 | #Especificando as condicoes de contorno |
---|
52 | #Para x=xf |
---|
53 | ex.dif1x(ex.N+1)=0; |
---|
54 | |
---|
55 | #Para x=xi |
---|
56 | -1/Pe * ex.dif1x(1) = 1 - ex.y(1); |
---|
57 | # ex.y(1)=1; |
---|
58 | |
---|
59 | OPTIONS |
---|
60 | Dynamic = false; |
---|
61 | end |
---|
62 | |
---|
63 | |
---|
Note: See
TracBrowser
for help on using the repository browser.