TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
IJK_Ghost_Fluid_tools.h
1/****************************************************************************
2* Copyright (c) 2023, CEA
3* All rights reserved.
4*
5* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
9*
10* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
11* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
12* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13*
14*****************************************************************************/
15#ifndef IJK_Ghost_Fluid_tools_included
16#define IJK_Ghost_Fluid_tools_included
17#include <IJK_Field.h>
18#include <IJK_Field_vector.h>
19#include <IJK_Interfaces.h>
20#include <Maillage_FT_IJK.h>
21#include <IJK_subres_constants.h>
22
23//Be coherent with LOCAL EPS of Intersection Interface IJK
24#define select_dir(a,x,y,z) ((a==0)?(x):((a==1)?(y):(z)))
25#define selectxy(a,x,y) ((a==0)?(x):(y))
26
27void compute_eulerian_normal_distance_facet_barycentre_field(const IJK_Interfaces& interface,
28 IJK_Field_double& distance,
29 IJK_Field_vector3_double& normal_vect,
30 IJK_Field_vector3_double& facets_barycentre,
31 IJK_Field_vector3_double& tmp_old_vector_val,
32 IJK_Field_vector3_double& tmp_new_vector_val,
33 IJK_Field_double& tmp_old_val,
34 IJK_Field_double& tmp_new_val,
35 IJK_Field_int& tmp_interf_cells,
36 IJK_Field_int& tmp_propagated_cells,
37 FixedVector<ArrOfInt,3>& interf_cells_indices,
38 FixedVector<ArrOfInt,3>& gfm_first_cells_indices_,
39 FixedVector<ArrOfInt,3>& propagated_cells_indices,
40 const int& n_iter,
41 const int& avoid_gfm_parallel_calls=0);
42
43void compute_eulerian_curvature_field_from_distance_field(const IJK_Field_double& distance,
44 IJK_Field_double& curvature,
45 const IJK_Field_local_double& boundary_flux_kmin,
46 const IJK_Field_local_double& boundary_flux_kmax);
47
48void compute_eulerian_curvature_field_from_normal_vector_field(const IJK_Field_vector3_double& normal_vect,
49 IJK_Field_double& curvature);
50
51void compute_eulerian_curvature_field_from_interface(const IJK_Field_vector3_double& normal_vect,
52 const IJK_Interfaces& interfaces,
53 IJK_Field_double& interfacial_area,
54 IJK_Field_double& curvature,
55 IJK_Field_double& tmp_old_val,
56 IJK_Field_double& tmp_new_val,
57 const int& n_iter,
58 int igroup);
59
60void compute_eulerian_normal_temperature_gradient_interface(const IJK_Field_double& distance,
61 const IJK_Field_double& indicator,
62 const IJK_Field_double& interfacial_area,
63 const IJK_Field_double& curvature,
64 const IJK_Field_double& temperature,
65 IJK_Field_double& grad_T_interface,
66 const int& spherical_approx,
67 const double& temperature_interf=0);
68
69void propagate_eulerian_normal_temperature_gradient_interface(const IJK_Interfaces& interfaces,
70 const IJK_Field_double& distance,
71 IJK_Field_double& grad_T_interface,
72 const int& stencil_width,
73 const int& recompute_field_ini=1,
74 const int& zero_neighbour_value_mean=0,
75 const int& vapour_mixed_only=1,
76 const int& smooth_factor=10);
77
78void compute_eulerian_extended_temperature(const IJK_Field_double& indicator,
79 const IJK_Field_double& distance,
80 const IJK_Field_double& curvature,
81 IJK_Field_double& grad_T_interface,
82 IJK_Field_double& temperature,
83 const int& spherical_approx,
84 const double& temperature_interf=0);
85
86void smooth_vector_field(IJK_Field_vector3_double& vector_field,
87 IJK_Field_vector3_double& vector_field_init,
88 const IJK_Field_vector3_double * eulerian_normal_vectors_ns_normed,
89 const IJK_Interfaces& interfaces,
90 const double (&direct_smoothing_factors) [7],
91 const double (&gaussian_smoothing_factors) [3][3][3],
92 const int& smooth_numbers=1,
93 const int& remove_normal_compo=0,
94 const int& direct_neighbours=0,
95 const int& use_field_init=1,
96 const int& use_unique_phase=1);
97
98void smooth_eulerian_field(IJK_Field_double& field,
99 IJK_Field_double& field_init,
100 const int& c,
101 IJK_Field_vector3_double& vector_field_init,
102 const IJK_Field_vector3_double * eulerian_normal_vectors_ns_normed,
103 const IJK_Interfaces& interfaces,
104 const double (&direct_smoothing_factors) [7],
105 const double (&gaussian_smoothing_factors) [3][3][3],
106 const int& smooth_numbers=1,
107 const int& remove_normal_compo=0,
108 const int& direct_neighbours=0,
109 const int& use_field_init=1,
110 const int& use_unique_phase=1);
111
112void fill_tangential_gradient(const IJK_Field_vector3_double& vector_field,
113 const IJK_Field_vector3_double * eulerian_normal_vectors_ns_normed,
114 IJK_Field_vector3_double& tangential_vector_field);
115
116void fill_tangential_gradient_compo(const IJK_Field_vector3_double& vector_field,
117 const IJK_Field_vector3_double * eulerian_normal_vectors_ns_normed,
118 IJK_Field_double& tangential_field,
119 const int& dir);
120
121#endif
: class IJK_Interfaces