![]() |
v0.15.0 |
Go to the source code of this file.
Classes | |
| struct | TSPrePostProc |
| Set of functions called by PETSc solver used to refine and update mesh. More... | |
| struct | FreeSurface |
| struct | Monitor |
| [Push operators to pipeline] More... | |
Enumerations | |
| enum | FR { F , R } |
Functions | |
| int | main (int argc, char *argv[]) |
| Main function for free surface simulation. | |
Variables | |
| static char | help [] = "...\n\n" |
| int | coord_type = EXECUTABLE_COORD_TYPE |
| constexpr int | BASE_DIM = 1 |
| constexpr int | SPACE_DIM = 2 |
| constexpr int | U_FIELD_DIM = SPACE_DIM |
| constexpr AssemblyType | A = AssemblyType::PETSC |
| constexpr IntegrationType | I |
| FTensor::Index< 'i', SPACE_DIM > | i |
| FTensor::Index< 'j', SPACE_DIM > | j |
| FTensor::Index< 'k', SPACE_DIM > | k |
| FTensor::Index< 'l', SPACE_DIM > | l |
| constexpr auto | t_kd = FTensor::Kronecker_Delta_symmetric<int>() |
| int | order = 3 |
| approximation order | |
| int | nb_levels = 4 |
| int | refine_overlap = 4 |
| constexpr bool | debug = true |
| auto | get_start_bit |
| auto | get_current_bit |
| dofs bit used to do calculations | |
| auto | get_skin_parent_bit = []() { return 2 * get_start_bit() + 2; } |
| auto | get_skin_child_bit = []() { return 2 * get_start_bit() + 3; } |
| auto | get_projection_bit = []() { return 2 * get_start_bit() + 4; } |
| auto | get_skin_projection_bit = []() { return 2 * get_start_bit() + 5; } |
| double | a0 = 980 |
| double | rho_m = 0.998 |
| double | mu_m = 0.010101 * 1e2 |
| double | rho_p = 0.0012 |
| double | mu_p = 0.000182 * 1e2 |
| double | lambda = 73 |
| surface tension | |
| double | W = 0.25 |
| double | h = 0.03 |
| double | eta = h |
| double | eta2 = eta * eta |
| double | md = 1e-2 |
| double | eps = 1e-12 |
| double | tol = std::numeric_limits<float>::epsilon() |
| double | rho_ave = (rho_p + rho_m) / 2 |
| double | rho_diff = (rho_p - rho_m) / 2 |
| double | mu_ave = (mu_p + mu_m) / 2 |
| double | mu_diff = (mu_p - mu_m) / 2 |
| double | kappa = (3. / (4. * std::sqrt(2. * W))) * (lambda / eta) |
| auto | integration_rule = [](int, int, int) { return 2 * order + 1; } |
| auto | cylindrical |
| Coordinate system scaling factor. | |
| auto | wetting_angle_sub_stepping |
| Wetting angle sub-stepping for gradual application. | |
| auto | my_max = [](const double x) { return (x - 1 + std::abs(x + 1)) / 2; } |
| Maximum function with smooth transition. | |
| auto | my_min = [](const double x) { return (x + 1 - std::abs(x - 1)) / 2; } |
| Minimum function with smooth transition | |
| auto | cut_off = [](const double h) { return my_max(my_min(h)); } |
| Phase field cutoff function. | |
| auto | d_cut_off |
| Derivative of cutoff function. | |
| auto | phase_function |
| Phase-dependent material property interpolation. | |
| auto | d_phase_function_h |
| Derivative of phase function with respect to h. | |
| auto | get_f = [](const double h) { return 4 * W * h * (h * h - 1); } |
| Double-well potential function. | |
| auto | get_f_dh = [](const double h) { return 4 * W * (3 * h * h - 1); } |
| Derivative of double-well potential. | |
| auto | get_M0 = [](auto h) { return md; } |
| Constant mobility function M₀ | |
| auto | get_M0_dh = [](auto h) { return 0; } |
| Derivative of constant mobility. | |
| auto | get_M2 |
| Degenerate mobility function M₂ | |
| auto | get_M2_dh = [](auto h) { return -md * 2 * h; } |
| Derivative of degenerate mobility M₂ | |
| auto | get_M3 |
| Non-linear mobility function M₃ | |
| auto | get_M3_dh |
| Derivative of non-linear mobility M₃ | |
| auto | get_M = [](auto h) { return get_M0(h); } |
| auto | get_M_dh = [](auto h) { return get_M0_dh(h); } |
| auto | get_D |
| Create deviatoric stress tensor. | |
| auto | kernel_oscillation |
| Oscillating interface initialization. | |
| auto | kernel_eye |
| Eye-shaped interface initialization | |
| auto | capillary_tube |
| Capillary tube initialization. | |
| auto | bubble_device |
| Bubble device initialization. | |
| auto | init_h |
| Initialisation function. | |
| auto | wetting_angle = [](double water_level) { return water_level; } |
| Wetting angle function (placeholder) | |
| auto | bit = [](auto b) { return BitRefLevel().set(b); } |
| Create bit reference level. | |
| auto | marker = [](auto b) { return BitRefLevel().set(BITREFLEVEL_SIZE - b); } |
| Create marker bit reference level | |
| auto | get_fe_bit |
| Get bit reference level from finite element. | |
| auto | get_global_size |
| Get global size across all processors. | |
| auto | save_range |
| Save range of entities to file. | |
| auto | get_dofs_ents_by_field_name |
| Get entities of DOFs by field name - used for debugging. | |
| auto | get_dofs_ents_all |
| Get all entities with DOFs in the problem - used for debugging. | |
| static boost::weak_ptr< TSPrePostProc > | tsPrePostProc |
| using AssemblyBoundaryEleOp = FormsIntegrators<BoundaryEleOp>::Assembly<A>::OpBase |
Definition at line 130 of file free_surface.cpp.
| using AssemblyDomainEleOp = FormsIntegrators<DomainEleOp>::Assembly<A>::OpBase |
Definition at line 129 of file free_surface.cpp.
Definition at line 117 of file free_surface.cpp.
Definition at line 119 of file free_surface.cpp.
| using BoundaryNaturalBC = NaturalBC<BoundaryEleOp>::Assembly<A>::LinearForm<I> |
Definition at line 154 of file free_surface.cpp.
Definition at line 118 of file free_surface.cpp.
| using DomainEle = ElementsAndOps<SPACE_DIM>::DomainEle |
Definition at line 114 of file free_surface.cpp.
Definition at line 116 of file free_surface.cpp.
Definition at line 115 of file free_surface.cpp.
| using ElementsAndOps = PipelineManager::ElementsAndOpsByDim<SPACE_DIM> |
Definition at line 112 of file free_surface.cpp.
| using EntData = EntitiesFieldData::EntData |
Definition at line 127 of file free_surface.cpp.
| using OpBoundaryAssembleScalar = FormsIntegrators<BoundaryEleOp>::Assembly< A>::LinearForm<I>::OpBaseTimesScalar<BASE_DIM> |
Definition at line 146 of file free_surface.cpp.
| using OpBoundaryMassL = FormsIntegrators<BoundaryEleOp>::Assembly< A>::BiLinearForm<I>::OpMass<BASE_DIM, 1> |
Definition at line 139 of file free_surface.cpp.
| using OpDomainAssembleScalar = FormsIntegrators<DomainEleOp>::Assembly< A>::LinearForm<I>::OpBaseTimesScalar<BASE_DIM> |
Definition at line 144 of file free_surface.cpp.
| using OpDomainAssembleVector = FormsIntegrators<DomainEleOp>::Assembly< A>::LinearForm<I>::OpBaseTimesVector<BASE_DIM, SPACE_DIM, 1> |
Definition at line 142 of file free_surface.cpp.
| using OpDomainMassG = OpDomainMassH |
Definition at line 138 of file free_surface.cpp.
| using OpDomainMassH = FormsIntegrators<DomainEleOp>::Assembly<A>::BiLinearForm< I>::OpMass<BASE_DIM, 1> |
Definition at line 135 of file free_surface.cpp.
| using OpDomainMassP = OpDomainMassH |
Definition at line 137 of file free_surface.cpp.
| using OpDomainMassU = FormsIntegrators<DomainEleOp>::Assembly<A>::BiLinearForm< I>::OpMass<BASE_DIM, U_FIELD_DIM> |
Definition at line 133 of file free_surface.cpp.
| using OpFluidFlux = BoundaryNaturalBC::OpFlux<NaturalMeshsetType<BLOCKSET>, 1, 1> |
Definition at line 155 of file free_surface.cpp.
| using OpMixScalarTimesDiv = FormsIntegrators<DomainEleOp>::Assembly< A>::BiLinearForm<I>::OpMixScalarTimesDiv<SPACE_DIM, COORD_TYPE> |
Definition at line 150 of file free_surface.cpp.
Definition at line 125 of file free_surface.cpp.
Definition at line 123 of file free_surface.cpp.
Definition at line 124 of file free_surface.cpp.
| using SideEle = ElementsAndOps<SPACE_DIM>::FaceSideEle |
Definition at line 120 of file free_surface.cpp.
| using SideOp = SideEle::UserDataOperator |
Definition at line 121 of file free_surface.cpp.
| enum FR |
| int main | ( | int | argc, |
| char * | argv[] | ||
| ) |
Main function for free surface simulation.
| argc | Number of command line arguments |
| argv | Array of command line argument strings |
Main driver function that:
Command line options are read from param_file.petsc and command line. Python initialization is optional (controlled by PYTHON_INIT_SURFACE).
[Register MoFEM discrete manager in PETSc]
[Register MoFEM discrete manager in PETSc
[Create MoAB]
< mesh database
< mesh database interface
[Create MoAB]
[Create MoFEM]
< finite element database
< finite element database interface
[Create MoFEM]
Definition at line 2855 of file free_surface.cpp.
|
constexpr |
Definition at line 107 of file free_surface.cpp.
| double a0 = 980 |
Definition at line 186 of file free_surface.cpp.
|
constexpr |
Definition at line 103 of file free_surface.cpp.
| auto bit = [](auto b) { return BitRefLevel().set(b); } |
Create bit reference level.
| b | Bit number to set |
Definition at line 506 of file free_surface.cpp.
| auto bubble_device |
Bubble device initialization.
| x | X-coordinate |
| y | Y-coordinate (unused) |
| z | Z-coordinate (unused) |
Creates vertical interface for bubble formation device
Definition at line 465 of file free_surface.cpp.
| auto capillary_tube |
Capillary tube initialization.
| x | X-coordinate (unused) |
| y | Y-coordinate |
| z | Z-coordinate (unused) |
Creates horizontal interface at specified water height
Definition at line 450 of file free_surface.cpp.
| int coord_type = EXECUTABLE_COORD_TYPE |
Definition at line 101 of file free_surface.cpp.
Phase field cutoff function.
| h | Phase field value |
Constrains phase field values to physical range [-1,1] with smooth cutoff
Definition at line 264 of file free_surface.cpp.
| auto cylindrical |
Coordinate system scaling factor.
| r | Radial coordinate |
Returns 2πr for cylindrical coordinates, 1 for Cartesian. Used to scale integration measures and force contributions.
Definition at line 221 of file free_surface.cpp.
| auto d_cut_off |
Derivative of cutoff function.
| h | Phase field value |
Definition at line 271 of file free_surface.cpp.
| auto d_phase_function_h |
Derivative of phase function with respect to h.
| h | Phase field value (unused in linear case) |
| diff | Difference between phase values |
Definition at line 298 of file free_surface.cpp.
|
constexpr |
Definition at line 170 of file free_surface.cpp.
| double eps = 1e-12 |
Definition at line 201 of file free_surface.cpp.
Definition at line 196 of file free_surface.cpp.
Definition at line 197 of file free_surface.cpp.
| auto get_current_bit |
dofs bit used to do calculations
Definition at line 175 of file free_surface.cpp.
| auto get_D |
Create deviatoric stress tensor.
| A | Coefficient for tensor scaling |
Constructs deviatoric part of fourth-order identity tensor: D_ijkl = A * (δ_ik δ_jl + δ_il δ_jk)/2 Used in viscous stress calculations for fluid flow
Definition at line 394 of file free_surface.cpp.
| auto get_dofs_ents_all |
Get all entities with DOFs in the problem - used for debugging.
| dm | PETSc DM object containing the problem |
Extracts all mesh entities that have degrees of freedom for any field. Useful for debugging mesh partitioning and DOF distribution.
Definition at line 598 of file free_surface.cpp.
| auto get_dofs_ents_by_field_name |
Get entities of DOFs by field name - used for debugging.
| dm | PETSc DM object containing the problem |
| field_name | Name of field to extract entities for |
Extracts all mesh entities that have degrees of freedom for the specified field. Useful for debugging and visualization of field distributions across the mesh.
Definition at line 566 of file free_surface.cpp.
Double-well potential function.
| h | Phase field value |
Double-well potential with minima at h = ±1 (pure phases) and maximum at h = 0 (interface). Controls interface structure.
Definition at line 312 of file free_surface.cpp.
Derivative of double-well potential.
| h | Phase field value |
Definition at line 319 of file free_surface.cpp.
| auto get_fe_bit |
Get bit reference level from finite element.
| fe_ptr | Pointer to finite element method |
Definition at line 520 of file free_surface.cpp.
| auto get_global_size |
Get global size across all processors.
| l_size | Local size on current processor |
Definition at line 529 of file free_surface.cpp.
Definition at line 382 of file free_surface.cpp.
Constant mobility function M₀
| h | Phase field value (unused) |
Definition at line 326 of file free_surface.cpp.
| auto get_M0_dh = [](auto h) { return 0; } |
Derivative of constant mobility.
| h | Phase field value (unused) |
Definition at line 333 of file free_surface.cpp.
| auto get_M2 |
Degenerate mobility function M₂
| h | Phase field value |
Mobility that vanishes at pure phases (h = ±1)
Definition at line 342 of file free_surface.cpp.
Derivative of degenerate mobility M₂
| h | Phase field value |
Definition at line 351 of file free_surface.cpp.
| auto get_M3 |
Non-linear mobility function M₃
| h | Phase field value |
Smooth mobility function with different behavior for h >= 0 and h < 0
Definition at line 360 of file free_surface.cpp.
| auto get_M3_dh |
Derivative of non-linear mobility M₃
| h | Phase field value |
Definition at line 374 of file free_surface.cpp.
Definition at line 383 of file free_surface.cpp.
| auto get_projection_bit = []() { return 2 * get_start_bit() + 4; } |
Definition at line 180 of file free_surface.cpp.
| auto get_skin_child_bit = []() { return 2 * get_start_bit() + 3; } |
Definition at line 179 of file free_surface.cpp.
| auto get_skin_parent_bit = []() { return 2 * get_start_bit() + 2; } |
Definition at line 178 of file free_surface.cpp.
| auto get_skin_projection_bit = []() { return 2 * get_start_bit() + 5; } |
Definition at line 181 of file free_surface.cpp.
| auto get_start_bit |
Definition at line 172 of file free_surface.cpp.
| double h = 0.03 |
Definition at line 195 of file free_surface.cpp.
|
static |
Definition at line 17 of file free_surface.cpp.
|
constexpr |
Definition at line 108 of file free_surface.cpp.
| FTensor::Index<'i', SPACE_DIM> i |
Definition at line 158 of file free_surface.cpp.
| auto init_h |
Initialisation function.
Definition at line 476 of file free_surface.cpp.
| auto integration_rule = [](int, int, int) { return 2 * order + 1; } |
Definition at line 211 of file free_surface.cpp.
| FTensor::Index<'j', SPACE_DIM> j |
Definition at line 159 of file free_surface.cpp.
| FTensor::Index<'k', SPACE_DIM> k |
Definition at line 160 of file free_surface.cpp.
Definition at line 209 of file free_surface.cpp.
| auto kernel_eye |
Eye-shaped interface initialization
| r | Radial coordinate |
| y | Vertical coordinate |
| unused | Z-coordinate (unused in 2D) |
Creates circular droplet centered at (0, y0) with radius R
Definition at line 433 of file free_surface.cpp.
| auto kernel_oscillation |
Oscillating interface initialization.
| r | Radial coordinate |
| y | Vertical coordinate |
| unused | Z-coordinate (unused in 2D) |
Creates circular interface with sinusoidal perturbations:
Definition at line 414 of file free_surface.cpp.
| FTensor::Index<'l', SPACE_DIM> l |
Definition at line 161 of file free_surface.cpp.
| double lambda = 73 |
surface tension
Definition at line 191 of file free_surface.cpp.
| auto marker = [](auto b) { return BitRefLevel().set(BITREFLEVEL_SIZE - b); } |
Create marker bit reference level
| b | Bit number from end |
Definition at line 513 of file free_surface.cpp.
| double md = 1e-2 |
Definition at line 200 of file free_surface.cpp.
Definition at line 206 of file free_surface.cpp.
Definition at line 207 of file free_surface.cpp.
| double mu_m = 0.010101 * 1e2 |
Definition at line 188 of file free_surface.cpp.
| double mu_p = 0.000182 * 1e2 |
Definition at line 190 of file free_surface.cpp.
| auto my_max = [](const double x) { return (x - 1 + std::abs(x + 1)) / 2; } |
Maximum function with smooth transition.
| x | Input value |
Definition at line 248 of file free_surface.cpp.
| auto my_min = [](const double x) { return (x + 1 - std::abs(x - 1)) / 2; } |
Minimum function with smooth transition
| x | Input value |
Definition at line 255 of file free_surface.cpp.
| int nb_levels = 4 |
Definition at line 167 of file free_surface.cpp.
| int order = 3 |
approximation order
Definition at line 166 of file free_surface.cpp.
| auto phase_function |
Phase-dependent material property interpolation.
| h | Phase field value (-1 to 1) |
| diff | Difference between phase values (phase_plus - phase_minus) |
| ave | Average of phase values (phase_plus + phase_minus)/2 |
Linear interpolation: property = diff * h + ave Used for density and viscosity interpolation between phases
Definition at line 288 of file free_surface.cpp.
| int refine_overlap = 4 |
Definition at line 168 of file free_surface.cpp.
Definition at line 204 of file free_surface.cpp.
Definition at line 205 of file free_surface.cpp.
| double rho_m = 0.998 |
Definition at line 187 of file free_surface.cpp.
| double rho_p = 0.0012 |
Definition at line 189 of file free_surface.cpp.
| auto save_range |
Save range of entities to file.
| moab | MOAB interface for mesh operations |
| name | Output filename |
| r | Range of entities to save |
Saves entities to HDF5 file if range is non-empty globally
Definition at line 544 of file free_surface.cpp.
|
constexpr |
Definition at line 104 of file free_surface.cpp.
|
constexpr |
Definition at line 163 of file free_surface.cpp.
| double tol = std::numeric_limits<float>::epsilon() |
Definition at line 202 of file free_surface.cpp.
|
static |
Definition at line 794 of file free_surface.cpp.
|
constexpr |
Definition at line 105 of file free_surface.cpp.
| double W = 0.25 |
Definition at line 192 of file free_surface.cpp.
| auto wetting_angle = [](double water_level) { return water_level; } |
Wetting angle function (placeholder)
| water_level | Current water level |
Currently returns input value directly. Can be modified to implement complex wetting angle dependencies on interface position or time.
Definition at line 499 of file free_surface.cpp.
| auto wetting_angle_sub_stepping |
Wetting angle sub-stepping for gradual application.
| ts_step | Current time step number |
Gradually applies wetting angle boundary condition over first 16 steps to avoid sudden changes that could destabilize the solution.
Definition at line 236 of file free_surface.cpp.