前言
之前使用RealFlow做流體模擬,但是總得和3ds導來導去,略顯麻煩,特意學習PhoenixFD插件,直接在3ds中進行流體模擬。若讀者有更好的流體模擬方法,歡迎在評論區交流。
原文地址:https://docs.chaosgroup.com/display/PHX3MAX/Liquid+Simulation
流體模擬
本文主要講解Simulation折疊欄中的內容
主要內容
- Overview 綜述
- Actions 基本操作
- Parameters 參數
- Cache File Content 緩存內容
綜述
The Simulation roll-out contains the main panel controlling the simulation process.Simulation折疊欄是控制流體模擬的主要面板。
It also displays some statistical info like simulation times and the content of the cache file for the current frame. 它同時顯示了一些像仿真時間、緩存文件的內容等當前幀的統計數據。
The content may be grid channels such as Temperature, Velocity, etc., as well as particle groups.緩存的內容包括 網格通道像溫度、速度等還有粒子組。
You can choose the channels from the Output rollout, while the particle groups may be created by the Fire Source | PHXSource, or Splash and Foam sections.你可以在Output折疊欄中選擇網格通道,粒子組可以在Fire Source、Splash和Foam處創建。
Most simulations require long time to calculate and it's very convenient to let them run during the night.大多數模擬都要耗費很長時間,在晚上模擬是很方便的。
However, you still have to render the result in the morning and this also consumes a lot of time.然而你同樣需要在早上進行渲染,也要很長時間。
The Phoenix FD scripting system allows you to execute any action at the end of the simulation, and that includes the rendering as well. 可以通過Phoenix FD的腳本來完成以上功能。
You just have to enable the scripting from the Simulation roll-out and open the script text.你只需要啟用腳本並打開腳本文件即可。
For more information, see the Nightly Simulation and Rendering section on the Tips and Tricks page.更多詳情可以參考Tips and Tricks頁面。
UI 位置: ||Select Liquid Simulator | LiquidSim object 選中流體模擬物體|| > Modify panel > Simulation rollout
基本操作
Start, Pause, Stop, Resume | A_StartSim, A_StopSim – Start, pause, and stop the simulation. Once the simulation has been paused, the option to Resume(繼續)becomes available.
Load & Start | A_StartSim – Loads the data from a single cache as an initial state for the simulation and starts simulating from the Start Frame the same way the Start action works. 加載緩存數據作為初始狀態並開始仿真。
The cache can be of the .aur, .vdb, or .f3d formats and so can be imported from a 3rd party software into Phoenix. 規定緩存的文件格式。
The loaded grid will be resized to fit the grid's dimensions at the Start Frame.加載的網格將自動調整大小。
The loaded cache does not need to be a Backup frame or to contain velocity at all 加載的緩存不需要是備份幀或者包含速度
-the simulator will load any available channels from the cache file and the rest of the simulated channels will be empty as when starting a brand new simulation. -模擬器將從緩存文件加載任何可用的通道,其余的模擬通道將在啟動全新的模擬時為空
If you wish to smoothly continue a simulated sequence from a given frame, please use the Restore command instead.如果希望從給定幀順利地繼續模擬序列,請使用還原命令。
Restore | A_StartSim – Continues a simulation from the currently viewed frame on the timeline.在當前時間線上繼續仿真。
This way a Phoenix simulation that has been stopped previously can be resumed from the point you left off, even after the software was closed and re-opened.通過這種方式,以前停止的Phoenix模擬可以從您停止的地方恢復,即使在軟件關閉和重新打開之后也是如此。
Restoring does not work for cache sequences imported from 3rd party software.對於從第三方軟件導入的緩存序列,還原不起作用。
It is only possible when the full internal state of a Phoenix simulation is exported (controlled by the Backup Interval parameter in the Output rollout).
Frames with the full state are called Backup frames. 具有完整狀態的幀稱為備份幀。
When a Backup frame is currently viewed, the text "Can Restore From Here" appears in the Cache File Content list.當前查看備份框架時,“緩存文件內容”列表中將顯示“可以從此處還原”文本。
The Restore command finds the latest Backup frame up to the current timeline frame and continues the simulation from there.
Preferences... – Opens up the Phoenix FD Global Preferences window. 打開鳳凰FD全局首選項窗口。
? – Opens up the Phoenix documentation and information on the current rollout. 打開幫助文檔
About – Opens a splash screen window for Phoenix with information on the version number and access to the log file.
Simulation Presets... | A_LoadRenderPreset – Displays a dropdown menu to either load or save .tpr or .slog files, which hold settings for this simulation. 將仿真的設置保存或打開之前預設的仿真參數。
參數
Start Frame | startframe – Explicitly sets the Start frame of the Simulation. This can also be a negative number. Only available when Timeline (Start Frame) is disabled.
Timeline | parmName - When enabled, the Simulation will run from the Timeline Start Frame.
Stop Frame | stopframe – Explicitly sets the End frame of the Simulation. This can also be a negative number. Only available when Timeline (Stop Frame) is disabled.
Timeline | parmName - When enabled, the Simulation will run to the end of the Timeline.
仿真的開始和結束幀,可以跟隨時間線上的開始幀和結束幀。
Use Script | script, use_script – Enables the use of MAXScript during the simulation.使用Max的腳本
Click Edit... to open a window with some skeleton code and a short description of the available commands. 點擊編輯會打開一個代碼框架
For more information, please see the Phoenix MaxScript page. 詳情可以參見Phoenix MaxScript頁面
Threads Limit | maxthreads – Specifies an upper limit for the number of threads used for the simulation.指定最大線程數
When the value is set to 0, the maximum number of threads (cores) will be used.設置為0,將使用最大線程數。
NUMA Nodes – If the simulation is executed over a NUMA machine, you can specify which nodes will be used.如果在NUMA機器上執行模擬,您可以指定將使用哪些節點。
Phoenix FD is very sensitive to memory transfer and if all the nodes are used, performance might decrease due to low bandwidth between the different nodes.Phoenix FD對內存復制很敏感,多節點間的帶寬可能限制仿真效率。
Note: NUMA stands for Non-Uniform Memory Access. It can be used to restrict the threads used for simulation based on the physical CPUs available on the system (in a multiprocessor systems). In this way better memory access can be achieved when multiple simulations are run on the same machine.
緩存內容
This area displays information on the current simulation.這塊區域顯示了當前仿真的信息。
Any data from available channels that have been loaded into the simulator are shown.加載到仿真器中各個通道的數據都被顯示。
This includes the minimum and maximum ranges for each channel.包括每個通道值的范圍。
Note that the Container Dimensions show the loaded cache size as seen in the scene, in the currently selected units.注意,容器維度顯示了當前選擇的單元中加載的緩存大小(如圖所示)。
This size is not multiplied by the Scene Scale parameter from the Grid rollout.此大小不乘以網格展開中的場景縮放參數。
If you want to see how big the container is as seen by the Phoenix simulator when the Scene Scale parameter is used, check the X, Y, Z info in the Grid rollout.如果您想查看在使用場景縮放參數時Phoenix模擬器顯示的容器大小,請檢查Grid rollout中的X、Y、Z信息。