Пример #1
0
 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)
Пример #2
0
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]
Пример #3
0
 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)
Пример #4
0
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")
Пример #5
0
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')
Пример #6
0
 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
Пример #7
0
 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
Пример #8
0
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")
Пример #9
0
    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)
Пример #10
0
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)
Пример #11
0
    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)
Пример #12
0
class MolarMass(Scalar):
    """
    molar mass is the mass of one mole of substance
    """
    default_unit = _findUnit('MolarMass')
    pass
Пример #13
0
class ExchangeCapacity(Scalar):
    default_unit = _findUnit('ExchangeCapacity')
    pass
Пример #14
0
class PoreDiffusion(Scalar):
    default_unit = _findUnit('Diffusion')
    pass
Пример #15
0
 def __init__(self, value=None, unit=None):
     default_unit = _findUnit("SpecificHeatCapacity")
     Scalar.__init__(self, value,unit=default_unit)
     pass
Пример #16
0
 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)
Пример #17
0
class FlowRate(Scalar):
    default_unit = _findUnit('FlowRate')
    pass
Пример #18
0
class KineticTimeConstant(Scalar):
    default_unit = _findUnit('Time')
    pass
Пример #19
0
class MatrixCompressibilityFactor(Scalar):
    """
    compressibility of the solid matrix
    """
    default_unit = _findUnit('1/Pressure')
    pass
Пример #20
0
 def __init__(self, value=None, unit=None):
     default_unit = _findUnit("SpecificHeatCapacity")
     default_unit = 'J/g/K'
     Scalar.__init__(self, value, unit=default_unit)
     pass
Пример #21
0
 def __init__(self,value,unit=None):
     default_unit = _findUnit('Permeability')
     if unit==None: unit = default_unit
     Tensor.__init__(self,value,unit)
Пример #22
0
 def __init__(self, value=None, unit=None):
     default_unit = _findUnit('SpecificStorage')
     default_unit = '1/s'
     Scalar.__init__(self, value, unit=default_unit)
     pass
Пример #23
0
class SpecificAreaPerMole(Scalar):
    default_unit = _findUnit('SpecificAreaPerMole')
Пример #24
0
class ReactionRate(Scalar):
    default_unit = _findUnit('ReactionRate')
Пример #25
0
class SolubilityLimit(Scalar):
    default_unit = _findUnit('Concentration')
    pass
Пример #26
0
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
Пример #27
0
 def __init__(self, value, unit=None):
     default_unit = _findUnit('HydraulicConductivity')
     if unit == None:
         unit = default_unit
         pass
     Tensor.__init__(self, value, unit)
Пример #28
0
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
Пример #29
0
class Velocity(Vektor):
    default_unit = _findUnit('Velocity')
    pass
Пример #30
0
 def __init__(self,value,unit=None):
     default_unit = _findUnit('HydraulicConductivity')
     if unit==None:
         unit = default_unit
         pass
     Tensor.__init__(self, value, unit)
Пример #31
0
 def __init__(self, value=None, unit=None):
     default_unit = _findUnit('SpecificStorage')
     Scalar.__init__(self, value,unit=default_unit)
     pass
Пример #32
0
class ElectricPotential(Scalar):
    default_unit = _findUnit('ElectricPotential')
    pass