OpenPFC  0.1.4
Phase Field Crystal simulation framework
Loading...
Searching...
No Matches
moving_bc.hpp File Reference

Moving boundary condition that tracks solidification front. More...

#include <cmath>
#include <limits>
#include <mpi.h>
#include "../field_modifier.hpp"
#include "../utils.hpp"
#include "openpfc/field/operations.hpp"
Include dependency graph for moving_bc.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  pfc::MovingBC
 

Detailed Description

Moving boundary condition that tracks solidification front.

This file defines the MovingBC class, which enforces a boundary condition that moves based on the solidification front position. The boundary:

  • Automatically detects the solid-liquid interface
  • Moves the boundary region to follow the interface
  • Maintains fixed values ahead of and behind the front

Useful for:

  • Directional solidification simulations
  • Moving frame of reference
  • Efficient domain usage (only simulate near interface)

Usage:

auto bc = std::make_unique<pfc::MovingBC>();
bc->set_rho_low(0.0);
bc->set_rho_high(1.0);
bc->set_field_name("density");
simulator.add_boundary_condition(std::move(bc));
See also
field_modifier.hpp for base class
fixed_bc.hpp for stationary boundary condition
Author
OpenPFC Contributors
Date
2025