To use the viscosity macro in Visiual,follow these organized steps:
-
Activate the Macro:
Click the "Visc" button to activate the macro.
-
Create a New Macro:
Navigate to the menu bar and select "Visc macro."
-
Define Macro Parameters:
- Macro Name: Enter "粘度分析" (viscosity analysis) in the dialog box.
- Macro Type: Set to "Simulation" for simulation purposes.
- Input File: Choose a simulation file in the "Input File" section and click "OK."
- Output File: Save the results to a .visc file in the "macros" folder.
-
Set Time Interval:
In the "Time Interval" section, set the start time and end time, then compute the interval as (end - start)/1, averaging 1% of the simulation duration.
-
Select Fluid Type:
In the "Fluid Type" section, choose the fluid (e.g., "水" for water) and set its viscosity value (e.g., 1. for water) in the "Viscosity" tab.
-
Generate Macro Script:
Click "Create Macro" to generate the analysis script, which will be saved as .visc.
-
Run the Analysis:
Open the generated .visc file and click "Run Analysis" to execute the macro.
-
Considerations:
- Ensure the macro is saved in the "macros" folder for accessibility.
- Test the macro in different simulations (e.g., static analysis) to verify correctness.
- Create separate macros for different fluids if needed.
By following these steps, you can effectively analyze the viscosity of various fluids in your simulation.










