Example #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)
Example #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]
Example #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)
Example #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")
Example #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')
Example #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
Example #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
Example #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")
Example #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)
Example #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)
Example #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)
Example #12
0
class MolarMass(Scalar):
    """
    molar mass is the mass of one mole of substance
    """
    default_unit = _findUnit('MolarMass')
    pass
Example #13
0
class ExchangeCapacity(Scalar):
    default_unit = _findUnit('ExchangeCapacity')
    pass
Example #14
0
class PoreDiffusion(Scalar):
    default_unit = _findUnit('Diffusion')
    pass
Example #15
0
 def __init__(self, value=None, unit=None):
     default_unit = _findUnit("SpecificHeatCapacity")
     Scalar.__init__(self, value,unit=default_unit)
     pass
Example #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)
Example #17
0
class FlowRate(Scalar):
    default_unit = _findUnit('FlowRate')
    pass
Example #18
0
class KineticTimeConstant(Scalar):
    default_unit = _findUnit('Time')
    pass
Example #19
0
class MatrixCompressibilityFactor(Scalar):
    """
    compressibility of the solid matrix
    """
    default_unit = _findUnit('1/Pressure')
    pass
Example #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
Example #21
0
 def __init__(self,value,unit=None):
     default_unit = _findUnit('Permeability')
     if unit==None: unit = default_unit
     Tensor.__init__(self,value,unit)
Example #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
Example #23
0
class SpecificAreaPerMole(Scalar):
    default_unit = _findUnit('SpecificAreaPerMole')
Example #24
0
class ReactionRate(Scalar):
    default_unit = _findUnit('ReactionRate')
Example #25
0
class SolubilityLimit(Scalar):
    default_unit = _findUnit('Concentration')
    pass
Example #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
Example #27
0
 def __init__(self, value, unit=None):
     default_unit = _findUnit('HydraulicConductivity')
     if unit == None:
         unit = default_unit
         pass
     Tensor.__init__(self, value, unit)
Example #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
Example #29
0
class Velocity(Vektor):
    default_unit = _findUnit('Velocity')
    pass
Example #30
0
 def __init__(self,value,unit=None):
     default_unit = _findUnit('HydraulicConductivity')
     if unit==None:
         unit = default_unit
         pass
     Tensor.__init__(self, value, unit)
Example #31
0
 def __init__(self, value=None, unit=None):
     default_unit = _findUnit('SpecificStorage')
     Scalar.__init__(self, value,unit=default_unit)
     pass
Example #32
0
class ElectricPotential(Scalar):
    default_unit = _findUnit('ElectricPotential')
    pass