59 |
T = sp.getTemperature(dt) |
T = sp.getTemperature(dt) |
60 |
t += dt |
t += dt |
61 |
""" |
""" |
62 |
def __init__(self,domain,theta=0.5,**kwargs): |
def __init__(self,domain,useBackwardEuler=False,**kwargs): |
63 |
""" |
""" |
64 |
Initializes the temperature advection-diffusion problem. |
Initializes the temperature advection-diffusion problem. |
65 |
|
|
66 |
@param domain: domain of the problem |
@param domain: domain of the problem |
67 |
@param theta: method control: |
@param useBackwardEuler: if set the backward Euler scheme is used. Otherwise the Crank-Nicholson scheme is applied. Not that backward Euler scheme will return a safe time step size which is practically infinity as the scheme is unconditional unstable. So other measures need to be applied to control the time step size. The Crank-Nicholson scheme provides a higher accuracy but requires to limit the time step size to be stable. |
68 |
- theta=1.0: backward Euler |
@type useBackwardEuler: C{bool} |
|
- theta=0.5: Crank-Nicholson scheme |
|
|
- theta=0.0: forward Euler (not recommended) |
|
69 |
""" |
""" |
70 |
TransportPDE.__init__(self,domain,numEquations=1,theta=theta,**kwargs) |
TransportPDE.__init__(self,domain,numEquations=1,useBackwardEuler=useBackwardEuler,**kwargs) |
71 |
self.setReducedOrderOn() |
self.setReducedOrderOn() |
72 |
self.__rhocp=None |
self.__rhocp=None |
73 |
self.__v=None |
self.__v=None |