Beispiel #1
0
 def createModels(self):
     if self.enablePlateModel == True:
         self.plateFields = models.PlateFields('plate')
         self.pmodel = models.PlateModelA(self.geomFields, self.plateFields,
                                          self.solidMeshes)
         self.dmodel = models.PlateDeformationModelA(
             self.geomFields, self.plateFields, self.solidMeshes)
     if self.enableElecModel == True:
         self.elecFields = models.ElectricFields('elec')
         self.emodel = models.ElectricModelA(self.geomFields,
                                             self.elecFields,
                                             self.fluidMeshesNew)
     if self.enableFlowModel == True:
         self.flowFields = models.FlowFields('flow')
         self.fmodel = models.FlowModelA(self.geomFields, self.flowFields,
                                         self.fluidMeshes)
     #currently contact model is implemented in ComputeForce.py
     #if self.enableContactModel == True:
     #    self.contactFields =  models.ContactFields('contact')
     #    self.cmodel = models.ContactModelA(self.geomFields,self.contactFields,self.fluidMeshesNew)
     print 'models are created'
Beispiel #2
0
    solver_maxtime = zeros(1, dtype='d')
    solver_mintime = zeros(1, dtype='d')
    solver_start[0] = MPI.Wtime()

geomFields = models.GeomFields('geom')

fluidMetricsCalculator = models.MeshMetricsCalculatorA(geomFields, fluidMeshes)
fluidMetricsCalculator.init()

solidBoundaryMeshes = [m.extractBoundaryMesh() for m in solidMeshes]
solidBoundaryMetricsCalculator = models.MeshMetricsCalculatorA(
    geomFields, solidBoundaryMeshes)
solidBoundaryMetricsCalculator.init()

flowFields = models.FlowFields('flow')
fmodel = models.FlowModelA(geomFields, flowFields, fluidMeshes)

fluidWalls = [3, 4]
fluidInlet = [5]
fluidOutlet = [6]

circleWalls = [4]

bcMap = fmodel.getBCMap()

for id in fluidWalls:
    if id in bcMap:
        bc = bcMap[id]
        bc.bcType = 'NoSlipWall'
for id in fluidInlet:
    if id in bcMap:
Beispiel #3
0
for i in electrodeActive:
    bc = bcMap[i]
    bc.bcType = "SpecifiedPotential"
    bc['specifiedPotential'] = applied_voltage

### setup mesh vcType ###

vcMap = pd.emodel.getVCMap()
for i, vc in vcMap.iteritems():
    vc.vcType = "dielectric"
    vc['dielectric_constant'] = dielectric_constant

### flow model and boundary condition ###
pd.flowFields = models.FlowFields('flow')
pd.fmodel = models.FlowModelA(pd.geomFields, pd.flowFields, pd.fluidMeshes)

#fluidReader.importFlowBCs(pd.fmodel, pd.fluidMeshes)

### solver options ###

# structure solver
pc = fvmbaseExt.AMG()
pc.verbosity = 0
#defSolver = fvmbaseExt.BCGStab()
defSolver = fvmbaseExt.BCGStab()
defSolver.preconditioner = pc
defSolver.relativeTolerance = 1e-1
defSolver.nMaxIterations = 20
defSolver.maxCoarseLevels = 20
defSolver.verbosity = 2