Skip to content

Conversation

@rzaman64
Copy link

@rzaman64 rzaman64 commented Oct 17, 2025

Adds new documentation file fix_lb_multicomponent.rst describing the ternary lattice Boltzmann model implemented in fix_lb_multicomponent.cpp.
This fix extends fix_lb_fluid to support three-component mixtures, following the work by Arumugam Kumar et al. (2024).

Related Issue(s)
N/A – new documentation entry for existing code developed under Schiller Lab.

Author(s)
Rasib Zaman ([email protected]
), Schiller Lab – University of Delaware

Licensing
I agree that my contribution will be included in LAMMPS and redistributed under GPL v2 / LGPL v2.1.

Backward Compatibility
No changes to code or input behavior — documentation only.

Implementation Notes
Documentation tested with the LAMMPS Sphinx build system and formatted consistently with existing fix_lb_fluid.rst.

Post Submission Checklist

Documentation is still in progress

Licensing information is complete

The doc file builds correctly with the LAMMPS documentation system


* **film** *thickness* *C1_film* *C2_film*: Creates a horizontal film of specified thickness (as a fraction of the box height) centered in the simulation box with composition C1_film, C2_film, C3_film = 1 - C1_film - C2_film, surrounded by bulk mixture. Small random fluctuations (±0.01) are added to seed phase separation.

* **mixed_droplet** *radius* *C1_drop* *C2_drop*: Creates a ternary droplet with specified radius and composition (C1_drop, C2_drop, C3_drop = 1 - C1_drop - C2_drop) surrounded by pure C3 solvent. Small random fluctuations (±0.01) are added within the droplet.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* **mixed_droplet** *radius* *C1_drop* *C2_drop*: Creates a ternary droplet with specified radius and composition (C1_drop, C2_drop, C3_drop = 1 - C1_drop - C2_drop) surrounded by pure C3 solvent. Small random fluctuations (±0.01) are added within the droplet.
* **mixed_droplet** *radius* *C1_drop* *C2_drop*: Creates a ternary droplet with specified radius and composition (C1_drop, C2_drop, C3_drop = 1 - C1_drop - C2_drop) surrounded by component 3 in bulk.


* **mixed_droplet** *radius* *C1_drop* *C2_drop*: Creates a ternary droplet with specified radius and composition (C1_drop, C2_drop, C3_drop = 1 - C1_drop - C2_drop) surrounded by pure C3 solvent. Small random fluctuations (±0.01) are added within the droplet.

.. math::
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.. math::

* **mixed_droplet** *radius* *C1_drop* *C2_drop*: Creates a ternary droplet with specified radius and composition (C1_drop, C2_drop, C3_drop = 1 - C1_drop - C2_drop) surrounded by pure C3 solvent. Small random fluctuations (±0.01) are added within the droplet.

.. math::

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change


.. math::

\text{subNbx} = \frac{N_x}{P_x} + 2h_x \\
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
\text{subNbx} = \frac{N_x}{P_x} + 2h_x \\

.. math::

\text{subNbx} = \frac{N_x}{P_x} + 2h_x \\
\text{subNby} = \frac{N_y}{P_y} + 2h_y \\
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
\text{subNby} = \frac{N_y}{P_y} + 2h_y \\


\text{subNbx} = \frac{N_x}{P_x} + 2h_x \\
\text{subNby} = \frac{N_y}{P_y} + 2h_y \\
\text{subNbz} = \frac{N_z}{P_z} + 2h_z
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
\text{subNbz} = \frac{N_z}{P_z} + 2h_z

\text{subNby} = \frac{N_y}{P_y} + 2h_y \\
\text{subNbz} = \frac{N_z}{P_z} + 2h_z

where hₓ = hᵧ = hᵤ = 2 is the halo extent required for gradient and Laplacian calculations.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
where hₓ = hᵧ = hᵤ = 2 is the halo extent required for gradient and Laplacian calculations.


This fix accepts several internal parameters that control the thermodynamic and transport properties:

* **tau_r**, **tau_p**, **tau_s**: Relaxation times for momentum transport and order parameter transport. These control the viscosity and diffusivity of the fluid components.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* **tau_r**, **tau_p**, **tau_s**: Relaxation times for momentum transport and order parameter transport. These control the viscosity and diffusivity of the fluid components.
* **tau_r**, **tau_p**, **tau_s**: Relaxation times for momentum transport and order parameter transport.


* **tau_r**, **tau_p**, **tau_s**: Relaxation times for momentum transport and order parameter transport. These control the viscosity and diffusivity of the fluid components.

* **gamma_p**, **gamma_s**: Mobility coefficients controlling the rate of change of the phase variables φ and ψ.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* **gamma_p**, **gamma_s**: Mobility coefficients controlling the rate of change of the phase variables φ and ψ.
* **gamma_p**, **gamma_s**: Parameters controlling the mobility of the phases $\phi$ and $\psi$.


.. math::

\gamma_{mn} = \frac{\sqrt{(\kappa_m + \kappa_n)(\lambda_m + \lambda_n)}}{6}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
\gamma_{mn} = \frac{\sqrt{(\kappa_m + \kappa_n)(\lambda_m + \lambda_n)}}{6}
\gamma_{mn} = \frac{\alpha}{6}\left(\kappa_m + \kappa_n\right)


\gamma_{mn} = \frac{\sqrt{(\kappa_m + \kappa_n)(\lambda_m + \lambda_n)}}{6}

