# source:trunk/sample/miscellaneous/FDM/FDM_din.mso@977

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.6 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.
11*
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
22using "FDM";
23
24FlowSheet FDM_din
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 = 2;
46
47        EQUATIONS
48        #Equacao do modelo
49        diff(ex.y(2:ex.N))*'s' = (1/Pe)*ex.dif2x(2:ex.N) - ex.dif1x(2:ex.N) - Da*ex.y(2:ex.N)^m;
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        INITIAL
60        #Condicao inicial
61        ex.y(2:ex.N)=0;
62
63        OPTIONS
64        TimeStep = 0.02;
65        TimeEnd = 0.5;
66        TimeUnit = 's';
67        Dynamic = true;
68end
69
70
Note: See TracBrowser for help on using the repository browser.