![]() |
00001 // Copyright (C) 2004 Harald Svensson. 00002 // Licensed under the GNU GPL Version 2. 00003 00004 #ifndef __EULER_H 00005 #define __EULER_H 00006 00007 #include <dolfin/PDE.h> 00008 00009 namespace dolfin 00010 { 00011 00012 class Euler : public PDE 00013 { 00014 00015 public: 00016 00017 Euler(Function::Vector& SourceMomentum, 00018 Function SourceEnergy, 00019 Function FluidViscosity, 00020 Function FluidConductivity, 00021 Function::Vector& ulinear, 00022 Function::Vector& uprevious) : 00023 PDE(3,5), fm(3), ulin(5), up(5) 00024 { 00025 add(fm, SourceMomentum); 00026 add(fe, SourceEnergy); 00027 add(am, FluidViscosity); 00028 add(ae, FluidConductivity); 00029 add(ulin, ulinear); 00030 add(up, uprevious); 00031 00032 } 00033 00034 real lhs(ShapeFunction::Vector& u, ShapeFunction::Vector& v) 00035 { 00036 00037 ElementFunction Aij_Time_Continuity = 0.1; 00038 ElementFunction Aij_Conv_Continuity = 0.1; 00039 ElementFunction Aij_Pres_Continuity = 0.1; 00040 ElementFunction Aij_Diff_Continuity = 0.1; 00041 ElementFunction Aij_Dill_Continuity = 0.1; 00042 ElementFunction Aij_Stab_Continuity = 0.1; 00043 00044 ElementFunction Aij_Time_Momentum = 0.01; 00045 ElementFunction Aij_Conv_Momentum = 0.01; 00046 ElementFunction Aij_Pres_Momentum = 0.01; 00047 ElementFunction Aij_Diff_Momentum = 0.01; 00048 ElementFunction Aij_Dill_Momentum = 0.01; 00049 ElementFunction Aij_Stab_Momentum = 0.01; 00050 00051 ElementFunction Aij_Time_Energy = 0.02; 00052 ElementFunction Aij_Conv_Energy = 0.02; 00053 ElementFunction Aij_Pres_Energy = 0.02; 00054 ElementFunction Aij_Diff_Energy = 0.02; 00055 ElementFunction Aij_Dill_Energy = 0.02; 00056 ElementFunction Aij_Stab_Energy = 0.02; 00057 00058 ElementFunction Aij_Time = 0.0; 00059 ElementFunction Aij_Conv = 0.0; 00060 ElementFunction Aij_Pres = 0.0; 00061 ElementFunction Aij_Diff = 0.0; 00062 ElementFunction Aij_Dill = 0.0; 00063 ElementFunction Aij_Stab = 0.0; 00064 00065 00066 Aij_Time = Aij_Time_Continuity + Aij_Time_Momentum + Aij_Time_Energy; 00067 00068 Aij_Conv = Aij_Conv_Continuity + Aij_Conv_Momentum + Aij_Conv_Energy; 00069 00070 00071 Aij_Pres = Aij_Pres_Continuity + Aij_Pres_Momentum + Aij_Pres_Energy; 00072 00073 Aij_Diff = Aij_Diff_Continuity + am*Aij_Diff_Momentum + ae*Aij_Diff_Energy; 00074 00075 return ( ( Aij_Time + k*(Aij_Conv + Aij_Pres + Aij_Diff) ) *dx ); 00076 } 00077 00078 00079 real rhs(ShapeFunction::Vector& v) 00080 { 00081 00082 ElementFunction bj_Time_Continuity = 0.01; 00083 ElementFunction bj_Conv_Continuity = 0.02; 00084 ElementFunction bj_Diff_Continuity = 0.03; 00085 ElementFunction bj_Dill_Continuity = 0.04; 00086 ElementFunction bj_Stab_Continuity = 0.05; 00087 ElementFunction bj_Load_Continuity = 0.06; 00088 00089 ElementFunction bj_Time_Momentum = 0.02; 00090 ElementFunction bj_Conv_Momentum = 0.03; 00091 ElementFunction bj_Diff_Momentum = 0.04; 00092 ElementFunction bj_Dill_Momentum = 0.05; 00093 ElementFunction bj_Stab_Momentum = 0.06; 00094 ElementFunction bj_Load_Momentum = 0.07; 00095 00096 ElementFunction bj_Time_Energy = 0.03; 00097 ElementFunction bj_Conv_Energy = 0.04; 00098 ElementFunction bj_Diff_Energy = 0.05; 00099 ElementFunction bj_Dill_Energy = 0.06; 00100 ElementFunction bj_Stab_Energy = 0.07; 00101 ElementFunction bj_Load_Energy = 0.08; 00102 00103 ElementFunction bj_Time = 0.0; 00104 ElementFunction bj_Conv = 0.0; 00105 ElementFunction bj_Diff = 0.0; 00106 ElementFunction bj_Dill = 0.0; 00107 ElementFunction bj_Stab = 0.0; 00108 ElementFunction bj_Load = 0.0; 00109 00110 00111 bj_Time = bj_Time_Continuity + bj_Time_Momentum + bj_Time_Energy; 00112 00113 bj_Load = bj_Load_Continuity + bj_Load_Momentum + bj_Load_Energy; 00114 00115 return ( ( bj_Time + k*(bj_Conv + bj_Diff + bj_Load) )*dx ); 00116 } 00117 00118 private: 00119 00120 ElementFunction::Vector fm; // Momentum Source term 00121 ElementFunction fe; // Energy Source term 00122 ElementFunction am; // Fluid Viscosity ( momentum diffusivity ) 00123 ElementFunction ae; // Fluid Conductivity ( energy diffusivity ) 00124 00125 ElementFunction::Vector ulin; // u linear 00126 00127 ElementFunction::Vector up; // u prevoius 00128 00129 }; 00130 00131 } 00132 00133 #endif
Documentation automatically generated with Doxygen on 10 Sep 2004.