* **alpha**: Gradient energy coefficient.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* **alpha**: Gradient energy coefficient.
* **alpha**: Parameter correlated with the interface width in LB units. The interface width is given by 4*alpha.

The *dumpxdmf* keyword enables output of the fluid fields to files that can be visualized using Paraview or other XDMF-compatible visualization software. The output includes:

* Density field ρ (converted to physical units)
* Order parameters φ and ψ (converted to physical units)
Copy link
Collaborator

@akgokulraman akgokulraman Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Order parameters φ and ψ (converted to physical units)
* Order parameters \phi and \psi


The *dumpxdmf* keyword enables output of the fluid fields to files that can be visualized using Paraview or other XDMF-compatible visualization software. The output includes:

* Density field ρ (converted to physical units)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Density field ρ (converted to physical units)
* Density field ρ


* Density field ρ (converted to physical units)
* Order parameters φ and ψ (converted to physical units)
* Pressure field p (converted to physical units)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Pressure field p (converted to physical units)
* Pressure field p

* Density field ρ (converted to physical units)
* Order parameters φ and ψ (converted to physical units)
* Pressure field p (converted to physical units)
* Velocity field **u** (converted to physical units)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Velocity field **u** (converted to physical units)
* Velocity vector field **u**


**Output**

The *dumpxdmf* keyword enables output of the fluid fields to files that can be visualized using Paraview or other XDMF-compatible visualization software. The output includes:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The *dumpxdmf* keyword enables output of the fluid fields to files that can be visualized using Paraview or other XDMF-compatible visualization software. The output includes:
The *dumpxdmf* keyword enables output of the fluid fields to files that can be visualized using Paraview or other XDMF-compatible visualization software. The output (in LB units) includes:

* A text .xdmf file containing metadata and grid structure
* A binary .raw file containing the actual field data

The concentration fields can be recovered from the output using:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The concentration fields can be recovered from the output using:


.. math::

C_1 = \frac{\rho + \phi}{2}, \quad C_2 = \frac{\rho - \phi}{2}, \quad C_3 = \psi
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
C_1 = \frac{\rho + \phi}{2}, \quad C_2 = \frac{\rho - \phi}{2}, \quad C_3 = \psi


The concentration fields can be recovered from the output using:

.. math::
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.. math::


**Boundary Conditions**

The ternary lattice-Boltzmann implementation currently supports periodic boundary conditions in all three directions. The boundary conditions are specified through the main LAMMPS :doc:`boundary <boundary>` command and must be set to periodic (p p p) for proper operation.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The ternary lattice-Boltzmann implementation currently supports periodic boundary conditions in all three directions. The boundary conditions are specified through the main LAMMPS :doc:`boundary <boundary>` command and must be set to periodic (p p p) for proper operation.
The ternary lattice-Boltzmann implementation currently only supports periodic boundary conditions in all three directions. The boundary conditions are specified through the main LAMMPS :doc:`boundary <boundary>` command and must be set to periodic (p p p) for proper operation.


The ternary lattice-Boltzmann implementation currently supports periodic boundary conditions in all three directions. The boundary conditions are specified through the main LAMMPS :doc:`boundary <boundary>` command and must be set to periodic (p p p) for proper operation.

*Periodic Boundaries*
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
*Periodic Boundaries*


*Periodic Boundaries*

With periodic boundary conditions, the fluid domain wraps around in all directions. The distribution functions that stream out of one side of the simulation box re-enter from the opposite side. This is handled automatically through the MPI communication scheme, which includes a halo region of 2 lattice layers on each side of the local processor subdomain.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
With periodic boundary conditions, the fluid domain wraps around in all directions. The distribution functions that stream out of one side of the simulation box re-enter from the opposite side. This is handled automatically through the MPI communication scheme, which includes a halo region of 2 lattice layers on each side of the local processor subdomain.


With periodic boundary conditions, the fluid domain wraps around in all directions. The distribution functions that stream out of one side of the simulation box re-enter from the opposite side. This is handled automatically through the MPI communication scheme, which includes a halo region of 2 lattice layers on each side of the local processor subdomain.

The halo communication ensures that:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The halo communication ensures that:

*Periodic Boundaries*

With periodic boundary conditions, the fluid domain wraps around in all directions. The distribution functions that stream out of one side of the simulation box re-enter from the opposite side. This is handled automatically through the MPI communication scheme, which includes a halo region of 2 lattice layers on each side of the local processor subdomain.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change


The halo communication ensures that:

* Gradient calculations (∇ρ, ∇φ, ∇ψ) required for the chemical potentials can be performed correctly near subdomain boundaries
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Gradient calculations (∇ρ, ∇φ, ∇ψ) required for the chemical potentials can be performed correctly near subdomain boundaries

The halo communication ensures that:

* Gradient calculations (∇ρ, ∇φ, ∇ψ) required for the chemical potentials can be performed correctly near subdomain boundaries
* Laplacian calculations (∇²ρ, ∇²φ, ∇²ψ) have access to necessary neighbor information
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Laplacian calculations (∇²ρ, ∇²φ, ∇²ψ) have access to necessary neighbor information


* Gradient calculations (∇ρ, ∇φ, ∇ψ) required for the chemical potentials can be performed correctly near subdomain boundaries
* Laplacian calculations (∇²ρ, ∇²φ, ∇²ψ) have access to necessary neighbor information
* Streaming of distribution functions across processor boundaries is handled correctly
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Streaming of distribution functions across processor boundaries is handled correctly

Copy link
Collaborator

@akgokulraman akgokulraman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make the following changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants