AutoMPML¶
Edits a basic .mpml file with the AutoMPML class.
Create the class with options = AutoMPML. Then call the set_methods to set options. Then use write to generate the file. MPML files generated will only work with latest version of IC-FERST. Contact author if you want support for older versions.
-
class
pipemesh.icferst.auto_mpml.
AutoMPML
¶ -
set_all
(sim_name=None, msh_file='src/pipe', dump_period=0.1, dump_ids=[], finish_time=1, timestep=0.005, cfl_no=2.0, density=0.001, viscosity=0.001, inlet_phys_ids=[], inlet_velocities=[], outlet_phys_ids=[], cyl_phys_ids=[], min_mesh_size=0.01, max_mesh_size=0.5, max_no_nodes=300000.0, t_adapt_delay=0.5, aspect_ratio=0.5)¶ Sets all of the options at once.
See base functions for information on what each option sets.
-
set_inlets
(phys_ids, velocities)¶ Sets the properties for inlets.
Parameters: - phys_ids – (list of ints) physical ids of inlet surfaces.
- velocities – (list of xyz vector lists) velocities for respective physical ids. E.g. velocities[0] corresponds to phys_ids[0]. If not enough vectors are given, the first vector is used for all inlets.
-
set_io_options
(dump_period=0.1, dump_ids=[])¶ Sets the input/output settings.
Parameters: - dump_period – How often to dump vtu files.
- dump_ids – Physical surfaces to record fluxes.
-
set_material_properties
(density=1000.0, viscosity=0.001)¶ Sets the material phase properties.
Parameters: - density – density of the fluid.
- viscosity – viscosity of the fluid.
-
set_mesh_adaptivity
(min_size=0.01, max_size=0.5, max_no_nodes=300000, t_adapt_delay=0.5, aspect_ratio=5)¶ Sets mesh adaptivity options.
Parameters: - min_size – Minimum mesh size.
- max_size – Maximum mesh size.
- max_no_nodes – Maximum number of nodes. 100,000 is ~16GB of memory.
- t_adapt_delay – Start adaptive meshing at this time.
- aspect_ratio – Limit the mesh shape to maximum this aspect ratio.
-
set_msh_options
(msh_file)¶ Sets the location of the msh_file.
Default is src/pipe. :param msh_file: (string) location .msh file is stored.
-
set_no_slip
(phys_ids)¶ Sets the no-slip boundary condition.
Parameters: phys_ids – The physical surfaces to set to no-slip.
-
set_outlets
(phys_ids)¶ Sets the outlet surfaces.
Sets the physical surfaces phys_ids to 0 pressure.
Parameters: phys_ids – The physical surfaces to set to 0 pressure.
-
set_sim_name
(simname)¶ Sets the name of the simulation.
Default is “3d_pipe”.
-
set_timestepping
(finish_time, timestep=0.005, cfl_no=2.0)¶ Sets the timestepping options.
Parameters: - finish_time – Time the simulations stops.
- timestep – Initial timestep.
- cfl_no – CFL number adaptive timestepping aims for.
-
write_mpml
(fname)¶ Writes the settings to fname.mpml.
-