流体动力学
本文主要讲解Dynamics折叠栏中的内容。原文地址:https://docs.chaosgroup.com/display/PHX3MAX/Liquid+Dynamics
主要内容
- Overview 综述
- Parameters 参数
- Surface Tension 表面张力
- Wetting 潮湿
综述
This rollout controls the fluid's motion parameters.此折叠栏控制流体的运动参数。
UI Path: ||Select Liquid Simulator | LiquidSim object|| > Modify panel > Dynamics rollout
参数
Simulate Air Effects | simair – When enabled, turns on the built-in air simulator.打开内建的空气模拟。
Strong sources or fast moving obstacles inside the simulator will create air velocities to carry splash, mist, and foam particles at high speed.模拟器中强源或快速移动的障碍将带入空气激起快速的飞溅,雾,泡沫颗粒等效果。
Used mostly when realistic mist is needed.主要用于对雾模拟的需要。
The simulation is not expensive, but can dramatically increase the splash and mist quality.模拟并不耗费太多资源,但可以显著提高飞溅和雾的质量。
The air effects stop affecting particles once they exit the simulator, thus altering the particle speed and direction around the simulator walls.一旦粒子离开模拟器,空气效应就会停止影响粒子,从而改变粒子在模拟器壁面周围的速度和方向。
Motion Inertia | ext_wind – When enabled, moving the simulator object over a series of frames causes inertial forces in the opposite direction of the movement. 当启用时,在一系列帧上移动模拟器对象会导致运动方向相反的惯性力。
This allows you to link the simulator to a moving object and keep the size of the grid relatively small, as opposed to creating a large grid that covers the entire path of the moving object.
这允许您将模拟器链接到一个移动对象,并保持网格的大小相对较小,而不是创建一个覆盖移动对象的整个路径的大网格。
Motion Inertia can be used for moving ground and water vehicles, torches, fireballs, rockets, etc. 运动惯量可用于移动地面和水上车辆、火把、火球、火箭等。
When this option is used together with the Initial Fill Up(初始填充) option and Open Container Wall(打开容器壁) conditions, a simulation of moving an object over a sea surface can be done.
当这个选项和初始填充与打开容器壁选项一起使用时,可以模拟物体在海面上的运动。
For more information, see the Motion Inertia example below.详情可以参见原文的实例。
Gravity | grav, gmul – When enabled, a standard gravity of 9.8 m/s 2 is automatically added. This value is a multiplier and scales the gravity accordingly. You can also use negative gravity.地球引力系数。
Initial Fill Up | initfill, flevel – When enabled, the container is filled up with liquid when the simulation starts. 将容器填满粒子。
The numeric field determines the fill-up level, measured in % of the Z size. 填充的高度由z轴的百分比确定。
When this option is used with Open Container Walls, the container can be moved and the grid will behave as part of an infinite ocean.当此选项和 打开容器壁 一起启用时,容器可以移动,网格将作为无限海洋的一部分。
For liquid simulations using Confine Geometry(限制几何体), you can enable Clear Inside on the geometry and liquid will not be created at simulation startup in the voxels inside the geometry.
使用限制几何体模拟流体时,可以在几何体上启用 清除内部,那么仿真开始时就不会在几何体内部创建流体。
! The liquid created through the Initial Fill Up option will be initialized with the values set for the Default RGB and Default Viscosity parameters below.通过初始填充选项创建的液体将使用下面为默认RGB和默认粘度参数设置的值初始化。
Fill Up For Ocean | oceanfill – Change the Open Container Walls of the simulator so that they would act like there is an infinite liquid volume beyond them.改变模拟器的开放容器壁,使其表现得像有一个无限的液体体积超过它们。
Pressure would be created at the simulator walls in order to support the liquid, and if the surface of a wall below the Initial Fill Up level or the bottom is cleared from liquid during simulation, new incoming liquid would be created.为了支持液体,会在模拟壁上产生压力,如果在模拟过程中,低于初始填充水平或底部的壁面被从液体中清除,就会产生新的进入液体。
In order to eliminate air pockets between Solid geometry and the liquid mesh, this option will automatically set all Solid voxels below the Initial Fill Up level to contain Liquid amount of 1, even if they don't contain any Liquid particles.为了消除实体几何和液体网格之间的空隙,这个选项会自动将所有低于初始填充水平的实体体素设置为包含液体量为1,即使它们不包含任何液体颗粒。
If you don't want this effect, enable Clear Inside from the Phoenix FD Properties of the Solid geometry.如果你不想要这样的效果,可以从Phoenix FD的实体几何启用清除内部选项。
! All simulator walls must be set to Open for Fill Up For Ocean to take effect.所有模拟壁必须设置为打开,以使 海洋填充 生效。
Steps per Frame | spf – Determines how many calculations of the simulated grid are performed between two consecutive frames of the timeline.确定在时间轴的两个连续帧之间执行多少模拟网格的计算。
! One of the most important parameters of the simulator, with significant impact on quality and performance.这是模拟器最重要的参数之一,对模拟器的质量和性能有着重要的影响。
To understand how to use it, keep in mind that the simulation is a sequential process and happens step by step. 要理解如何使用它,请记住模拟是一个循序渐进的过程,是一步一步进行的。
It produces good results if each simulation step introduces small changes, but it's also a trade-off between performance and detail, as described below.如果每个模拟步骤都引入了小的更改,那么它将产生良好的结果,但是这也是性能和细节之间的权衡,如下所述。
For example, if you have an object that is hitting the liquid surface with high speed, the result will be not good if at the first step the object is far away from the water, and at the second step, the object is already deep under the water. You have to introduce intermediate steps until the changes of each step get small enough. This parameter creates these steps within each frame.例如,如果你有一个物体高速撞击液体表面,如果第一步物体离水很远,第二步物体已经在水的深处,那么结果就不好。您必须引入中间步骤,直到每个步骤的更改足够小。此参数在每个帧中创建这些步骤。
A value of 1 means that there are no intermediate steps and each step is exported into the cache file.值1表示没有中间步骤,每个步骤都导出到缓存文件中。
A value of 2 means that there is one intermediate step, i.e. each second step is exported to the cache file while the intermediate steps are just calculated, but not exported.值2表示有一个中间步骤,即每第二步导出到缓存文件,而中间步骤只计算,不导出。
Signs that this parameter needs to be increased are:需要增加该参数的迹象有:
- Liquid simulations have too many single liquid particles.液体模拟中有太多的单一液体颗粒。
- Liquid simulations are torn and chaotic.液体模拟是撕裂和混乱的。
- Liquid simulations of streams have steps or other periodical artifacts.流的液体模拟有步骤或其他周期性的伪影。
- Fire/Smoke simulations have artifacts that produce a grainy appearance.火灾/烟雾模拟有产生颗粒状外观的伪影。
More often than not, those issues will be caused by the simulation moving too quickly (e.g. the emission from the source is very strong or the objects in the scene are moving very fast).
通常情况下,这些问题是由于模拟移动得太快造成的(例如,来自源的辐射非常强,或者场景中的物体移动非常快)。
In such cases you should use a higher SPF.这种情况下,你需要增大SPF。
Keep in mind that higher Steps Per Frame decreases the performance in a linear way, i.e. if you increase the SPF twice, your simulation will go twice as slow.记住,每帧更高的步长会以线性的方式降低性能,也就是说,如果你将SPF值提高两倍,你的模拟速度就会降低一倍。
However, the quality does not have a linear relation to the SPF.然而,仿真效果与SPF并不是线性相关的。
Each simulation step kills fine details, and thus for maximum detail it's best to use the lowest possible SPF that runs without any of the issues mentioned above.每个模拟步骤都会破坏细节,因此为了获得最大的细节,最好使用尽可能低的SPF值,这样就不会出现上面提到的任何问题。
For additional information, please refer to Phoenix FD Explained.
Time Scale | timescale – Specifies a time multiplier that can be used for slow motion effects. For more information, see the Time Scale example below.控制仿效果的速度,值越小,动画越慢。
!In order to achieve the same simulation look when changing the Time Scale, the Steps per frame value must be changed accordingly.为了在改变时间尺度时获得相同的仿真效果,必须相应地改变每帧值的步长。
For example, when decreasing the Time Scale from 1.0 to 0.5, Steps per frame must be decreased from 4 to 2.例如,Time Scale从1变为0.5时,SPF要从4变为2.
All animated objects in the scene (moving objects and sources) must be adjusted as well.场景中的所有动画对象(移动对象和源)也必须调整。
Active Bodies Mult | fluidToSolidInteractionMult - A multiplier for the effect of the Velocity channel on the Active Bodies in the Simulator.速度通道对模拟器中主动体影响的乘法器。
To convert a polygon object into an Active Body, enable the Active Body checkbox in the Phoenix FD Properties for that object.若要将多边形对象转换为活动体,请在该对象的Phoenix FD属性中启用活动体复选框。
Default RGB | lq_default_rgb - The Simulator is filled with this RGB color at simulation start.模拟器在模拟开始时使用这种RGB颜色。
The Default RGB is also used to color the fluid generated by Initial Fill Up, or by Initial Liquid Fill from the Phoenix FD Properties of a geometry - both of these options create liquid only at the start of the simulation. During simulation, more colors can be mixed into the sim by using a Phoenix FD Liquid Source with RGB enabled, or the color of existing fluid can be changed over time by using a Phoenix FD Mapper. If a Phoenix FD Liquid Source does not have RGB enabled, it also emits using the Default RGB value.
!The RGB Grid Channel has to be enabled in the Output Rollout for this parameter to take effect.
RGB Diffusion | rgbdiff – Control how quickly the colors of particles are mixed over time during the simulation.控制粒子的颜色在模拟过程中混合的速度。
When it's set to 0, each FLIP liquid particle carries its own color, and the color of each individual particle does not change when liquids are mixed. This means that if red and green liquids are mixed, a dotted red-green liquid will be produced instead of a yellow liquid. This parameter allows the colors of particles to change when the particles are in contact, thus achieving uniform color in the resulting mixed liquid. For more information, see the RGB Diffusion example below.
Default Viscosity | lqvisc – Determines the default viscosity of the liquid.流体粘度
This value is used when no viscosity information for the emitted liquid is provided to the Simulator by the Source.当源没有向模拟器提供所排放液体的粘度信息时,使用此值。
For more information, see the Viscosity example below.值越大,流体越粘。
- All FLIP liquid particles are set to this viscosity value at simulation start. You should use higher viscosity for thicker liquids such as chocolate, cream, etc
- The Default Viscosity is also used for the fluid generated by Initial Fill Up, or by Initial Liquid Fill from the Phoenix FD Properties of a geometry - both of these options create liquid only at the start of the simulation.
- If a Phoenix FD Liquid Source does not have Viscosity enabled, it emits using the Default Viscosity value.如果流体源没有启用粘度,则使用默认粘度。
- During simulation, liquids of variable viscosity can be mixed into the sim by using a Phoenix FD Liquid Source with Viscosity enabled.在模拟过程中,使用具有粘度功能的Phoenix FD液体源,可以将变粘度的液体混合到sim中。
- The Viscosity Grid Channel export has to be enabled in the Output Rollout for variable viscosity simulations to work.粘度网格通道导出必须在输出折叠栏中启用,以使可变粘度模拟能够工作。
- The viscosity of existing liquid can be changed over time by using a Phoenix FD Mapper in order to achieve melting or solidifying of fluids.现有的液体粘度可以随着时间的变化,使用Phoenix FD映射器,以实现熔融或固化的液体。
- You can shade the liquid mesh or particles using the fluid's viscosity with the help of the Phoenix Grid Texture or Particle Texture.
- It's important to note that using viscosity does not automatically make the liquid sticky.需要注意的是,使用粘度并不会自动使液体具有粘性。
For example, molten glass is viscous, but not sticky at all.例如,熔融玻璃是粘性的,但一点也不粘。
Stickiness can be enabled explicitly from the Wetting parameters section.粘性可以从润湿参数部分显式启用。
If Stickiness is not enabled, even the most viscous fluid would slide from the surfaces of geometries or from the jammed walls of the Simulator.如果不启用粘性,即使是最粘稠的流体也会从几何图形的表面或模拟器卡住的墙壁上滑出。
Viscosity Diffusion | viscdiff - Phoenix FD supports sourcing of fluids with different viscosity (thickness) values.Phoenix FD支持多种不用粘度的流体。
This parameter specifies how quickly they blend together.此参数指定它们混合的速度。
A low value will preserve the distinct viscosities, while a high value will allow them to mix together and produce a fluid with a uniform thickness.低粘度值将保持不同的粘度,而高粘度值将使它们混合在一起,产生厚度相同的流体。
Non-Newtonian | nonnewt – Modifies the viscosity with respect to the liquid's velocity to overcome the conflict between viscosity and wetting, where a high viscosity of real liquids prevents wetting.改变粘度相对于液体的速度,以克服粘度和润湿之间的冲突,在高粘度的实际液体防止润湿。
Non-Newtonian liquids are liquids that behave differently at different velocities. This parameter accounts for this behavior by decreasing the viscosity in areas where the liquid is moving slowly and retains a higher viscosity where the liquid is moving quickly. For example, to cover a cookie with liquid chocolate, high viscosity is needed in the pouring portion of the motion to obtain the curly shape of the chocolate as it lands on the cookie and begins to settle down. On the other hand, a smooth chocolate is needed to settle in over the cookie without roughness and holes. If the viscosity is high enough, the chocolate might look right during the pouring and settling motions but won't settle in to form a smooth thin layer over the cookie. This parameter decreases the viscosity where the liquid is moving slowly (over the surface of the cookie) while keeping the faster-moving stream tight and highly viscous. For more information, see the Non-Newtonian example below.
Droplets Surfing | dsurf – This parameter affects the liquid and the splash particles, controlling how long a particle hovers on the surface before it merges with the liquid.这个参数影响液体和飞溅粒子,控制粒子在与液体融合之前在表面停留的时间。
The parameter is used mostly in ocean/wave simulations.该参数主要用于海洋/波浪模拟。
表面张力
Strength | lqsurft – Controls the force produced by the curvature of the liquid surface. 控制液体表面曲率产生力的大小。
This parameter plays an important role in small-scale liquid simulations because an accurate simulation of surface tension indicates the small scale to the audience.该参数在小型液体模拟中起着重要的作用,因为对表面张力的精确模拟可以向观众显示小尺度。
Lower Strength values will cause the liquid to easily break apart into individual liquid particles, while higher values will make it harder for the liquid surface to split and will hold the liquid particles together.
较低的强度值会使液体容易分裂成单个的液体颗粒,而较高的强度值会使液体表面更难分裂,并将液体颗粒结合在一起。
With high Strength, when an external force affects the liquid, it would either stretch out into tendrils, or split into large droplets.在较大的表面张力下,当外力影响液体时,它要么伸展成卷须,要么分裂成大液滴。
Which of these two effects will occur is controlled by the Droplet Breakup parameter. 这两种效应中,产生哪种现象是由液滴破碎参数控制的。
For more information, see the Surface Tension example below.
Droplet Breakup | lqstdropbreak – Balances between the liquid forming tendrils or droplets.形成卷须或液滴的液体之间的平衡。
When set to a value of 0, the liquid forms long tendrils.当设置为0时,液体形成长卷须。
When set to a value of 1, the liquid breaks up into separate droplets, the size of which can be controlled by the Droplet Radius parameter.当设置为1时,液体会分裂成单独的液滴,液滴的大小可以由液滴半径参数控制。
For more information, see the Droplet Breakup example below.
Droplet Radius | lqstdroprad – Controls the radius of the droplets formed by the Droplet Breakup parameter, in voxels.控制由液滴破碎参数形成的液滴半径,单位为体素。
This means that increasing the resolution of the Simulator will reduce the overall size of the droplets in your simulation.
!Increasing the Droplet Radius can dramatically slow the simulation down. Please use it with caution.增加液滴半径可以显著降低模拟速度。请小心使用。
使润湿
!Simulation of wetting can be used in rendering for blending of wet and dry materials depending on which parts of a geometry have been in contact with the simulated liquid.润湿模拟可用于渲染混合湿和干材料,这
Wetting can also change the behavior of simulated viscous liquid and make it stick to geometries.润湿还可以改变模拟粘性液体的行为,使其粘着几何形状。
The wetting simulation produces a particle system called WetMap.润湿模拟产生了一个名为WetMap的粒子系统。
It can be rendered using a Particle Texture | PhoenixFDParticleTex map which blends between a wet and a dry surface material.
The drying info is kept in the particle size channel.
To convert the map to grayscale, enable the Mult. by size option for the Particle Texture | PhoenixFDParticleTex map.
Wetting | wetting – Enables the wetting simulation. The liquid will leave a trail over the surfaces of bodies it interacts with.
Consumed Liquid | lq2wet – Controls how many liquid particles disappear when creating a single wetmap particle. The main purpose of this parameter is to prevent long visible tracks from being left by a single liquid particle. For more information, see the Consumed Liquid example below.
Drying Time (sec) | drying – Controls the drying speed in seconds. The WetMap particles are born with a size of 1, and if they are in an air environment, the size decreases until it reaches zero after the time specified with this parameter.
Sticky Liquid | wetdyn – This option produces a connecting force between the WetMap particles at the geometry surface and nearby liquid particles, when the liquid particles have at least a little Viscosity. For more information, see the Sticky Liquid example below.
!Geometry transforming or deforming at a high velocity may cause some or all of the Wetting particles stuck to it to disappear. To resolve this, dial up the Steps Per Frame parameter from the Dynamicstab of the Simulator.