Difference between revisions of "FluidSource Custom Task"
(18 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
== Introduction == | == Introduction == | ||
The <tt>FluidSource</tt> custom task injects particles at a | The <tt>FluidSource</tt> custom task injects particles at a specified rate from a defined inlet. Its main use of for injecting [[#Hyperelastic Materials|liquid or liquid-like particles]] such as a [[Tait Liquid Material|Tait liquid]]. While it can be used with other materials, the injection process does not work well unless the injected material clears out of the inlet region in time for the next injected particles. | ||
== Task Scheduling == | == Task Scheduling == | ||
Line 13: | Line 13: | ||
Parameter matname,(matname) | Parameter matname,(matname) | ||
In <tt>XML</tt> files, this task is | In <tt>XML</tt> files, this task is started using a <tt><Schedule></tt> element, which must be within the single <tt><CustomTasks></tt> block: | ||
<Schedule name='FluidSource'> | <Schedule name='FluidSource'> | ||
Line 20: | Line 20: | ||
</Schedule> | </Schedule> | ||
The | The the two parameters for defining the material are: | ||
* <tt>(matID)</tt> or <tt>(matname)</tt> - specifies material type [[Material Command Block#Referencing Materials in XML Files|by number or name]]. If both are provided, the <tt>(matname)</tt> takes precedence. | * <tt>(matID)</tt> or <tt>(matname)</tt> - specifies material type [[Material Command Block#Referencing Materials in XML Files|by number or name]]. If both are provided, the <tt>(matname)</tt> takes precedence. | ||
Line 44: | Line 44: | ||
where | where | ||
* <tt>(rate)</tt> or <tt>(rateFxn)</tt> - specifies the inject | * <tt>(rate)</tt> or <tt>(rateFxn)</tt> - specifies the inject rate in [[ConsistentUnits Command#Legacy and Consistent Units|(length units)<sup>3</sup>]] per [[ConsistentUnits Command#Legacy and Consistent Units|time unit]]. The <tt>(rate)</tt> option specifies a fixed and constant rate while <tt>(rateFxn)</tt> can provide a variable rate as a [[User Defined Functions|user-defined function]] of time. If both are provided, the <tt>(rateFxn)</tt> takes precedence. | ||
* <tt>(xNorm),(yNorm),(zNorm)</tt> - provide three components to a normal vector in the direction of flow (the vector need not be normalized). In 2D, <tt>(xNorm)</tt> and <tt>(yNorm)</tt> can be in any direction. In 3D, the injection is currently limited being along the x, y, or z axis, which means only one component can be nonzero (all components default to zero, so just specify one non-zero value; if none are specified, 3D injection | * <tt>(xNorm),(yNorm),(zNorm)</tt> - provide three components to a normal vector in the direction of flow (the vector need not be normalized). In 2D, <tt>(xNorm)</tt> and <tt>(yNorm)</tt> can be in any direction. In 3D, the injection is currently limited being along the x, y, or z axis, which means only one component can be nonzero (all components default to zero, so just specify the one non-zero value; if none are specified, 3D injection will be in the z direction). | ||
=== Defining the Injection Pipe === | === Defining the Injection Pipe === | ||
Line 67: | Line 67: | ||
where | where | ||
* <tt>(xSrc),(ySrc),(zSrc)</tt> - specify a point at the center of the pipe ( | * <tt>(xSrc),(ySrc),(zSrc)</tt> - specify a point at the center of the pipe (only x and y coordinates needed in 2D). | ||
* <tt>(width)</tt> and <tt>(depth)</tt> - | * <tt>(width)</tt> and <tt>(depth)</tt> - specifies the cross-sectional area of the rectangular pipe. In 2D, only <tt>(wdith)</tt> is needed and the depth of the pipe is the thickness of the 2D simulation. In 3D, the rectangle axes are aligned with the non-normal axes (''e.g.'', for flow in x direction, width and depth are in the y and z directions, ''etc.''). | ||
=== Injected Particle Size === | === Injected Particle Size === | ||
By default, the injected particle size will be the same as the default particle size for the current simulation. If desired, that size can be | By default, the injected particle size will be the same as the default particle size for the current simulation (as set using the [[MPM Methods and Simulation Timing#Input Commands|<tt>PtsPerElement</tt> command]]). If desired, that size can be changed with the following addition to scripted files | ||
Parameter particle_scale,(scaleSize) | Parameter particle_scale,(scaleSize) | ||
Line 82: | Line 82: | ||
where | where | ||
* <tt>(scaleSize)</tt> - specifies relative particle size compared to the | * <tt>(scaleSize)</tt> - specifies relative particle size compared to the simulation's default particle per cell (default is 1). | ||
== Task Action == | == Task Action == | ||
Each time step checks the injection location and current flow rate. If enough time has passed since the last row of | Each time step checks the injection location and current flow rate. If enough time has passed since the last row of particles was injected, a new row of particles is injected into the simulation. | ||
In addition, this simulation will check for any particles in a region ahead of the pipe with the same cross-sectional area as the pipe and a length normal to the pipe of one grid cell. Any particle in that region will have their velocities set equal to the current flow rate. This action is effectively providing a velocity boundary condition to a small region ahead of the pipe. Once out of that region, the particles are within the simulation. If particles get blocked once leaving that region, the injection process might not work well. | |||
== Notes == | == Notes == | ||
* | * This task places no restrictions on the material type that gets injected, but it was designed for use with [[#Hyperelastic Materials|liquid or liquid-like materials]]. It might also work for soft-elastic materials or even any material provided their motion once out on inlet region is not overly impeded by other particles. | ||
* The injection of particles requires that the simulation is seeded with sufficient particles of the right material type and size in the [[Material Point Reservoir]]. If the reservoir is empty (or becomes empty), the simulation will continue, but no particles will be injected. | |||
* If |
Latest revision as of 08:07, 14 January 2023
This custom task injects particles into a simulation.
Introduction
The FluidSource custom task injects particles at a specified rate from a defined inlet. Its main use of for injecting liquid or liquid-like particles such as a Tait liquid. While it can be used with other materials, the injection process does not work well unless the injected material clears out of the inlet region in time for the next injected particles.
Task Scheduling
In scripted files, a FluidSource starts by defining the material to inject:
CustomTask FluidSource Parameter material,(matID) Parameter matname,(matname)
In XML files, this task is started using a <Schedule> element, which must be within the single <CustomTasks> block:
<Schedule name='FluidSource'> <Parameter name='material'>(matID)</Parameter> <Parameter name='matname'>(matname)</Parameter> </Schedule>
The the two parameters for defining the material are:
- (matID) or (matname) - specifies material type by number or name. If both are provided, the (matname) takes precedence.
Setting Injection Rate
The rate of injection is determined by adding the following commands to scripted files:
Parameter FlowRate,(rate) Parameter FlowFunction,(rateFxn) Parameter flow_x,(xNorm) Parameter flow_y,(yNorm) Parameter flow_z,(zNorm)
or adding these command to the task definition in XML files:
<Parameter name='FlowRate'>(rate)</Parameter> <Parameter name='FlowFunction'>(rateFxn)</Parameter> <Parameter name='flow_x'>(xNorm)</Parameter> <Parameter name='flow_y'>(yNorm)</Parameter> <Parameter name='flow_z'>(zNorm)</Parameter>
where
- (rate) or (rateFxn) - specifies the inject rate in (length units)3 per time unit. The (rate) option specifies a fixed and constant rate while (rateFxn) can provide a variable rate as a user-defined function of time. If both are provided, the (rateFxn) takes precedence.
- (xNorm),(yNorm),(zNorm) - provide three components to a normal vector in the direction of flow (the vector need not be normalized). In 2D, (xNorm) and (yNorm) can be in any direction. In 3D, the injection is currently limited being along the x, y, or z axis, which means only one component can be nonzero (all components default to zero, so just specify the one non-zero value; if none are specified, 3D injection will be in the z direction).
Defining the Injection Pipe
The injection pipe is a width in 2D or an area in 3D and specified in scripted files with the following commands:
Parameter source_x,(xSrc) Parameter source_y,(ySrc) Parameter source_z,(zSrc) Parameter inlet_width,(width) Parameter inlet_depth,(depth)
or adding these command to the task definition in XML files:
<Parameter name='source_x'>(xSrc)</Parameter> <Parameter name='source_y'>(ySrc)</Parameter> <Parameter name='source_z'>(zSrc)</Parameter> <Parameter name='inlet_width'>(width)</Parameter> <Parameter name='inlet_depth'>(depth)</Parameter>
where
- (xSrc),(ySrc),(zSrc) - specify a point at the center of the pipe (only x and y coordinates needed in 2D).
- (width) and (depth) - specifies the cross-sectional area of the rectangular pipe. In 2D, only (wdith) is needed and the depth of the pipe is the thickness of the 2D simulation. In 3D, the rectangle axes are aligned with the non-normal axes (e.g., for flow in x direction, width and depth are in the y and z directions, etc.).
Injected Particle Size
By default, the injected particle size will be the same as the default particle size for the current simulation (as set using the PtsPerElement command). If desired, that size can be changed with the following addition to scripted files
Parameter particle_scale,(scaleSize)
or adding this command to the task definition in XML files:
<Parameter name='particle_scale'>(scaleSize)</Parameter>
where
- (scaleSize) - specifies relative particle size compared to the simulation's default particle per cell (default is 1).
Task Action
Each time step checks the injection location and current flow rate. If enough time has passed since the last row of particles was injected, a new row of particles is injected into the simulation.
In addition, this simulation will check for any particles in a region ahead of the pipe with the same cross-sectional area as the pipe and a length normal to the pipe of one grid cell. Any particle in that region will have their velocities set equal to the current flow rate. This action is effectively providing a velocity boundary condition to a small region ahead of the pipe. Once out of that region, the particles are within the simulation. If particles get blocked once leaving that region, the injection process might not work well.
Notes
- This task places no restrictions on the material type that gets injected, but it was designed for use with liquid or liquid-like materials. It might also work for soft-elastic materials or even any material provided their motion once out on inlet region is not overly impeded by other particles.
- The injection of particles requires that the simulation is seeded with sufficient particles of the right material type and size in the Material Point Reservoir. If the reservoir is empty (or becomes empty), the simulation will continue, but no particles will be injected.