Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
navier_stokes_cahn_hilliard_assemblers.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) 2023-2024 The Lethe Authors
2// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
3
4#ifndef lethe_navier_stokes_cahn_hilliard_assemblers_h
5#define lethe_navier_stokes_cahn_hilliard_assemblers_h
6
8
10#include <solvers/copy_data.h>
13
14
15/**
16 * @brief Class that assembles the core of the Navier-Stokes equation with
17 * free surface using Cahn-Hilliard modeling.
18 * According to the following weak form:
19 * \f$ \nabla \cdot \mathbf{u} + \rho \mathbf{u} \cdot \nabla
20 * \mathbf{u} + \nabla p - \mu \nabla\cdot (\nabla \mathbf{u} +
21 * (\nabla \mathbf{u})^T)=0 \f$ with an SUPG and PSPG stabilization
22 *
23 * @tparam dim An integer that denotes the number of spatial dimensions
24 *
25 * @ingroup assemblers
26 */
27template <int dim>
29 : public NavierStokesAssemblerBase<dim>
30{
31public:
38
39 /**
40 * @brief assemble_matrix Assembles the matrix
41 * @param scratch_data (see base class)
42 * @param copy_data (see base class)
43 */
44 virtual void
46 StabilizedMethodsTensorCopyData<dim> &copy_data) override;
47
48 /**
49 * @brief assemble_rhs Assembles the rhs
50 * @param scratch_data (see base class)
51 * @param copy_data (see base class)
52 */
53 virtual void
55 StabilizedMethodsTensorCopyData<dim> &copy_data) override;
56
57 const bool SUPG = true;
58
59 const std::shared_ptr<SimulationControl> simulation_control;
61};
62
63
64/**
65 * @brief Class that assembles the transient time arising from BDF time
66 * integration for the Navier-Stokes equation with
67 * free surface using Cahn-Hilliard modeling. For example, if a BDF1 scheme is
68 * chosen, the following is assembled
69 * \f$\frac{(\rho \mathbf{u})^{t+\Delta t}-(\rho \mathbf{u})^{t}}{\Delta t} \f$
70 *
71 * @tparam dim An integer that denotes the number of spatial dimensions
72 *
73 * @ingroup assemblers
74 */
75template <int dim>
77 : public NavierStokesAssemblerBase<dim>
78{
79public:
81 const std::shared_ptr<SimulationControl> &simulation_control)
83 {}
84
85 /**
86 * @brief assemble_matrix Assembles the matrix
87 * @param scratch_data (see base class)
88 * @param copy_data (see base class)
89 */
90 virtual void
92 StabilizedMethodsTensorCopyData<dim> &copy_data) override;
93
94 /**
95 * @brief assemble_rhs Assembles the rhs
96 * @param scratch_data (see base class)
97 * @param copy_data (see base class)
98 */
99 virtual void
100 assemble_rhs(const NavierStokesScratchData<dim> &scratch_data,
101 StabilizedMethodsTensorCopyData<dim> &copy_data) override;
102
103 const std::shared_ptr<SimulationControl> simulation_control;
104};
105
106#endif
virtual void assemble_matrix(const NavierStokesScratchData< dim > &scratch_data, StabilizedMethodsTensorCopyData< dim > &copy_data) override
assemble_matrix Assembles the matrix
virtual void assemble_rhs(const NavierStokesScratchData< dim > &scratch_data, StabilizedMethodsTensorCopyData< dim > &copy_data) override
assemble_rhs Assembles the rhs
GLSNavierStokesCahnHilliardAssemblerBDF(const std::shared_ptr< SimulationControl > &simulation_control)
const std::shared_ptr< SimulationControl > simulation_control
const std::shared_ptr< SimulationControl > simulation_control
virtual void assemble_rhs(const NavierStokesScratchData< dim > &scratch_data, StabilizedMethodsTensorCopyData< dim > &copy_data) override
assemble_rhs Assembles the rhs
virtual void assemble_matrix(const NavierStokesScratchData< dim > &scratch_data, StabilizedMethodsTensorCopyData< dim > &copy_data) override
assemble_matrix Assembles the matrix
GLSNavierStokesCahnHilliardAssemblerCore(const std::shared_ptr< SimulationControl > &simulation_control, const SimulationParameters< dim > &nsparam)
Class that stores the information required by the assembly procedure for a Navier-Stokes equation....
Class responsible for storing the information calculated using the assembly of stabilized Tensor<1,...
Definition copy_data.h:166
PhysicsAssemblerBase< NavierStokesScratchData< dim >, StabilizedMethodsTensorCopyData< dim > > NavierStokesAssemblerBase
A pure virtual class that serves as an interface for all of the assemblers for the Navier-Stokes Equa...
Simulation control classes for managing time-stepping and iteration control in Lethe.