1% Models 2% Helfer Thomas 3% October 6, 2014 4 5\newcommand{\paren}[1]{\left(#1\right)} 6\newcommand{\deriv}[2]{\frac{\partial #1}{\partial #2}} 7\newcommand{\bts}[1]{\left.#1\right|_{t}} 8\newcommand{\mts}[1]{\left.#1\right|_{t+\theta\,\Delta\,t}} 9\newcommand{\ets}[1]{\left.#1\right|_{t+\Delta\,t}} 10 11Models describe the evolution of some state variables of the material 12during a time step. 13 14To illustrate how a model can be implemented using `MFront`, let us 15consider a simple solid swelling model which describes the evolution 16of the swelling \(s\) as a function of the porosity \(f\) and the 17burn-up \(\tau\): 18 19\[ 20\deriv{s}{\tau}=C_{1}\,\exp\paren{C_{2}-f} 21\] 22 23A simple semi-implicit scheme can be used to integrate this equation 24upon a time step: 25 26\[ 27\Delta\,s=C_{1}\,\exp\paren{C_{2}-\mts{f}}\,\Delta\,\tau 28\] 29 30which can be also written as: 31 32\[ 33\ets{s}=\bts{s}+C_{1}\,\exp\paren{C_{2}-\mts{f}}\,\paren{\ets{\tau}-\bts{\tau}} 34\] 35 36This equation is the basis of the `MFront` implementation of the 37model: 38 39~~~~ {#UPuCSolidSwellingModel .cpp .numberLines} 40@Parser Model; 41@Model SolidSwellingModel; 42@Material UPuC; 43@Author Helfer Thomas; 44@Date 06 december 2007; 45 46@Output s; 47s.setGlossaryName("SolidSwelling"); 48s.setDefaultInitialValue(0.); 49s.setDepth(1); 50 51@Input Bu; 52Bu.setGlossaryName("BurnUp"); 53Bu.setDepth(1); 54 55@Input f; 56f.setGlossaryName("Porosity"); 57f.setDepth(1); 58 59@Function compute 60{ 61 const real coef1 = 8.e-3; 62 const real coef2 = 4.e-2; 63 const real f_ = 0.5*(f+f_1); 64 s = s_1 + coef1*exp(coef2-f_)*(Bu-Bu_1); 65} // end of function compute 66~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 67 68<!-- Local IspellDict: english --> 69