def __init__(self,value,unit=None): default_unit = _findUnit('IntrinsicPermeability') if unit==None: unit = default_unit print("default unit of ",default_unit,type(default_unit)) pass Tensor.__init__(self,value,unit)
class KinematicDispersion(Scalar): """ The presence of spatially varying celerities induces a dispersion effect, referred to as kinematic dispersion. we have a dispersion tensor whose dimension is L*L/T. We have two coefficients to characterize it, the longitudinal and the transversal dispersion. Those two coefficients have the dimension of a length. As a reminder, elements of the dispersion tensor coefficients are like : dispersivityCoefficient * (velocityComponent * velocityComponent ) / velocitymodule """ unit = _findUnit('Length') def __init__(self, longitudinal, transverse=None, unit=unit): if transverse == None: transverse = 0.0 for i in (longitudinal, transverse): Scalar.verifyValue(self, i) pass self.value = (longitudinal, transverse) return def getLongitudinal(self): return self.value[0] def getTransverse(self): return self.value[1]
def __init__(self, value, unit=None): default_unit = _findUnit('IntrinsicPermeability') if unit == None: unit = default_unit print("default unit of ", default_unit, type(default_unit)) pass Tensor.__init__(self, value, unit)
class SpecificHeat(Scalar): """ Specific heat capacity, also known simply as specific heat (J/g/K), is the measure of the heat energy required to increase the temperature of a unit quantity of a substance by a certain temperature interval. """ default_unit = _findUnit("SpecificHeatCapacity")
class YoungModulus(Scalar): """ Young's modulus is a measure of the stiffness of an elastic material and is a quantity used to characterize materials. It is defined as the ratio of the stress (force per unit area) along an axis to the strain (ratio of deformation over initial length) along that axis. So, its unit is therefore the one of a pressure. """ default_unit = _findUnit('YoungModulus')
def __init__(self, value=None, unit=None): default_unit = _findUnit('Density') if unit == None: Scalar.__init__(self, value, unit=default_unit) pass else: Scalar.__init__(self, value, unit) pass
def __init__(self, value=None, unit=None): default_unit = _findUnit('Density') if unit == None: Scalar.__init__(self, value,unit=default_unit) pass else: Scalar.__init__(self, value,unit) pass
class SpecificHeatCapacity(Scalar): """ Specific heat capacity, also known simply as specific heat, is the measure of the heat energy required to increase the temperature of a unit quantity of a substance by a certain temperature interval. unit: J/g/K """ def __init__(self, value=None, unit=None): default_unit = _findUnit("SpecificHeatCapacity") default_unit = 'J/g/K' Scalar.__init__(self, value, unit=default_unit) pass default_unit = _findUnit("SpecificHeatCapacity")
def __init__(self, value=None, dxx=None, dyy=None, dzz=None, unit="kg*m/s***3/K"): self.dxx = dxx self.dyy = dyy self.dzz = dzz self.value = value self.unit = default_unit = _findUnit('ThermalConductivity') if (dxx or dyy or dzz) and not value: if (dyy or dzz) and type(dxx) == NoneType: raise Exception("check the effective diffusion definition") val = dxx if not type(dyy) == NoneType: val = Tensor2D(dxx, dyy) if not type(dzz) == NoneType: val = Tensor3D(dxx, dyy, dzz) pass elif (not type(value) == NoneType): if type(value) in [FloatType, IntType] or isInstance( value, IsotropicTensor): val = value if isinstance(value, IsotropicTensor): value = value.getValues() pass if not type(dxx) == NoneType: val = Tensor2D(value, dxx) if not type(dyy) == NoneType: val = Tensor3D(value, dxx, dyy) pass else: if type(dxx) != NoneType: raise Exception("dxx should be of none type") if type(dyy) != NoneType: raise Exception("dyy should be of none type") val = value pass if type(dzz) != NoneType: raise Exception("dzz should be of none type") pass try: vol = val except: msg = 'ya should have given a value for effective diffusion' raise Warning(msg) Tensor.__init__(self, value=val, unit=self.unit)
class EffectiveDiffusion(Tensor): """ """ unit = _findUnit('EffectiveDiffusion') def __init__(self, value=None, dxx=None, dyy=None, dzz=None, unit=unit): if type(dxx) not in [FloatType, IntType, NoneType]: raise Exception(" dxx should be a float") if type(dyy) not in [FloatType, IntType, NoneType]: raise Exception(" dyy should be a float") if type(dzz) not in [FloatType, IntType, NoneType]: raise Exception(" dzz should be a float") if value == None: if (dyy or dzz) and type(dxx) == NoneType: raise IncorrectValue("check the definition of the effective diffusion,\n"+\ " at least one real component has to be introduced (dxx)") val = dxx if type(dyy) != NoneType: val = Tensor2D(dxx, dyy) if type(dzz) != NoneType: val = Tensor3D(dxx, dyy, dzz) pass elif (type(value) != NoneType): if type(value) in [FloatType, IntType]: val = value if not type(dxx) == NoneType: val = Tensor2D(value, dxx) if not type(dyy) == NoneType: val = Tensor3D(value, dxx, dyy) pass else: if type(dxx) != NoneType: raise Exception("dxx type error") if type(dyy) != NoneType: raise Exception("dyy type error") val = value pass if type(dzz) != NoneType: six.reraise(TypeError, "dzz type error ", dzz) pass try: vol = val except: raise Warning("check the effective diffusion value ") Tensor.__init__(self, val, unit=unit)
def __init__(self,value = None,dxx = None,dyy = None,dzz = None, unit = "kg*m/s***3/K"): self.dxx = dxx self.dyy = dyy self.dzz = dzz self.value = value self.unit = default_unit = _findUnit('ThermalConductivity') if (dxx or dyy or dzz) and not value: if (dyy or dzz) and type(dxx)==NoneType: raise Exception("check the effective diffusion definition") val=dxx if not type(dyy)==NoneType:val=Tensor2D(dxx,dyy) if not type(dzz)==NoneType:val=Tensor3D(dxx,dyy,dzz) pass elif (not type(value)==NoneType): if type(value) in [FloatType, IntType] or isInstance(value,IsotropicTensor): val=value if isinstance(value,IsotropicTensor): value = value.getValues() pass if not type(dxx)==NoneType:val=Tensor2D(value,dxx) if not type(dyy)==NoneType:val=Tensor3D(value,dxx,dyy) pass else: if type(dxx) != NoneType: raise Exception("dxx should be of none type") if type(dyy) != NoneType: raise Exception("dyy should be of none type") val=value pass if type(dzz) != NoneType: raise Exception("dzz should be of none type") pass try: vol=val except: msg='ya should have given a value for effective diffusion' raise Warning(msg) Tensor.__init__(self, value=val,unit=self.unit)
class MolarMass(Scalar): """ molar mass is the mass of one mole of substance """ default_unit = _findUnit('MolarMass') pass
class ExchangeCapacity(Scalar): default_unit = _findUnit('ExchangeCapacity') pass
class PoreDiffusion(Scalar): default_unit = _findUnit('Diffusion') pass
def __init__(self, value=None, unit=None): default_unit = _findUnit("SpecificHeatCapacity") Scalar.__init__(self, value,unit=default_unit) pass
def __init__(self, value, unit=None): default_unit = _findUnit('Permeability') default_unit = "m/s" if unit == None: unit = default_unit Tensor.__init__(self, value, unit)
class FlowRate(Scalar): default_unit = _findUnit('FlowRate') pass
class KineticTimeConstant(Scalar): default_unit = _findUnit('Time') pass
class MatrixCompressibilityFactor(Scalar): """ compressibility of the solid matrix """ default_unit = _findUnit('1/Pressure') pass
def __init__(self, value=None, unit=None): default_unit = _findUnit("SpecificHeatCapacity") default_unit = 'J/g/K' Scalar.__init__(self, value, unit=default_unit) pass
def __init__(self,value,unit=None): default_unit = _findUnit('Permeability') if unit==None: unit = default_unit Tensor.__init__(self,value,unit)
def __init__(self, value=None, unit=None): default_unit = _findUnit('SpecificStorage') default_unit = '1/s' Scalar.__init__(self, value, unit=default_unit) pass
class SpecificAreaPerMole(Scalar): default_unit = _findUnit('SpecificAreaPerMole')
class ReactionRate(Scalar): default_unit = _findUnit('ReactionRate')
class SolubilityLimit(Scalar): default_unit = _findUnit('Concentration') pass
class Viscosity(Scalar): """ Viscosity is a measure of the resistance of a fluid which is being deformed by either shear stress or extensional stress. """ default_unit = _findUnit('Viscosity') pass
def __init__(self, value, unit=None): default_unit = _findUnit('HydraulicConductivity') if unit == None: unit = default_unit pass Tensor.__init__(self, value, unit)
class Density(Scalar): """ In physics, the density of a body is the measure of how tightly the matter within it is packed together. """ default_unit = _findUnit('Density') pass
class Velocity(Vektor): default_unit = _findUnit('Velocity') pass
def __init__(self,value,unit=None): default_unit = _findUnit('HydraulicConductivity') if unit==None: unit = default_unit pass Tensor.__init__(self, value, unit)
def __init__(self, value=None, unit=None): default_unit = _findUnit('SpecificStorage') Scalar.__init__(self, value,unit=default_unit) pass
class ElectricPotential(Scalar): default_unit = _findUnit('ElectricPotential') pass