When setting values (for instance assigning a property, an initial condition, or applying a force to zones or faces) it is possible to do a simple assignment, to perform arithmetic adjustment (add, multiply) to the existing value, and to supply a linear distribution in space (gradient, vary). Commands that set values will not necessarily supply each type of modification. However, when these modifiers are available, they will operate in the manner described here.

The add keyword is simplest. It adds the supplied value to an existing value. If the gradient or vary keywords are used, they apply to the value added.

Multiply

The multiply keyword multiplies the existing value by the factor supplied with the keyword. If the gradient or vary keywords are used, they apply to the factor.

The gradient keyword provides a method for specifying a linear variation of the value. It takes the form:

Consider the following command.

zone apply force-y 1.0 gradient (2,4,3) origin (1,2,3) range pos-y 1 10


For each zone in the range range y=1 to y=10, apply a gradient to the y-force in the zones as follows. Take the base value (1.0) and add to it a value that is:

2 times the zone’s $$x$$-component minus 1 plus
4 times the zone’s $$y$$-component minus 2 plus
3 times the zone’s $$z$$-component minus 3.

The value varies according to the relation:

$\textrm{modified value} = \textrm{value} + v_x(p_x - o_x) + v_y(p_y - o_y) + v_z(p_z - o_z)$

When using gradient, $$value$$ is supplied before the gradient keyword (that is, it is the “pre-modified” value supplied for the command); $$p(p_x,p_y,p_z)$$ is the position of the object; $$o(o_x,o_y,o_z)$$ is the origin of the calculation, and $$v(v_x,v_y,v_z)$$ is the gradient factor.

The origin keyword is optional and defaults to (0,0,0).

If the vector gradient keyword is applied to a vector value (e.g., displacement 1 3 5 gradient 2 4 3), an error will occur.

Vary

The vary keyword provides a method for specifying a linear variation. This will vary a component value across the $$x$$-, $$y$$-, and $$z$$-extent of a selected range. Consider the following command.

zone apply force-y 1.0 vary (2,4,3) range pos-y 1 10


Given the zones whose centroids lie in the range between y=1 and y=10, vary the $$y$$-force applied to the zones as follows. Take the base value (1.0) and add to it a value that varies from 0~2 over the $$x$$-extent of the range, 0~4 over the $$y$$-extent, and 0~3 over the $$z$$-extent.

The value varies according to the relation

$\textrm{modified value} = \textrm{value} + \frac{p_x-l_x}{u_x-l_x} v_x + \frac{p_y-l_y}{u_y-l_y} v_y + \frac{p_z-l_z}{u_z-l_z} v_z$

where $$l(l_x,l_y,l_z)$$ is the vector lower bound of the extent, $$u(u_x,u_y,u_z)$$ is the vector upper bound of the extent, $$v(v_x,v_y,u_z)$$ is the vary vector, and $$p(p_x,p_y,p_z)$$ is the vector position of the object.

Vary Errors

If the vector vary keyword is applied to a vector value (e.g., displacement 1 3 5 vary 2 4 3), an error will occur.
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7749007940292358, "perplexity": 1646.6366626424626}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-43/segments/1634323585696.21/warc/CC-MAIN-20211023130922-20211023160922-00132.warc.gz"}