This project is An-Jun Liu's work in the Polymer Physics and Complex Fluids Group led by Professor Yeng-Long Chen at Institute of Physics, Academia Sinica. The two main contributions of this project are:
- Efficiently calculate the time series of the number of doublets in a fluid system. This repo also provides doublet labeling code such that the users can see the result of doublet counting by their eyes. Before I wrote this utility function, our group members could only know the doublet fraction by visualizing the fluid system and watch the animationm, which is very time-consuming.
- Perform data analysis based on the utility function mentioned above. The analyses include the relationship between intrinsic/relative viscosity and volume fraction/capilary number, the relationship between doublet fraction and intrinsic viscosity, and the relationship between elastic stress tensor and interparticle distance (i.e. a charatersitic of doublet formation).
To use the utility function in this project, you have to do the following:
- Install python3
- Install numpy
- Install scipy
- Run this command "gcc -fPIC -shared -o RBC_Utilities_CExtension.so RBC_Utilities_CExtension.c" to compile and create .so file in the folder where you clone this repo
This utility python file provides functions to calculate doublet fraction (accelerated by preprocessing and writing a C extension file), interparticle/elastic stress, intrinsic viscosity, and relative viscosity for two-cell and suspension system.
To use calcDoubletFraction(), you have to preprocess the data by using Preprocess.py.
This file is to preprocess the data for calculating the doublet function. The preprocessed data includes
- time series of bounded center of mass of each particle, i.e. _COMs.npy
- time series of unbounded center of mass of each particle, i.e. _COMs_NB.npy
- time series of y coordinate of specific nodes, i.e. _Ypos_t.npy
- parameters including timesteps (COMs time unit), interval (Ypos time unit), particle numbers, points per particle (used in Ypos_t), and dimensions, i.e. _parameter.txt
Calculate the deviation (in time, after 500 strains) of each ensembled average doublet fraction time series
Plot doublet fraction's histogram and fit it with skew normal distribution in suspension system
Plot ensemble averaged doublet fraction time series for suspension system
Plot elastic stress tensor, interpartilce distance, and doublet fraction/state time series
Plot elastic stress tensor vs interparticle distance (avg or max).
Also provides linear regression line
Make two plots: doublet fraction vs Ca plot and its phasediagram (in colormap)
Plot phase diagram for two-cell system.
Plot slope (defined by doublet fraction vs intrinsic viscosity) vs Ca for suspension system.
Plot slope (defined by doublet fraction vs intrinsic viscosity) vs Ca for two-cell system.
Plot intrinsic and relative viscosity vs Ca for both doublet and two-singlet state in two-cell system with all volume fraction.
Note that the states are seperated!
Plot intrinsic and relative viscosity vs Ca for two-cell system with all volume fraction.
Note that states are not seperated!
This code is to compare the instability of the two-cell system before and after increasing the simulation time to 4000 strains and the suspension system.
A plot containing a histogram and a cmf is provided.
This code is to calculate the instability of each ensemble-averaged doublet fraction time series and make a histogram out of it for two-cell system.
The instability is defined as (avg(fourth quarther) - avg(third quarter))/avg(third quarter).
This code is to calculate the instability of each ensemble-averaged doublet fraction time series and make a histogram out of it for suspension system.
The instability is defined as (avg(fourth quarther) - avg(third quarter))/avg(third quarter).
This code is to make the plots of intrinsic and relative viscosity vs Ca and phi for suspension system.
The data is pre-calculated.