Package esys :: Package escript :: Module heat :: Class TemperatureCartesian
[hide private]
[frames] | no frames]

Class TemperatureCartesian

              object --+        
                       |        
linearPDEs.LinearProblem --+    
                           |    
     linearPDEs.TransportPDE --+
                               |
                              TemperatureCartesian

Represents and solves the temperature advection-diffusion problem

rhocp(T_{,t} + v_i T_{,i} - ( k T_{,i})_i = Q

k T_{,i}*n_i=surface_flux and T_{,t} = 0 where given_T_mask>0.

If surface_flux is not given 0 is assumed.

Typical usage:

   sp = TemperatureCartesian(domain)
   sp.setTolerance(1.e-4)
   t = 0
   T = ...
   sp.setValues(rhocp=...,  v=..., k=..., given_T_mask=...)
   sp.setInitialTemperature(T)
   while t < t_end:
       sp.setValue(Q=...)
       T = sp.getTemperature(dt)
       t += dt
Instance Methods [hide private]
 
__init__(self, domain, useBackwardEuler=False, **kwargs)
Initializes the temperature advection-diffusion problem.
 
getTemperature(self, dt, **kwargs)
Same as getSolution.
 
setInitialTemperature(self, T)
Same as setInitialSolution.
 
setValue(self, rhocp=None, v=None, k=None, Q=None, surface_flux=None, given_T_mask=None)
Sets new values to coefficients.

Inherited from linearPDEs.TransportPDE: __str__, checkSymmetry, createOperator, getConstraintWeightingFactor, getRequiredOperatorType, getSafeTimeStepSize, getSolution, getSystem, getUnlimitedTimeStepSize, setConstraintWeightingFactor, setDebug, setDebugOff, setDebugOn, setInitialSolution, useBackwardEuler

Inherited from linearPDEs.LinearProblem: alteredCoefficient, checkReciprocalSymmetry, checkSymmetricTensor, createCoefficient, createRightHandSide, createSolution, getCoefficient, getCurrentOperator, getCurrentRightHandSide, getCurrentSolution, getDim, getDomain, getDomainStatus, getFunctionSpaceForCoefficient, getFunctionSpaceForEquation, getFunctionSpaceForSolution, getNumEquations, getNumSolutions, getOperator, getOperatorType, getRightHandSide, getShapeOfCoefficient, getSolverOptions, getSystemStatus, hasCoefficient, initializeSystem, introduceCoefficients, invalidateOperator, invalidateRightHandSide, invalidateSolution, invalidateSystem, isOperatorValid, isRightHandSideValid, isSolutionValid, isSymmetric, isSystemValid, isUsingLumping, reduceEquationOrder, reduceSolutionOrder, resetAllCoefficients, resetOperator, resetRightHandSide, resetSolution, setReducedOrderForEquationOff, setReducedOrderForEquationOn, setReducedOrderForEquationTo, setReducedOrderForSolutionOff, setReducedOrderForSolutionOn, setReducedOrderForSolutionTo, setReducedOrderOff, setReducedOrderOn, setReducedOrderTo, setSolution, setSolverOptions, setSymmetry, setSymmetryOff, setSymmetryOn, setSystemStatus, trace, validOperator, validRightHandSide, validSolution

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, domain, useBackwardEuler=False, **kwargs)
(Constructor)

 

Initializes the temperature advection-diffusion problem.

Parameters:
  • domain - domain of the problem
  • useBackwardEuler (bool) - 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.
Overrides: object.__init__

setValue(self, rhocp=None, v=None, k=None, Q=None, surface_flux=None, given_T_mask=None)

 

Sets new values to coefficients.

Parameters:
  • coefficients - new values assigned to coefficients
  • M - value for coefficient M
  • M_reduced - value for coefficient M_reduced
  • A - value for coefficient A
  • A_reduced - value for coefficient A_reduced
  • B - value for coefficient B
  • B_reduced - value for coefficient B_reduced
  • C - value for coefficient C
  • C_reduced - value for coefficient C_reduced
  • D - value for coefficient D
  • D_reduced - value for coefficient D_reduced
  • X - value for coefficient X
  • X_reduced - value for coefficient X_reduced
  • Y - value for coefficient Y
  • Y_reduced - value for coefficient Y_reduced
  • m - value for coefficient m
  • m_reduced - value for coefficient m_reduced
  • d - value for coefficient d
  • d_reduced - value for coefficient d_reduced
  • y - value for coefficient y
  • d_contact - value for coefficient d_contact
  • d_contact_reduced - value for coefficient d_contact_reduced
  • y_contact - value for coefficient y_contact
  • y_contact_reduced - value for coefficient y_contact_reduced
  • r - values prescribed to the solution at the locations of constraints
  • q - mask for the location of constraints
Raises:
Overrides: linearPDEs.LinearProblem.setValue
(inherited documentation)