示例#1
0
    def __init__(self,
                 name,
                 regions,
                 calculationTimes,
                 gravity,
                 density,
                 viscosity,
                 boundaryConditions,
                 initialConditions=None,
                 zoneConditions=None,
                 source=None,
                 outputs=None,
                 defaultBoundaryCondition=None,
                 defaultInitialCondition=None):
        """Problem initialisation with :
        - a name (string)
        - one or several regions (object Region or list of Region)
        - one or several boundary conditions (object BoundaryCondition
          or list of BoundaryCondition)
        - a gravity (object Gravity)
        - a density (object Density)
        - a viscosity (object Viscosity)
        - OPTIONAL :
          --> one or several zone conditions (object ZoneCondition
              or list of ZoneCondition)
          --> one or several sources (object Source or list of Source)
          --> one or several outputs (object ExpectedOutput or list of
              ExpectedOutput)
          --> a tuple to define default boundary condition.
              It will be used if boundaryConditions defined in the problem
              don't cover entire boundaries.
              First element of tuple contains a string which represent
                default boundary condition type ('Dirichlet' or 'Neumann' For example)
              Second Element represent a PhysicalQuantity with default Boundary Condition Value
                Head(0.) or HeadGradient(0.) for example
          --> a PhysiqualQuantity to define value of default initial condition
        """

        # regions treatment
        regions = toList(regions)
        from datamodel import Permeability, IntrinsicPermeability
        from datamodel import MatrixCompressibilityFactor, Porosity, LiquidResidualSaturation
        verifySomeOfPhysicalQuantitiesExists(
            [Permeability, IntrinsicPermeability], regions, option='exclusive')
        verifyPhysicalQuantityExists(
            [MatrixCompressibilityFactor, Porosity, LiquidResidualSaturation],
            regions)

        HydraulicProblem.__init__(self, 'unsaturated', name, regions,
                                  boundaryConditions, calculationTimes,
                                  gravity, density, viscosity,
                                  initialConditions, zoneConditions, source,
                                  outputs, defaultBoundaryCondition,
                                  defaultInitialCondition)

        # Consistance problem verification
        if self.density == None:
            raise Exception, " you have to define a density before launching the problem "

        return
    def __init__(self, name, regions,calculationTimes,
                 gravity,
                 density,
                 viscosity,                 
                 boundaryConditions,
                 initialConditions = None,
                 zoneConditions = None,
                 source=None,
                 outputs=None,
                 defaultBoundaryCondition=None,
                 defaultInitialCondition=None):
        """Problem initialisation with :
        - a name (string)
        - one or several regions (object Region or list of Region)
        - one or several boundary conditions (object BoundaryCondition
          or list of BoundaryCondition)
        - a gravity (object Gravity)
        - a density (object Density)
        - a viscosity (object Viscosity)
        - OPTIONAL :
          --> one or several zone conditions (object ZoneCondition
              or list of ZoneCondition)
          --> one or several sources (object Source or list of Source)
          --> one or several outputs (object ExpectedOutput or list of
              ExpectedOutput)
          --> a tuple to define default boundary condition.
              It will be used if boundaryConditions defined in the problem
              don't cover entire boundaries.
              First element of tuple contains a string which represent
                default boundary condition type ('Dirichlet' or 'Neumann' For example)
              Second Element represent a PhysicalQuantity with default Boundary Condition Value
                Head(0.) or HeadGradient(0.) for example
          --> a PhysiqualQuantity to define value of default initial condition
        """


        # regions treatment
        regions = toList(regions)
        from datamodel import Permeability, IntrinsicPermeability
        from datamodel import MatrixCompressibilityFactor,Porosity,LiquidResidualSaturation
        verifySomeOfPhysicalQuantitiesExists([Permeability, IntrinsicPermeability], regions,option='exclusive')
        verifyPhysicalQuantityExists([MatrixCompressibilityFactor,Porosity,LiquidResidualSaturation], regions)

        HydraulicProblem.__init__(self,'unsaturated',name, regions,boundaryConditions,calculationTimes,
                                  gravity,density,viscosity,
                                  initialConditions,zoneConditions,
                                  source,outputs,defaultBoundaryCondition,defaultInitialCondition)
        
        # Consistance problem verification
        if self.density == None: raise Exception, " you have to define a density before launching the problem "

        return
    def __init__(self,
                 name,
                 regions,
                 boundaryConditions,
                 initialConditions = None,\
                 temperature = None,\
                 simulationType = None,\
                 calculationTimes = None,\
                 gravity = None,
                 density = None,
                 source = None,
                 intrinsicPermeability = None,\
                 viscosity = None,
                 outputs = None):
        """Problem initialisation with :
        - a name (string)
        - one or several regions (object Region or list of Region)
        - one or several boundary conditions (object BoundaryCondition
          or list of BoundaryCondition)
        - OPTIONAL :
          --> one or several zone conditions (object ZoneCondition
              or list of ZoneCondition)
          --> one or several sources (object Source or list of Source)
          --> a gravity (object Gravity) 
          --> a density (object Density)
          --> a viscosity (object Viscosity)
          --> one or several outputs (object ExpectedOutput or list of
              ExpectedOutput)
          """

        # regions treatment
        regions = toList(regions)
        verifySomeOfPhysicalQuantitiesExists(
            [Permeability, IntrinsicPermeability], regions, option="inclusive")

        HydraulicProblem.__init__(self,
                                  name = name,\
                                  saturation = "saturated",\
                                  regions = regions,
                                  boundaryConditions = boundaryConditions,\
                                  initialConditions = initialConditions,\
                                  temperature = temperature,\
                                  simulationType = simulationType,\
                                  calculationTimes = calculationTimes,\
                                  gravity = gravity,\
                                  density = density,\
                                  intrinsicPermeability =intrinsicPermeability,\
                                  viscosity = viscosity,\
                                  source = source,\
                                  outputs = outputs)
    def __init__(self,
                 name,\
                 regions,\
                 calculationTimes,\
                 fluidCompressibility,\
                 gravity,\
                 density,\
                 viscosity,\
                 boundaryConditions,\
                 initialConditions = None,\
                 zoneConditions = None,\
                 source=None,\
                 densityLaw=None,\
                 viscosityLaw=None,\
                 outputs=None):
        """
        Problem initialisation with :
        
        - a name (string)
        - one or several regions (object Region or list of Region)
        - one or several boundary conditions (object BoundaryCondition
          or list of BoundaryCondition)
        - a fluidCompressibility (object FluidCompressibility)
        - a gravity (object Gravity)
        - a density (object Density)
        - a viscosity (object Viscosity)
        
        - OPTIONAL :
        
          --> one or several zone conditions (object ZoneCondition
              or list of ZoneCondition)
          --> one or several sources (object Source or list of Source)
          --> one or several outputs (object ExpectedOutput or list of
              ExpectedOutput)
          --> a density law  (object DensityLaw)
          --> a viscosity law (object ViscosityLaw)
        """
        #
        # regions treatment
        #
        regions = toList(regions)
        from datamodel import MatrixCompressibilityFactor
        from datamodel import HydraulicPorosity
        from datamodel import IntrinsicPermeability
        verifyPhysicalQuantityExists([MatrixCompressibilityFactor,HydraulicPorosity,IntrinsicPermeability], regions)

        HydraulicProblem.__init__(self,'transient',name, regions,                 
                                  boundaryConditions,calculationTimes,
                                  gravity,density,viscosity,
                                  initialConditions,zoneConditions,
                                  source,outputs)
        
        #
        # fluidCompressibility treatment
        #
        if fluidCompressibility:
            from datamodel import FluidCompressibility
            if not isinstance(fluidCompressibility, FluidCompressibility):
                raise Exception(" fluid compressibility must be an instance of the FluidCompressibility class")
            pass
        self.fluidCompressibility = fluidCompressibility

        # densityLaw treatment
        if densityLaw:
            from datamodel import DensityLaw
            if not isinstance(densityLaw, DensityLaw):
                raise Exception(" density must be an instance of the densityLaw class")
            pass
        self.densityLaw = densityLaw


        # viscosityLaw treatment
        if viscosityLaw:
            from datamodel import ViscosityLaw
            if not isinstance(viscosityLaw, ViscosityLaw):
                raise Exception(" the viscosity law must be an instance of the ViscosityLaw class")
            pass
        self.viscosityLaw = viscosityLaw
            
        #
        # Consistance problem verification
        #
        #msg='verification density,gravity,fluidCompressibility,viscosity'
        verifyExists(self.density,self.gravity,\
                     self.fluidCompressibility,self.viscosity)

        return
