4#ifndef lethe_navier_stokes_cls_assemblers_h
5#define lethe_navier_stokes_cls_assemblers_h
211 const std::vector<double> &carman_kozeny_permeability_area,
215 fluid_with_phase_change,
276 static std::vector<double>
278 const std::vector<double> &carman_kozeny_permeability_area)
280 std::vector<double> carman_kozeny_permeability_area_inverse(
281 carman_kozeny_permeability_area.size());
283 for (
unsigned int i = 0; i < carman_kozeny_permeability_area.size(); ++i)
284 carman_kozeny_permeability_area_inverse[i] =
285 1 / carman_kozeny_permeability_area[i];
287 return carman_kozeny_permeability_area_inverse;
301 static std::vector<bool>
304 const unsigned int n_fluids)
306 std::vector<bool> enable_phase_change_vector(n_fluids,
false);
309 enable_phase_change_vector[0] =
true;
311 enable_phase_change_vector[1] =
true;
313 enable_phase_change_vector.assign(n_fluids,
true);
314 return enable_phase_change_vector;
358 const std::shared_ptr<SimulationControl> &p_simulation_control,
361 ,
STF_parameters(nsparam.multiphysics.cls_parameters.surface_tension_force)
411 const std::shared_ptr<SimulationControl> &p_simulation_control,
464 const std::shared_ptr<SimulationControl> &p_simulation_control,
527 inline Tensor<1, dim>
529 const Tensor<2, dim> &velocity_gradient,
530 const Tensor<3, dim> &velocity_hessians,
531 const double shear_rate_magnitude,
532 const double grad_kinematic_viscosity_shear_rate)
const
536 Tensor<1, dim> grad_shear_rate;
537 for (
int d = 0; d < dim; ++d)
541 for (
int k = 0; k < dim; ++k)
543 grad_shear_rate[d] +=
544 2 * (velocity_gradient[k][k] * velocity_hessians[k][d][k]) /
545 shear_rate_magnitude;
547 grad_shear_rate[d] +=
548 (velocity_gradient[0][1] + velocity_gradient[1][0]) *
549 (velocity_hessians[0][d][1] + velocity_hessians[1][d][0]) /
550 shear_rate_magnitude;
554 for (
int k = 0; k < dim; ++k)
556 grad_shear_rate[d] +=
557 2 * (velocity_gradient[k][k] * velocity_hessians[k][d][k]) /
558 shear_rate_magnitude +
559 (velocity_gradient[(k + 1) % dim][(k + 2) % dim] +
560 velocity_gradient[(k + 2) % dim][(k + 1) % dim]) *
561 (velocity_hessians[(k + 1) % dim][d][(k + 2) % dim] +
562 velocity_hessians[(k + 2) % dim][d][(k + 1) % dim]) /
563 shear_rate_magnitude;
567 return grad_shear_rate * grad_kinematic_viscosity_shear_rate;
static std::shared_ptr< EvaporationModel > model_cast(const Parameters::Evaporation &evaporation_parameters)
Instantiates and returns a pointer to an EvaporationModel object by casting it to the proper child cl...
virtual void assemble_matrix(const NavierStokesScratchData< dim > &scratch_data, StabilizedMethodsTensorCopyData< dim > ©_data) override
assemble_matrix Assembles the matrix
GLSNavierStokesCLSAssemblerBDF(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 > ©_data) override
assemble_rhs Assembles the rhs
GLSNavierStokesCLSAssemblerCore(const std::shared_ptr< SimulationControl > &simulation_control, const SimulationParameters< dim > &nsparam)
const std::shared_ptr< SimulationControl > simulation_control
virtual void assemble_rhs(const NavierStokesScratchData< dim > &scratch_data, StabilizedMethodsTensorCopyData< dim > ©_data) override
assemble_rhs Assembles the rhs
virtual void assemble_matrix(const NavierStokesScratchData< dim > &scratch_data, StabilizedMethodsTensorCopyData< dim > ©_data) override
assemble_matrix Assembles the matrix
const Parameters::CLS cls_parameters
virtual void assemble_matrix(const NavierStokesScratchData< dim > &scratch_data, StabilizedMethodsTensorCopyData< dim > ©_data) override
assemble_matrix Adds the surface tension and Marangoni forces to the strong residual used by the stab...
GLSNavierStokesCLSAssemblerMarangoni(const std::shared_ptr< SimulationControl > &p_simulation_control, Parameters::CLS_SurfaceTensionForce p_STF_properties)
const Parameters::CLS_SurfaceTensionForce STF_properties
const std::shared_ptr< SimulationControl > simulation_control
virtual void assemble_rhs(const NavierStokesScratchData< dim > &scratch_data, StabilizedMethodsTensorCopyData< dim > ©_data) override
assemble_rhs Assembles the rhs
virtual void assemble_matrix(const NavierStokesScratchData< dim > &scratch_data, StabilizedMethodsTensorCopyData< dim > ©_data) override
assemble_matrix Assembles the matrix
virtual void assemble_rhs(const NavierStokesScratchData< dim > &scratch_data, StabilizedMethodsTensorCopyData< dim > ©_data) override
assemble_rhs Assembles the rhs
GLSNavierStokesCLSAssemblerNonNewtonianCore(const std::shared_ptr< SimulationControl > &simulation_control, const SimulationParameters< dim > &nsparam)
Tensor< 1, dim > get_kinematic_viscosity_gradient(const Tensor< 2, dim > &velocity_gradient, const Tensor< 3, dim > &velocity_hessians, const double shear_rate_magnitude, const double grad_kinematic_viscosity_shear_rate) const
Calculates an approximation of the gradient of the viscosity.
const std::shared_ptr< SimulationControl > simulation_control
const Parameters::CLS cls_parameters
const std::shared_ptr< SimulationControl > simulation_control
GLSNavierStokesCLSAssemblerSTF(const std::shared_ptr< SimulationControl > &p_simulation_control, const SimulationParameters< dim > &nsparam)
const Parameters::CLS_SurfaceTensionForce STF_parameters
virtual void assemble_matrix(const NavierStokesScratchData< dim > &scratch_data, StabilizedMethodsTensorCopyData< dim > ©_data) override
assemble_matrix Adds the surface tension force to the strong residual used by the stabilization terms...
virtual void assemble_rhs(const NavierStokesScratchData< dim > &scratch_data, StabilizedMethodsTensorCopyData< dim > ©_data) override
assemble_rhs Assembles the rhs
NavierStokesCLSAssemblerEvaporation(const std::shared_ptr< SimulationControl > &p_simulation_control, const Parameters::Evaporation &p_evaporation)
virtual void assemble_matrix(const NavierStokesScratchData< dim > &scratch_data, StabilizedMethodsTensorCopyData< dim > ©_data) override
assemble_matrix Adds the recoil pressure force to the strong residual used by the stabilization terms...
virtual void assemble_rhs(const NavierStokesScratchData< dim > &scratch_data, StabilizedMethodsTensorCopyData< dim > ©_data) override
assemble_rhs Assembles the rhs
const std::shared_ptr< SimulationControl > simulation_control
std::shared_ptr< EvaporationModel > evaporation_model
Class that stores the information required by the assembly procedure for a Navier-Stokes equation....
static std::vector< double > compute_permeability_area_inverse(const std::vector< double > &carman_kozeny_permeability_area)
Compute the inverse values of the Carman-Kozeny permeability areas.
virtual void assemble_rhs(const NavierStokesScratchData< dim > &scratch_data, StabilizedMethodsTensorCopyData< dim > ©_data) override
Assemble the right-hand side (rhs) of:
virtual void assemble_matrix(const NavierStokesScratchData< dim > &scratch_data, StabilizedMethodsTensorCopyData< dim > ©_data) override
Assembles the matrix of:
const std::vector< double > carman_kozeny_permeability_area_inv
PhaseChangeCarmanKozenyCLSAssembler(const Parameters::FluidIndicator &fluid_with_phase_change, const std::vector< double > &carman_kozeny_permeability_area, const std::vector< double > &carman_kozeny_tolerance, const std::vector< Parameters::PhaseChange > &phase_change_parameters_vector)
Assembler for the Carman-Kozeny permeability source term used for phase change modelling.
const std::vector< Parameters::PhaseChange > phase_change_parameters_vector
const std::vector< bool > fluid_has_phase_change
const std::vector< double > carman_kozeny_tolerance
static std::vector< bool > indentify_fluid_with_phase_change(const Parameters::FluidIndicator fluid_with_phase_change, const unsigned int n_fluids)
Checks which fluid(s) has/have phase change and returns a vector of boolean indicating if each fluid ...
const bool enable_darcy_multiply_by_density
virtual void assemble_matrix(const NavierStokesScratchData< dim > &scratch_data, StabilizedMethodsTensorCopyData< dim > ©_data) override
assemble_matrix Assembles the matrix of: .
PhaseChangeDarcyCLSAssembler(const std::vector< Parameters::PhaseChange > &phase_change_parameters_vector, const bool enable_darcy_multiply_by_density)
const std::vector< Parameters::PhaseChange > phase_change_parameters_vector
virtual void assemble_rhs(const NavierStokesScratchData< dim > &scratch_data, StabilizedMethodsTensorCopyData< dim > ©_data) override
assemble_rhs Assembles the weak form of:
Class responsible for storing the information calculated using the assembly of stabilized Tensor<1,...
virtual void assemble_rhs(const NavierStokesScratchData< dim > &scratch_data, StabilizedMethodsTensorCopyData< dim > ©_data) override
assemble_rhs Assembles the weak form of:
ThermalBuoyancyAssemblyCLS(const std::shared_ptr< SimulationControl > &simulation_control, const double reference_temperature)
virtual void assemble_matrix(const NavierStokesScratchData< dim > &scratch_data, StabilizedMethodsTensorCopyData< dim > ©_data) override
assemble_matrix Adds the buoyancy force to the strong residual used by the stabilization terms of the...
const double reference_temperature
const std::shared_ptr< SimulationControl > simulation_control
FluidIndicator
Class to account for different fluid indicators. This is used for multiphase simulations in PostProce...
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.
Parameters for the calculation of surface tension force in the CLS solver.
CLS - Defines the parameters for free surface simulations using the CLS method. Has to be declared be...
Evaporation - Defines the subparameters for the evaporation cooling and recoil pressure at the free s...