flowFields = models.FlowFields('flow') fmodel = models.FlowModelA(geomFields, flowFields, meshes) ## set bc for top to be a wall with x velocity bc3 = fmodel.getBCMap()[3] bc3.bcType = 'NoSlipWall' bc3.setVar('specifiedXVelocity', 1) ## set viscosity and density, this is done per mesh since each mesh has its own VC object vcMap = fmodel.getVCMap() for vc in vcMap.values(): vc.setVar('density', 1.0) vc.setVar('viscosity', 1.0) momSolver = fvmbaseExt.AMG() momSolver.relativeTolerance = 1e-1 momSolver.nMaxIterations = 20 momSolver.maxCoarseLevels = 20 momSolver.verbosity = 0 contSolver = fvmbaseExt.AMG() contSolver.relativeTolerance = 1e-1 contSolver.nMaxIterations = 20 contSolver.verbosity = 0 contSolver.maxCoarseLevels = 20 foptions = fmodel.getOptions() foptions.momentumLinearSolver = momSolver foptions.pressureLinearSolver = contSolver
geomFields = models.GeomFields('geom') metricsCalculator = models.MeshMetricsCalculatorA(geomFields,meshes) metricsCalculator.init() if atype == 'tangent': metricsCalculator.setTangentCoords(0,7,1) flowFields = models.FlowFields('flow') fmodel = models.FlowModelA(geomFields,flowFields,meshes) reader.importFlowBCs(fmodel) #fmodel.printBCs() momSolver = fvmbaseExt.AMG() momSolver.relativeTolerance = 1e-1 #momSolver.nMaxIterations = 20 #momSolver.maxCoarseLevels=20 momSolver.verbosity=0 #contSolver = fvmbaseExt.AMG() pc = fvmbaseExt.AMG() pc.verbosity=0 contSolver = fvmbaseExt.BCGStab() contSolver.preconditioner = pc contSolver.relativeTolerance = 1e-1 contSolver.nMaxIterations = 20 contSolver.verbosity=0 #contSolver.maxCoarseLevels=20
## set bc for top to be at 400 bc3 = tmodel.getBCMap()[3] bc3.bcType = 'SpecifiedTemperature' bc3.setVar('specifiedTemperature', 300) bc4 = tmodel.getBCMap()[4] bc4.bcType = 'SpecifiedTemperature' bc4.setVar('specifiedTemperature', 400) ## set viscosity and density, this is done per mesh since each mesh has its own VC object #vcMap = tmodel.getVCMap() #for vc in vcMap.values(): # vc.setVar('density',1.0) # vc.setVar('thermalConductivity',1.0) tSolver = fvmbaseExt.AMG() tSolver.relativeTolerance = 1e-6 tSolver.nMaxIterations = 20 tSolver.maxCoarseLevels = 20 tSolver.verbosity = 1 toptions = tmodel.getOptions() toptions.linearSolver = tSolver #import debug tmodel.init() tmodel.advance(1) dumpTecplotFile(nmesh, meshes)
geomFields = models.GeomFields('geom') metricsCalculator = models.MeshMetricsCalculatorA(geomFields, meshes) metricsCalculator.init() if atype == 'tangent': metricsCalculator.setTangentCoords(0, 7, 1) flowFields = models.FlowFields('flow') fmodel = models.FlowModelA(geomFields, flowFields, meshes) reader.importFlowBCs(fmodel) pc = fvmbaseExt.AMG() pc.verbosity = 0 cSolver = fvmbaseExt.BCGStab() cSolver.preconditioner = pc #cSolver=pc pc.maxCoarseLevels = 0 cSolver.relativeTolerance = 1e-6 cSolver.nMaxIterations = 20 cSolver.verbosity = 1 foptions = fmodel.getOptions() foptions.coupledLinearSolver = cSolver foptions.momentumTolerance = 1e-3 foptions.continuityTolerance = 1e-3