示例#5
0
    def __init__(self,
                 name,\
                 regions,\
                 calculationTimes,\
                 fluidCompressibility,\
                 gravity,\
                 density,\
                 viscosity,\
                 boundaryConditions,\
                 initialConditions = None,\
                 zoneConditions = None,\
                 source=None,\
                 densityLaw=None,\
                 viscosityLaw=None,\
                 outputs=None):
        """
        Problem initialisation with :
        
        - a name (string)
        - one or several regions (object Region or list of Region)
        - one or several boundary conditions (object BoundaryCondition
          or list of BoundaryCondition)
        - a fluidCompressibility (object FluidCompressibility)
        - a gravity (object Gravity)
        - a density (object Density)
        - a viscosity (object Viscosity)
        
        - OPTIONAL :
        
          --> one or several zone conditions (object ZoneCondition
              or list of ZoneCondition)
          --> one or several sources (object Source or list of Source)
          --> one or several outputs (object ExpectedOutput or list of
              ExpectedOutput)
          --> a density law  (object DensityLaw)
          --> a viscosity law (object ViscosityLaw)
        """
        #
        # regions treatment
        #
        regions = toList(regions)
        from datamodel import MatrixCompressibilityFactor
        from datamodel import HydraulicPorosity
        from datamodel import IntrinsicPermeability
        verifyPhysicalQuantityExists([
            MatrixCompressibilityFactor, HydraulicPorosity,
            IntrinsicPermeability
        ], regions)

        HydraulicProblem.__init__(self, 'transient', name, regions,
                                  boundaryConditions, calculationTimes,
                                  gravity, density, viscosity,
                                  initialConditions, zoneConditions, source,
                                  outputs)

        #
        # fluidCompressibility treatment
        #
        if fluidCompressibility:
            from datamodel import FluidCompressibility
            if not isinstance(fluidCompressibility, FluidCompressibility):
                raise Exception(
                    " fluid compressibility must be an instance of the FluidCompressibility class"
                )
            pass
        self.fluidCompressibility = fluidCompressibility

        # densityLaw treatment
        if densityLaw:
            from datamodel import DensityLaw
            if not isinstance(densityLaw, DensityLaw):
                raise Exception(
                    " density must be an instance of the densityLaw class")
            pass
        self.densityLaw = densityLaw

        # viscosityLaw treatment
        if viscosityLaw:
            from datamodel import ViscosityLaw
            if not isinstance(viscosityLaw, ViscosityLaw):
                raise Exception(
                    " the viscosity law must be an instance of the ViscosityLaw class"
                )
            pass
        self.viscosityLaw = viscosityLaw

        #
        # Consistance problem verification
        #
        #msg='verification density,gravity,fluidCompressibility,viscosity'
        verifyExists(self.density,self.gravity,\
                     self.fluidCompressibility,self.viscosity)

        return