def getMetafor(p={}): global metafor if metafor: return metafor metafor = Metafor() p = params(p) domain = metafor.getDomain() geometry = domain.getGeometry() geometry.setDimPlaneStrain(1.0) # import .geo from toolbox.gmshOld import GmshImport f = os.path.join(os.path.dirname(__file__), "FallingCylinder_Franci_muchrefined.msh") importer = GmshImport(f, domain) importer.execute2D() groupset = domain.getGeometry().getGroupSet() # solid elements / material interactionset = domain.getInteractionSet() app1 = FieldApplicator(1) app1.push(groupset(17)) # physical group 17: cylinder interactionset.add(app1) materset = domain.getMaterialSet() materset.define(1, ElastHypoMaterial) mater1 = materset(1) mater1.put(MASS_DENSITY, 1200.0) # [kg/m�] mater1.put(ELASTIC_MODULUS, 1e7) # [Pa] mater1.put(POISSON_RATIO, 0.35) # [-] prp = ElementProperties(TriangleVolume2DElement) app1.addProperty(prp) prp.put(MATERIAL, 1) prp.put(GRAVITY_Y, -9.81) # m/s2 prp.put(CAUCHYMECHVOLINTMETH, VES_CMVIM_STD) mim = metafor.getMechanicalIterationManager() mim.setMaxNbOfIterations(10) mim.setResidualTolerance(p['tolNR']) ti = AlphaGeneralizedTimeIntegration(metafor) metafor.setTimeIntegration(ti) # visu if 0: tsm = metafor.getTimeStepManager() tsm.setInitialTime(0.0, 1.0) tsm.setNextTime(1.0, 1, 1.0) # results #vmgr = metafor.getValuesManager() #vmgr.add(1, MiscValueExtractor(metafor, EXT_T), 'time') #vmgr.add(2, DbNodalValueExtractor(groupset(104), Field1D(TY,RE)), 'dy') return metafor
def getMetafor(p={}): global metafor if metafor: return metafor metafor = Metafor() p = params(p) domain = metafor.getDomain() geometry = domain.getGeometry() geometry.setDimPlaneStrain(1.0) # import .geo from toolbox.gmshOld import GmshImport f = os.path.join( os.path.dirname(__file__), "models/CantileverSquareChannel_BGS_parallel_solidMesh.geo") importer = GmshImport(f, domain) importer.execute2D() groupset = domain.getGeometry().getGroupSet() # solid elements / material interactionset = domain.getInteractionSet() app1 = FieldApplicator(1) app1.push(groupset(100)) # physical group 100 = meshed beam interactionset.add(app1) materset = domain.getMaterialSet() materset.define(1, ElastHypoMaterial) mater1 = materset(1) mater1.put(MASS_DENSITY, 100.0) # [kg/m³] mater1.put(ELASTIC_MODULUS, 2.5e5) # [Pa] mater1.put(POISSON_RATIO, 0.35) # [-] prp = ElementProperties(Volume2DElement) app1.addProperty(prp) prp.put(MATERIAL, 1) #prp.put(CAUCHYMECHVOLINTMETH,VES_CMVIM_STD) prp.put(CAUCHYMECHVOLINTMETH, VES_CMVIM_SRI) # boundary conditions loadingset = domain.getLoadingSet() #Physical Line(101) - clamped side of the beam loadingset.define(groupset(101), Field1D(TX, RE)) loadingset.define(groupset(101), Field1D(TY, RE)) mim = metafor.getMechanicalIterationManager() mim.setMaxNbOfIterations(10) mim.setResidualTolerance(p['tolNR']) ti = AlphaGeneralizedTimeIntegration(metafor) metafor.setTimeIntegration(ti) return metafor
def getMetafor(p={}): global metafor if metafor: return metafor metafor = Metafor() p = params(p) domain = metafor.getDomain() geometry = domain.getGeometry() geometry.setDimPlaneStrain(1.0) # import .geo from toolbox.gmshOld import GmshImport f = os.path.join(os.path.dirname(__file__), "waterColumnOnElasticColumn_Mtf_Pfem.msh") importer = GmshImport(f, domain) importer.execute2D() groupset = domain.getGeometry().getGroupSet() # solid elements / material interactionset = domain.getInteractionSet() app1 = FieldApplicator(1) app1.push(groupset(17)) # physical group 100: beam interactionset.add(app1) materset = domain.getMaterialSet() materset.define(1, ElastHypoMaterial) mater1 = materset(1) mater1.put(MASS_DENSITY, 1500.0) # [kg/m³] mater1.put(ELASTIC_MODULUS, 2.3e5) # [Pa] mater1.put(POISSON_RATIO, 0.4) # [-] prp = ElementProperties(TriangleVolume2DElement) app1.addProperty(prp) prp.put(MATERIAL, 1) prp.put(GRAVITY_Y, -10) # m/s2 prp.put(CAUCHYMECHVOLINTMETH, VES_CMVIM_SRIPR) # boundary conditions loadingset = domain.getLoadingSet() #Physical Line(101) - clamped side of the beam loadingset.define(groupset(12), Field1D(TX, RE)) loadingset.define(groupset(12), Field1D(TY, RE)) loadingset.define(groupset(13), Field1D(TX, RE)) #Physical Line(102) - free surface of the beam #Physical Line(103) - upper surface of the beam (for tests only) mim = metafor.getMechanicalIterationManager() mim.setMaxNbOfIterations(20) mim.setResidualTolerance(p['tolNR']) ti = AlphaGeneralizedTimeIntegration(metafor) ti.setAlphaM(0.) ti.setAlphaF(0.) metafor.setTimeIntegration(ti) # visu if 1: tsm = metafor.getTimeStepManager() #tsm.setInitialTime(0.0, 1.0) #tsm.setNextTime(1.1, 1, 1.0) # tsm.setMaxNbOfItInAdaptOfTimeStep(21) tscm = ConstantTimeStepComputationMethod(metafor) tsm.setTimeStepComputationMethod(tscm) # results #vmgr = metafor.getValuesManager() #vmgr.add(1, MiscValueExtractor(metafor, EXT_T), 'time') #vmgr.add(2, DbNodalValueExtractor(groupset(104), Field1D(TY,RE)), 'dy') return metafor
def getMetafor(p={}): global metafor if metafor: return metafor metafor = Metafor() p = params(p) domain = metafor.getDomain() geometry = domain.getGeometry() geometry.setDimAxisymmetric() # import .geo from toolbox.gmshOld import GmshImport f = os.path.join(os.path.dirname(__file__), "birdImpact_deformable_panel_Mtf_Pfem_Axisym.msh") importer = GmshImport(f, domain) importer.execute2D() groupset = domain.getGeometry().getGroupSet() # solid elements / material interactionset = domain.getInteractionSet() app1 = FieldApplicator(1) app1.push(groupset(18)) # physical group 18: panneau interactionset.add(app1) materset = domain.getMaterialSet() materset.define(1, EvpIsoHHypoMaterial) mater1 = materset(1) mater1.put(MASS_DENSITY, 2700.0) # [kg/m³] mater1.put(ELASTIC_MODULUS, 69.0e9) # [Pa] mater1.put(POISSON_RATIO, 0.3) # [-] mater1.put(YIELD_NUM, 1) materlawset = domain.getMaterialLawSet() materlawset.define(1, LinearIsotropicHardening) materlawset(1).put(IH_SIGEL, 300.0e6) # [Pa] materlawset(1).put(IH_H, 1000.0e6) # [Pa] prp = ElementProperties(Volume2DElement) app1.addProperty(prp) prp.put(MATERIAL, 1) prp.put(CAUCHYMECHVOLINTMETH, VES_CMVIM_SRIPR) '''prp.put(EASS, 2) prp.put(EASV, 2)''' # boundary conditions loadingset = domain.getLoadingSet() #Physical Line(101) - clamped side of the beam x_ext_right = 0.4 y_ext_right = -0.00635 delta = 0.00001 groupset.add(Group(50)) groupset(50).addMeshPointsInBox(x_ext_right - delta, x_ext_right + delta, y_ext_right - delta, y_ext_right + delta, -delta, delta) loadingset.define(groupset(50), Field1D(TY, RE), 0.) loadingset.define(groupset(14), Field1D(TX, RE)) #Physical Line(102) - free surface of the beam #Physical Line(103) - upper surface of the beam (for tests only) mim = metafor.getMechanicalIterationManager() mim.setResidualTolerance(p['tolNR']) # mim.setResidualComputationMethod(Method4ResidualComputation(1000.)) ti = AlphaGeneralizedTimeIntegration(metafor) metafor.setTimeIntegration(ti) # visu if 0: tsm = metafor.getTimeStepManager() tsm.setInitialTime(0.0, 1.0) tsm.setNextTime(1.0, 1, 1.0) # results (DOES NOT WORK PROPERLY!) vmgr = metafor.getValuesManager() vmgr.add(1, TdFieldValueExtractor(metafor, groupset(18), THERMODYN_TRAV_FINT), 'panel_work_int_F') vmgr.add(2, TdFieldValueExtractor(metafor, groupset(18), THERMODYN_EN_CIN), 'panel_kin_En') vmgr.add(3, TdFieldValueExtractor(metafor, groupset(18), THERMODYN_EN_DIS), 'panel_diss_En') vmgr.add(4, TdFieldValueExtractor(metafor, groupset(18), THERMODYN_TRAV_FEXT), 'panel_work_ext_F') metafor.getDbTdFieldsValueManager().setComputeEXW(True) metafor.getDbTdFieldsValueManager().setComputeINW(True) return metafor
def getMetafor(p={}): global metafor if metafor: return metafor metafor = Metafor() p = params(p) domain = metafor.getDomain() geometry = domain.getGeometry() geometry.setDimPlaneStrain(1.0) # import .geo from toolbox.gmshOld import GmshImport f = os.path.join( os.path.dirname(__file__), "waterColoumnFallWithFlexibleObstacle_Mtf_Pfem_medium.msh") importer = GmshImport(f, domain) importer.execute2D() groupset = domain.getGeometry().getGroupSet() # solid elements / material interactionset = domain.getInteractionSet() app1 = FieldApplicator(1) app1.push(groupset(21)) # physical group 100: beam interactionset.add(app1) # Materials materlawset = domain.getMaterialLawSet() materlawset.define(1, LinearIsotropicHardening) materlawset(1).put(IH_SIGEL, 5.0e4) materlawset(1).put(IH_H, 20000.) materset = domain.getMaterialSet() materset.define(1, EvpIsoHHypoMaterial) mater1 = materset(1) mater1.put(MASS_DENSITY, 2500.0) # [kg/m³] mater1.put(ELASTIC_MODULUS, 1.0e6) # [Pa] mater1.put(POISSON_RATIO, 0.) # [-] mater1.put(YIELD_NUM, 1) prp = ElementProperties(Volume2DElement) app1.addProperty(prp) prp.put(MATERIAL, 1) prp.put(CAUCHYMECHVOLINTMETH, VES_CMVIM_SRIPR) # boundary conditions loadingset = domain.getLoadingSet() #Physical Line(101) - clamped side of the beam loadingset.define(groupset(19), Field1D(TX, RE)) loadingset.define(groupset(19), Field1D(TY, RE)) #Physical Line(102) - free surface of the beam #Physical Line(103) - upper surface of the beam (for tests only) mim = metafor.getMechanicalIterationManager() mim.setMaxNbOfIterations(4) mim.setResidualTolerance(p['tolNR']) ti = AlphaGeneralizedTimeIntegration(metafor) metafor.setTimeIntegration(ti) # visu if 0: tsm = metafor.getTimeStepManager() tsm.setInitialTime(0.0, 1.0) tsm.setNextTime(1.0, 1, 1.0) # results #vmgr = metafor.getValuesManager() #vmgr.add(1, MiscValueExtractor(metafor, EXT_T), 'time') #vmgr.add(2, DbNodalValueExtractor(groupset(104), Field1D(TY,RE)), 'dy') return metafor
def getMetafor(p={}): global metafor if metafor: return metafor metafor = Metafor() p = params(p) domain = metafor.getDomain() geometry = domain.getGeometry() # --- Define the type of computation (3D, plane stress, plane strain, ...) geometry.setDim3D() # -- Import the geometry .geo and mesh it with GMSH --- from toolbox.gmshOld import GmshImport f = os.path.join(os.path.dirname(__file__), "models/agard445_solid.geo") importer = GmshImport(f, domain) importer.execute() groupset = domain.getGeometry().getGroupSet() # -- Define solid elements and material --- interactionset = domain.getInteractionSet() app1 = FieldApplicator(1) app1.push(groupset(101)) #physical group 179 = volumic mesh of the wing interactionset.add(app1) materset = domain.getMaterialSet() materset.define(1, ElastOrthoHypoMaterial) mater1 = materset(1) mater1.put(MASS_DENSITY, 381.98) #kg/m3 mater1.put(YOUNG_MODULUS_1, 3.151e9) #Pa mater1.put(YOUNG_MODULUS_2, 0.4162e9) #Pa mater1.put(YOUNG_MODULUS_3, 0.4162e9) #Pa mater1.put(POISSON_RATIO_12, 0.31) #- mater1.put(POISSON_RATIO_13, 0.31) #- mater1.put(POISSON_RATIO_23, 0.31) #- mater1.put(SHEAR_MODULUS_12, 0.4392e9) #Pa mater1.put(SHEAR_MODULUS_13, 0.4392e9) #Pa mater1.put(SHEAR_MODULUS_23, 0.4392e9) #Pa sweepOrtho = pi / 4.0 #sweepOrtho = 0.0 mater1.put(ORTHO_AX1_X, sin(sweepOrtho)) mater1.put(ORTHO_AX1_Y, cos(sweepOrtho)) mater1.put(ORTHO_AX1_Z, 0.0) mater1.put(ORTHO_AX2_X, cos(sweepOrtho)) mater1.put(ORTHO_AX2_Y, -sin(sweepOrtho)) mater1.put(ORTHO_AX2_Z, 0.0) prp = ElementProperties(Volume3DElement) app1.addProperty(prp) prp.put(MATERIAL, 1) #prp.put(CAUCHYMECHVOLINTMETH,VES_CMVIM_STD) prp.put(CAUCHYMECHVOLINTMETH, VES_CMVIM_EAS) #prp.put(CAUCHYMECHVOLINTMETH,VES_CMVIM_SRI) prp.put(PEAS, 1e-11) # -- Define prism solid elements fieldapp2 = FieldApplicator(2) fieldapp2.push(groupset(101)) interactionset.add(fieldapp2) prp2 = ElementProperties(PentaVolume3DElement) fieldapp2.addProperty(prp2) prp2.put(MATERIAL, 1) prp2.put(CAUCHYMECHVOLINTMETH, VES_CMVIM_STD) # --- Boundary conditions --- loadingset = domain.getLoadingSet() #Clamped face of the wing = physical 176 loadingset.define(groupset(176), Field1D(TX, RE)) loadingset.define(groupset(176), Field1D(TY, RE)) loadingset.define(groupset(176), Field1D(TZ, RE)) mim = metafor.getMechanicalIterationManager() mim.setMaxNbOfIterations(20) mim.setResidualTolerance(p['tolNR']) #ti = AlphaGeneralizedTimeIntegration(metafor) #metafor.setTimeIntegration(ti) # --- Used solver --- #Blas.setBlasNumThreads(14) #solman = metafor.getSolverManager() #solman.setSolver(MUMPSolver()) vmgr = metafor.getValuesManager() vmgr.add(1, DbNodalValueExtractor(groupset(183), Field1D(TZ, RE)), 'LE_dz') vmgr.add(2, DbNodalValueExtractor(groupset(184), Field1D(TZ, RE)), 'TE_dz') vmgr.add(3, DbNodalValueExtractor(groupset(183), Field1D(TY, AB)), 'LE_Y') vmgr.add(4, DbNodalValueExtractor(groupset(184), Field1D(TY, AB)), 'TE_Y') return metafor
def getMetafor(p={}): global metafor if metafor: return metafor metafor = Metafor() p = params(p) domain = metafor.getDomain() geometry = domain.getGeometry() geometry.setDimPlaneStrain(1.0) # import .geo from toolbox.gmshOld import GmshImport f = os.path.join(os.path.dirname(__file__), "VIV_cantileverBeam.msh") importer = GmshImport(f, domain) importer.execute2D() groupset = domain.getGeometry().getGroupSet() # solid elements / material interactionset = domain.getInteractionSet() app1 = FieldApplicator(1) app1.push( groupset(26) ) # physical group 100: beam interactionset.add( app1 ) materset = domain.getMaterialSet() materset.define( 1, ElastHypoMaterial ) mater1 = materset(1) mater1.put(MASS_DENSITY, 100.0) # [kg/m³] mater1.put(ELASTIC_MODULUS, 2.5e5) # [Pa] mater1.put(POISSON_RATIO, 0.35) # [-] prp = ElementProperties(Volume2DElement) app1.addProperty(prp) prp.put (MATERIAL, 1) # boundary conditions loadingset = domain.getLoadingSet() #Physical Line(101) - clamped side of the beam loadingset.define(groupset(24), Field1D(TX,RE)) loadingset.define(groupset(24), Field1D(TY,RE)) #Physical Line(102) - free surface of the beam #Physical Line(103) - upper surface of the beam (for tests only) mim = metafor.getMechanicalIterationManager() mim.setMaxNbOfIterations(10) mim.setResidualTolerance(p['tolNR']) ti = AlphaGeneralizedTimeIntegration(metafor) metafor.setTimeIntegration(ti) # visu if 0: tsm = metafor.getTimeStepManager() tsm.setInitialTime(0.0, 1.0) tsm.setNextTime(1.0, 1, 1.0) # results #vmgr = metafor.getValuesManager() #vmgr.add(1, MiscValueExtractor(metafor, EXT_T), 'time') #vmgr.add(2, DbNodalValueExtractor(groupset(104), Field1D(TY,RE)), 'dy') return metafor
def getMetafor(p={}): global metafor if metafor: return metafor metafor = Metafor() p = params(p) domain = metafor.getDomain() geometry = domain.getGeometry() geometry.setDimPlaneStrain(1.0) # import .geo from toolbox.gmshOld import GmshImport f = os.path.join(os.path.dirname(__file__), "waterColoumnWithElasticGate_Mtf_Pfem_fine.msh") importer = GmshImport(f, domain) importer.execute2D() groupset = domain.getGeometry().getGroupSet() # solid elements / material interactionset = domain.getInteractionSet() app1 = FieldApplicator(1) app1.push(groupset(21)) # physical group 100: beam interactionset.add(app1) G = 2.4e6 #2.6e6 mooneyrivlin_c1 = -1.2e6 mooneyrivlin_c2 = G / 2.0 - mooneyrivlin_c1 penal = 1.3e6 materset = domain.getMaterialSet() materset.define(1, MooneyRivlinHyperMaterial) mater1 = materset(1) mater1.put(MASS_DENSITY, 1100.) mater1.put(RUBBER_C1, mooneyrivlin_c1) mater1.put(RUBBER_C2, mooneyrivlin_c2) mater1.put(RUBBER_PENAL, penal) prp = ElementProperties(Volume2DElement) app1.addProperty(prp) prp.put(MATERIAL, 1) prp.put(GRAVITY_Y, -9.81) # m/s2 prp.put(STIFFMETHOD, STIFF_NUMERIC) # prp.put(CAUCHYMECHVOLINTMETH,VES_CMVIM_STD) # boundary conditions loadingset = domain.getLoadingSet() #Physical Line(101) - clamped side of the beam loadingset.define(groupset(19), Field1D(TX, RE)) loadingset.define(groupset(19), Field1D(TY, RE)) #Physical Line(102) - free surface of the beam #Physical Line(103) - upper surface of the beam (for tests only) mim = metafor.getMechanicalIterationManager() mim.setMaxNbOfIterations(4) mim.setResidualTolerance(p['tolNR']) ti = AlphaGeneralizedTimeIntegration(metafor) metafor.setTimeIntegration(ti) # visu if 0: tsm = metafor.getTimeStepManager() tsm.setInitialTime(0.0, 1.0) tsm.setNextTime(1.0, 1, 1.0) # results #vmgr = metafor.getValuesManager() #vmgr.add(1, MiscValueExtractor(metafor, EXT_T), 'time') #vmgr.add(2, DbNodalValueExtractor(groupset(104), Field1D(TY,RE)), 'dy') return metafor
def getMetafor(p={}): global metafor if metafor: return metafor metafor = Metafor() p = params(p) domain = metafor.getDomain() geometry = domain.getGeometry() geometry.setDimPlaneStrain(1.0) # import .geo from toolbox.gmshOld import GmshImport f = os.path.join(os.path.dirname(__file__), "elasticContainerFilling.msh") importer = GmshImport(f, domain) importer.execute2D() groupset = domain.getGeometry().getGroupSet() # solid elements / material interactionset = domain.getInteractionSet() app1 = FieldApplicator(1) app1.push(groupset(7)) # physical group 100: beam interactionset.add(app1) materset = domain.getMaterialSet() materset.define(1, ElastHypoMaterial) mater1 = materset(1) mater1.put(MASS_DENSITY, 20.0) # [kg/m³] mater1.put(ELASTIC_MODULUS, 2.1e7) # [Pa] mater1.put(POISSON_RATIO, 0.3) # [-] prp = ElementProperties(Volume2DElement) app1.addProperty(prp) prp.put(MATERIAL, 1) prp.put(GRAVITY_Y, -9.81) # m/s2 prp.put(CAUCHYMECHVOLINTMETH, VES_CMVIM_STD) # boundary conditions loadingset = domain.getLoadingSet() #Physical Line(101) - clamped side of the beam loadingset.define(groupset(3), Field1D(TX, RE)) loadingset.define(groupset(3), Field1D(TY, RE)) #Physical Line(102) - free surface of the beam #Physical Line(103) - upper surface of the beam (for tests only) mim = metafor.getMechanicalIterationManager() mim.setMaxNbOfIterations(4) mim.setResidualTolerance(p['tolNR']) ti = AlphaGeneralizedTimeIntegration(metafor) metafor.setTimeIntegration(ti) # visu if 0: tsm = metafor.getTimeStepManager() tsm.setInitialTime(0.0, 1.0) tsm.setNextTime(1.0, 1, 1.0) # results vmgr = metafor.getValuesManager() vmgr.add(1, MiscValueExtractor(metafor, EXT_T), 'timeMtf') vmgr.add( 2, DbNodalValueExtractor( groupset(7), Field1D(TY, RE), SortByDist0(0., -6.19985, 0.), 2)) #Vertical displacement of the center (upper skin) of the panel return metafor
def getMetafor(p={}): metafor = Metafor() p = params(p) # -- Geometry container and computation type domain = metafor.getDomain() geometry = domain.getGeometry() geometry.setDimPlaneStrain(1.0) # -- Import the geometry from toolbox.gmshOld import GmshImport f = os.path.join(os.path.dirname(__file__), "models/diamond_solid.geo") importer = GmshImport(f, domain) importer.execute2D() groupset = domain.getGeometry().getGroupSet() # -- Define the material matset = domain.getMaterialSet() matset.define(1, ElastHypoMaterial) mat1 = matset(1) mat1.put(MASS_DENSITY, 100.0) # [kg/m³] mat1.put(ELASTIC_MODULUS, 1e8) # [Pa] mat1.put(POISSON_RATIO, 0.35) # [-] # -- Define quad solid elements interactionset = domain.getInteractionSet() fieldapp1 = FieldApplicator(1) fieldapp1.push( groupset(121)) #physical group 'material' = volumic mesh of the wing interactionset.add(fieldapp1) prp = ElementProperties(Volume2DElement) fieldapp1.addProperty(prp) prp.put(MATERIAL, 1) prp.put(CAUCHYMECHVOLINTMETH, VES_CMVIM_STD) # -- Define tri solid elements fieldapp2 = FieldApplicator(2) fieldapp2.push(groupset(121)) interactionset.add(fieldapp2) prp2 = ElementProperties(TriangleVolume2DElement) fieldapp2.addProperty(prp2) prp2.put(MATERIAL, 1) prp2.put(CAUCHYMECHVOLINTMETH, VES_CMVIM_STD) # -- Boundary conditions loadingset = domain.getLoadingSet() # Clamped node loadingset.define(groupset(103), Field1D(TX, RE)) loadingset.define(groupset(103), Field1D(TY, RE)) # Supported node loadingset.define(groupset(102), Field1D(TX, RE)) # -- Numerical parameters mim = metafor.getMechanicalIterationManager() mim.setMaxNbOfIterations(p['maxIt']) mim.setResidualTolerance(p['relTol']) # -- for pure Metafor testing if 0: # -- Time integration ti = QuasiStaticTimeIntegration(metafor) metafor.setTimeIntegration(ti) # -- Value manager vmgr = metafor.getValuesManager() vmgr.add(1, DbNodalValueExtractor(groupset(101), Field1D(TY, RE)), 'TE_dy') # prescribe node displacement fct = PieceWiseLinearFunction() fct.setData(0.0, 0.0) fct.setData(1.0, 1.0) loadingset.define(groupset(101), Field1D(TY, RE), 0.2, fct) tsm = metafor.getTimeStepManager() tsm.setInitialTime(0.0, 0.1) tsm.setNextTime(1.0, 1, 0.1) return metafor
def getMetafor(p={}): metafor = Metafor() p = params(p) # -- Geometry container and computation type domain = metafor.getDomain() geometry = domain.getGeometry() geometry.setDim3D() # -- Import the geometry from toolbox.gmshOld import GmshImport f = os.path.join(os.path.dirname(__file__), "models/agard445_solid.geo") importer = GmshImport(f, domain) importer.execute() groupset = domain.getGeometry().getGroupSet() # -- Define the material matset = domain.getMaterialSet() matset.define(1, ElastOrthoHypoMaterial) matset.define(2, ElastOrthoHypoMaterial) mat = matset(1) mat.put(MASS_DENSITY, 381.98) # [kg/m3] mat.put(YOUNG_MODULUS_1, 3.151e9) # [Pa] mat.put(YOUNG_MODULUS_2, 0.4162e9) # [Pa] mat.put(YOUNG_MODULUS_3, 0.4162e9) # [Pa] mat.put(POISSON_RATIO_12, 0.31) # [-] mat.put(POISSON_RATIO_13, 0.31) # [-] mat.put(POISSON_RATIO_23, 0.31) # [-] mat.put(SHEAR_MODULUS_12, 0.4392e9) # [Pa] mat.put(SHEAR_MODULUS_13, 0.4392e9) # [Pa] mat.put(SHEAR_MODULUS_23, 0.4392e9) # [Pa] sweepOrtho = pi / 4.0 mat.put(ORTHO_AX1_X, sin(sweepOrtho)) mat.put(ORTHO_AX1_Y, cos(sweepOrtho)) mat.put(ORTHO_AX1_Z, 0.0) mat.put(ORTHO_AX2_X, cos(sweepOrtho)) mat.put(ORTHO_AX2_Y, -sin(sweepOrtho)) mat.put(ORTHO_AX2_Z, 0.0) mat2 = matset(2) mat2.put(MASS_DENSITY, 381.98) # [kg/m3] mat2.put(YOUNG_MODULUS_1, 3.151e9) # [Pa] mat2.put(YOUNG_MODULUS_2, 0.4162e9) # [Pa] mat2.put(YOUNG_MODULUS_3, 0.4162e9) # [Pa] mat2.put(POISSON_RATIO_12, 0.31) # [-] mat2.put(POISSON_RATIO_13, 0.31) # [-] mat2.put(POISSON_RATIO_23, 0.31) # [-] mat2.put(SHEAR_MODULUS_12, 0.4392e9) # [Pa] mat2.put(SHEAR_MODULUS_13, 0.4392e9) # [Pa] mat2.put(SHEAR_MODULUS_23, 0.4392e9) # [Pa] sweepOrtho = -pi / 4.0 mat2.put(ORTHO_AX1_X, sin(sweepOrtho)) mat2.put(ORTHO_AX1_Y, cos(sweepOrtho)) mat2.put(ORTHO_AX1_Z, 0.0) mat2.put(ORTHO_AX2_X, cos(sweepOrtho)) mat2.put(ORTHO_AX2_Y, -sin(sweepOrtho)) mat2.put(ORTHO_AX2_Z, 0.0) # -- Define hexa solid elements interactionset = domain.getInteractionSet() fieldapp1 = FieldApplicator(1) fieldapp1.push( groupset(101)) #physical group 'material' = volumic mesh of the wing interactionset.add(fieldapp1) prp = ElementProperties(Volume3DElement) fieldapp1.addProperty(prp) prp.put(MATERIAL, 1) prp.put(CAUCHYMECHVOLINTMETH, VES_CMVIM_EAS) prp.put(PEAS, 1e-10) # -- Define prism solid elements fieldapp2 = FieldApplicator(2) fieldapp2.push(groupset(101)) interactionset.add(fieldapp2) prp2 = ElementProperties(PentaVolume3DElement) fieldapp2.addProperty(prp2) prp2.put(MATERIAL, 1) prp2.put(CAUCHYMECHVOLINTMETH, VES_CMVIM_STD) # -- Define hexa solid elements: symmetry interactionset = domain.getInteractionSet() fieldapp3 = FieldApplicator(3) fieldapp3.push( groupset(102)) #physical group 'material' = volumic mesh of the wing interactionset.add(fieldapp3) prp3 = ElementProperties(Volume3DElement) fieldapp3.addProperty(prp3) prp3.put(MATERIAL, 2) prp3.put(CAUCHYMECHVOLINTMETH, VES_CMVIM_EAS) prp3.put(PEAS, 1e-10) # -- Define prism solid elements: symmetry fieldapp4 = FieldApplicator(4) fieldapp4.push(groupset(102)) interactionset.add(fieldapp4) prp4 = ElementProperties(PentaVolume3DElement) fieldapp4.addProperty(prp4) prp4.put(MATERIAL, 2) prp4.put(CAUCHYMECHVOLINTMETH, VES_CMVIM_STD) # -- Boundary conditions loadingset = domain.getLoadingSet() # Clamped face loadingset.define(groupset(112), Field1D(TX, RE)) loadingset.define(groupset(112), Field1D(TY, RE)) loadingset.define(groupset(112), Field1D(TZ, RE)) # -- Numerical parameters mim = metafor.getMechanicalIterationManager() mim.setMaxNbOfIterations(p['maxIt']) mim.setResidualTolerance(p['relTol']) # -- for pure Metafor testing if 0: # -- Time integration ti = QuasiStaticTimeIntegration(metafor) metafor.setTimeIntegration(ti) # -- Value manager vmgr = metafor.getValuesManager() vmgr.add(1, DbNodalValueExtractor(groupset(121), Field1D(TZ, RE)), 'TE_dz') vmgr.add(2, DbNodalValueExtractor(groupset(122), Field1D(TZ, RE)), 'LE_dz') # prescribe node displacement fct = PieceWiseLinearFunction() fct.setData(0.0, 0.0) fct.setData(1.0, 1.0) loadingset.define(groupset(122), Field1D(TZ, RE), 0.2, fct) tsm = metafor.getTimeStepManager() tsm.setInitialTime(0.0, 0.1) tsm.setNextTime(1.0, 1, 0.1) return metafor
def getMetafor(p={}): global metafor if metafor: return metafor metafor = Metafor() p = params(p) domain = metafor.getDomain() geometry = domain.getGeometry() geometry.setDimPlaneStrain(1.0) # import .geo from toolbox.gmshOld import GmshImport f = os.path.join(os.path.dirname(__file__), "MovingSquareCoarse.msh") importer = GmshImport(f, domain) importer.execute2D() groupset = domain.getGeometry().getGroupSet() # solid elements / material interactionset = domain.getInteractionSet() app1 = FieldApplicator(1) app1.push( groupset(5) ) # physical group 5: square interactionset.add( app1 ) materset = domain.getMaterialSet() materset.define( 1, ElastHypoMaterial ) mater1 = materset(1) mater1.put(MASS_DENSITY, 1.2) # [kg/m3] mater1.put(ELASTIC_MODULUS, 1e9) # [Pa] (Value given by Franci et al. (CMAME, 2016) --> to be verified) mater1.put(POISSON_RATIO, 0.49) # [-] prp = ElementProperties(Volume2DElement) app1.addProperty(prp) prp.put (MATERIAL, 1) prp.put(GRAVITY_Y, -10.) # m/s2 prp.put(CAUCHYMECHVOLINTMETH,VES_CMVIM_STD) mim = metafor.getMechanicalIterationManager() mim.setMaxNbOfIterations(10) mim.setResidualTolerance(p['tolNR']) ti = AlphaGeneralizedTimeIntegration(metafor) '''ti.setAlphaM(0.) ti.setAlphaF(0.) ti.setBeta0(0.25) ti.setGamma0(0.5)''' metafor.setTimeIntegration(ti) # visu if 0: tsm = metafor.getTimeStepManager() tsm.setInitialTime(0.0, 1.0) tsm.setNextTime(1.0, 1, 1.0) # results #vmgr = metafor.getValuesManager() #vmgr.add(1, MiscValueExtractor(metafor, EXT_T), 'time') #vmgr.add(2, DbNodalValueExtractor(groupset(104), Field1D(TY,RE)), 'dy') return metafor
def getMetafor(p={}): global metafor if metafor: return metafor metafor = Metafor() p = params(p) domain = metafor.getDomain() geometry = domain.getGeometry() geometry.setDimAxisymmetric() # import .geo from toolbox.gmshOld import GmshImport f = os.path.join( os.path.dirname(__file__), "birdImpact_deformable_panel_Mtf_Pfem_Smojver_Axisym.msh") importer = GmshImport(f, domain) importer.execute2D() groupset = domain.getGeometry().getGroupSet() # solid elements / material interactionset = domain.getInteractionSet() app1 = FieldApplicator(1) app1.push(groupset(22)) # physical group 22: panneau interactionset.add(app1) materset = domain.getMaterialSet() materset.define(1, EvpIsoHHypoMaterial) mater1 = materset(1) mater1.put(MASS_DENSITY, 2713.0) # [kg/m³] mater1.put(ELASTIC_MODULUS, 68.26e9) # [Pa] mater1.put(POISSON_RATIO, 0.33) # [-] mater1.put(YIELD_NUM, 1) materlawset = domain.getMaterialLawSet() materlawset.define(1, LinearIsotropicHardening) materlawset(1).put(IH_SIGEL, 262.0e6) # [Pa] materlawset(1).put(IH_H, 2590.0e6) # [Pa] prp = ElementProperties(Volume2DElement) app1.addProperty(prp) prp.put(MATERIAL, 1) prp.put(CAUCHYMECHVOLINTMETH, VES_CMVIM_SRIPR) # boundary conditions loadingset = domain.getLoadingSet() loadingset.define(groupset(15), Field1D( TY, RE)) # Forbid vertical displacements on part of the panel loadingset.define(groupset(16), Field1D(TX, RE)) # Clamping loadingset.define(groupset(16), Field1D(TY, RE)) # Clamping loadingset.define(groupset(18), Field1D(TX, RE)) # Axisymmetry mim = metafor.getMechanicalIterationManager() mim.setResidualTolerance(p['tolNR']) # mim.setResidualComputationMethod(Method4ResidualComputation(1000.)) ti = AlphaGeneralizedTimeIntegration(metafor) metafor.setTimeIntegration(ti) # visu if 0: tsm = metafor.getTimeStepManager() tsm.setInitialTime(0.0, 1.0) tsm.setNextTime(1.0, 1, 1.0) # results (DOES NOT WORK PROPERLY!) vmgr = metafor.getValuesManager() vmgr.add(1, TdFieldValueExtractor(metafor, groupset(22), THERMODYN_TRAV_FINT), 'panel_work_int_F') vmgr.add(2, TdFieldValueExtractor(metafor, groupset(22), THERMODYN_EN_CIN), 'panel_kin_En') vmgr.add(3, TdFieldValueExtractor(metafor, groupset(22), THERMODYN_EN_DIS), 'panel_diss_En') vmgr.add(4, TdFieldValueExtractor(metafor, groupset(22), THERMODYN_TRAV_FEXT), 'panel_work_ext_F') metafor.getDbTdFieldsValueManager().setComputeEXW(True) metafor.getDbTdFieldsValueManager().setComputeINW(True) return metafor