Index
ParametersDef
SegregatedVMSSolver.ParametersDef.analytical_solution
— Methodanalytical_solution(diameter::Int64, Vs::Float64, Ua::Float64, Va::Float64, ν::Float64)
It provides the anlytical solution for the Taylor Green Vortex case. Solution for the 2D periodic case
SegregatedVMSSolver.ParametersDef.compute_fluctuation
— Methodcompute_fluctuation(x,t, simcase::SimulationCase)
For the point x, at the time t it computes the velocity fluctuations in all the direction. Each time the time t is increased the Eddy are convected. The time informations are coded in the VirtualBox.
SegregatedVMSSolver.ParametersDef.create_new_case
— Methodcreate_new_case(case::Symbol)
It creates a new case, named case
. It is useful to add new simulation cases in a high level way.
CreateProblem
SegregatedVMSSolver.CreateProblem.add_SEM_tag!
— Methodadd the SEM tag to the nodes in front of the airfoil. c: chord of the airfoil, the points are on a circle at 1 chord of distance from the leading edge. set a_tol for selecting only one lines of points, it depends on how fine the mesh is.
SegregatedVMSSolver.CreateProblem.add_centre_tag!
— Methodadd_centre_tag!(model, tag_coordinate::Point)
It creates the centre
tag at the tag_coordinate (Point); if mesh extremely fine the tolrances have to be smaller (unlikely)
SegregatedVMSSolver.CreateProblem.add_new_tag!
— Methodadd_new_tag!(model, tag_coordinate::Point, tagname::String)
It add a new tag named tagname
at the specified tag_coordinates
SegregatedVMSSolver.CreateProblem.create_initial_conditions
— Methodcreate_initial_conditions(simcase::SimulationCase)
It creates the initial conditions for velocity and pressure. If restart
is true
then the velocity and the pressure field are interpoled on the specified DataFrame.
SegregatedVMSSolver.CreateProblem.create_new_tag!
— Methodcreate_new_tag!(model::GridapDistributed.DistributedDiscreteModel, tagname::String, is_tag::Function)
It creates the centre
tag at the tag_coordinate (Point); if mesh extremely fine the tolrances have to be smaller (unlikely)
SegregatedVMSSolver.CreateProblem.create_search_tree
— Methodcreate_search_tree(restart_df::DataFrame)
Create a BruteTree from the NearestNeighbors.jl package taking the coordinates points as input
SegregatedVMSSolver.CreateProblem.print_model
— Methodprint_model(model,simcase::SimulationCase)
It prints the model mesh
SegregatedVMSSolver.CreateProblem.restart_ph_field
— Methodrestart_ph_field(simcase::VelocityBoundary,tree)
It provides a suitable function which gives for each point the specified pressure in restart_file
. It is used as initial condition for restarting a simulation at a specific time step.
SegregatedVMSSolver.CreateProblem.restart_uh_field
— Methodrestart_uh_field(D::Int64,tree,restart_df::DataFrame)
It provides a suitable function which gives for each point the specified velocity in restart_file
. It is used as initial condition for restarting a simulation at a specific time step.
Equations
SegregatedVMSSolver.Equations.G_params
— MethodG_params(Ω::Triangulation, D)
Compute the tensor G and the values GG and gg according to the VMS formulation proposed by [6]
SegregatedVMSSolver.Equations.cconv
— Methodcconv(uadv, ∇u)
Wrapper for the convective term $u(\nabla u)$
SegregatedVMSSolver.Equations.compute_G
— Methodcompute_G(trian::Gridap.Geometry.BodyFittedTriangulation, D::Int64)
Compute G (AbstractArray of TensorValues)
SegregatedVMSSolver.Equations.compute_GG
— Methodcompute_GG(trian::Gridap.Geometry.BodyFittedTriangulation, params)
Compute GG
SegregatedVMSSolver.Equations.compute_d
— Methodcompute_d(trian::Gridap.Geometry.BodyFittedTriangulation, D::Int64) #trian == Ω
The inverse of the cell-map-field. It is evaluted in the middle of the refernce domain.
SegregatedVMSSolver.Equations.compute_gg
— Methodcompute_GG(trian::Gridap.Geometry.BodyFittedTriangulation, D::Int64)
Compute gg
SegregatedVMSSolver.Equations.continuity_stabilization
— Methodcontinuity_stabilization(uu, stab_coeff::ScalarStabilization,simcase::SimulationCase )
Stabilization parameters continuity equation Janssens, B. (2014). Numerical modeling and experimental investigation of fine particle coagulation and dispersion in dilute flows.
SegregatedVMSSolver.Equations.continuity_stabilization
— Methodcontinuity_stabilization(uu, stab_coeff::TensorStabilization,simcase::SimulationCase )
Stabilization parameter continuity Bazilevs, Y., Calo, V. M., Cottrell, J. A., Hughes, T. J. R., Reali, A., & Scovazzi, G. (2007). Variational multiscale residual-based turbulence modeling for large eddy simulation of incompressible flows. Computer Methods in Applied Mechanics and Engineering, 197(1–4), 173–201. https://doi.org/10.1016/j.cma.2007.07.016
SegregatedVMSSolver.Equations.h_param
— Methodh_param(Ω::Triangulation, D::Int64)
For a given triangulation Ω
it computes the cell size $Area^{1/2}, D=2$ $Volume^{1/3}, D=3$
SegregatedVMSSolver.Equations.momentum_stabilization
— Methodmomentum_stabilization(uu, stab_coeff::ScalarStabilization,simcase::SimulationCase )
Stabilization parameters momentum equation Janssens, B. (2014). Numerical modeling and experimental investigation of fine particle coagulation and dispersion in dilute flows.
SegregatedVMSSolver.Equations.momentum_stabilization
— Methodmomentum_stabilization(uu, stab_coeff::TensorStabilization,simcase::SimulationCase )
Stabilization parameter momentum stabilization Bazilevs, Y., Calo, V. M., Cottrell, J. A., Hughes, T. J. R., Reali, A., & Scovazzi, G. (2007). Variational multiscale residual-based turbulence modeling for large eddy simulation of incompressible flows. Computer Methods in Applied Mechanics and Engineering, 197(1–4), 173–201. https://doi.org/10.1016/j.cma.2007.07.016
MatrixCreation
SegregatedVMSSolver.MatrixCreation.allocate_Mat_inv_ML
— Methodallocate_Mat_inv_ML(Mat_ML::PSparseMatrix)
It allocates a zero vector where to store the inverse of the lumped matrix
SegregatedVMSSolver.MatrixCreation.initialize_vectors
— Methodinitialize_vectors(matrices::Tuple,uh0,ph0)
It initializes vectors where velocity, pressure, acceleration and all the increments will be stored.
SegregatedVMSSolver.MatrixCreation.inv_lump_vel_mass!
— Methodinv_lump_vel_mass!(Mat_inv_ML::PVector,Mat_ML::PSparseMatrix)
It computes the lumped matrix, takes the inverse of the diagonal elements.
SolverOptions
SegregatedVMSSolver.SolverOptions.create_PETSc_setup
— Methodcreate_PETSc_setup(M::AbstractMatrix,ksp_setup::Function)
Wrapper for creating PETSc symbolic and numeric setup for GridapPETSc
SegregatedVMSSolver.SolverOptions.petsc_options
— Methodpetsc_options(; vel_ksp="gmres", vel_pc="gamg", pres_ksp = "cg", pres_pc = "gamg")
It provides the command-line for GridapPETSc
to solve the segregated linear systems
VectorsOperations
SegregatedVMSSolver.VectorsOperations.create_ũ_vector
— Methodcreate_ũ_vector(zfv1::AbstractVector)
It allocates the vector to keep in memory the velocity field up to previous 4 time steps
SegregatedVMSSolver.VectorsOperations.set_zeros!
— Methodset_zeros!(fields::DebugArray)
Set zeros as free values for a field
SegregatedVMSSolver.VectorsOperations.update_ũ
— Methodupdateũ(ũvec::Vector)
It uses the Taylor expansion proposed by [7]
SegregatedVMSSolver.VectorsOperations.update_ũ_vector!
— Methodupdate_ũ_vector!(ũ_vec::Vector, uh_new::AbstractVector)
It updates the vector which stores the values of velocity at previous time steps.
ExportUtility
SegregatedVMSSolver.ExportUtility.compute_enstrophy_ek
— Methodcompute_enstrophy_ek(simcase, params::Dict{Symbol,Any}, fields::Tuple)
Compute enstrophy and Kinetic Energy - not normalized with volume.
SegregatedVMSSolver.ExportUtility.compute_error
— Methodcompute_error(params::Dict{Symbol,Any}, simcase::TaylorGreen{Periodic}, tn::Float64, fields::Tuple)
Compute L2 error norm for velocity and pressure for TGV2D case. https://doi.org/10.1016/j.enganabound.2020.12.018
SegregatedVMSSolver.ExportUtility.conv_to_df
— Methodconv_to_df(vv::Vector)
Convert a Vector{Float64} to a DataFrame. It is used for export pressure field.
SegregatedVMSSolver.ExportUtility.conv_to_df
— Methodconv_to_df(vv::Vector)
Convert a Vector{Vector} to a DataFrame. It is used for export nodes, normals.
SegregatedVMSSolver.ExportUtility.create_export_tags!
— Methodcreate_export_tags!(params::Dict{Symbol,Any})
For each ´nametags´ it creates the ´exporttags´ dictionary
SegregatedVMSSolver.ExportUtility.export_fields
— Methodexport_fields(params::Dict{Symbol,Any}, fieldexport::Vector, tt::Float64, uh0, ph0)
Export pressure and friction (not multiplied by viscosity) - airfoil simulations oriented
SegregatedVMSSolver.ExportUtility.print_on_request
— Methodprint_on_request(log_dir::String)
If in the directory log_dir
exists and there is the PrintSim.txt
file return true. If true is printing simulations results in Paraview format (.vtu and .pvtu).
SegregatedVMSSolver.ExportUtility.write_to_csv
— Methodwrite_to_csv(file_path::String, data::Vector{Vector{Any}}, parts)
Write Results on CSV file
SolveProblem
SegregatedVMSSolver.SolveProblem.solve_case
— Methodsolve_case(params::Dict{Symbol,Any})
It solves iteratively the velocity and pressure system.
Interfaces
SyntheticEddyMethod.VirtualBox
— MethodVirtualBox(ylims::Tuple{Real,Real}, zlims::Tuple{Real,Real} ; σ=0.1)
Utility to create VirtualBox, specifing the ylims of the inlet, the zlims for the virtual plane, and the σ eddy dimension. Refer to the original documentation of the package SynteticEddyMethod for more info, and specifing more advanced settings
Utils
SegregatedVMSSolver.ReadAirfoilResults
SegregatedVMSSolver.ReadAirfoilResults.XYPlane
— TypeXYPlane
Give a zp coordinate, it gives the indexes of the points in that XY plane
SegregatedVMSSolver.ReadAirfoilResults.ZProbe
— TypeZProbe
Give a 2D point coordinate xp, yp, it gived the idx of the points aligned in the z direction
SegregatedVMSSolver.ReadAirfoilResults.average_3D_field
— Methodaverage_3D_field(nodes::GeometryNodes{D3}, df_field::DataFrame)
It is averaging the dataframes value over the points aligned in the z direction
SegregatedVMSSolver.ReadAirfoilResults.average_3D_field
— Methodaverage_3D_field(path::String, field_name::String; offset=1, offend = 0, step::Int64=1, tagname="airfoil")
It provides Array{DataFrame}, where each element is a DataFrame at a single time step of the average in z direction.
SegregatedVMSSolver.ReadAirfoilResults.compute_CL_CD
— Methodcompute_CL_CD(top_nodesx,bottom_nodesx,top_nodesy,bottom_nodesy,cp_top,cp_bottom,
friction_top,friction_bottom; chord = 1.0)
It computes lift and drag coefficients
SegregatedVMSSolver.ReadAirfoilResults.compute_CL_CD_separation_time
— Methodcompute_CL_CD(top_nodesx,bottom_nodesx,top_nodesy,bottom_nodesy,cp_top,cp_bottom,
friction_top,friction_bottom; chord = 1.0)
It computes lift and drag coefficients
SegregatedVMSSolver.ReadAirfoilResults.compute_PSD
— Methodcompute_PSD(Vel::Array, tn::Vector{Float64})
It computes the PSD of the TKE. Vel is the result obtained through read_fluctuations
. The spectras are averaged in the Z direction
SegregatedVMSSolver.ReadAirfoilResults.compute_plane_tke
— Methodcompute_plane_tke(res_path::String;tagname="topairfoil", offset=1,offend=-1, zp=[0.1])
It computes the TKE for each point in the plane with Z=Zp.
SegregatedVMSSolver.ReadAirfoilResults.compute_scatter_interp
— Methodcompute_scatter_interp(res_path, velocity::Vector{Float64} ,zp::Float64; tagname="topairfoil", ylims=[-0.018,0.15], xlims=[0.5,1.0])
In res_path is reading the nodes file associated with the tagname. It computes the interpolation of the values in velocity on nodes of plane in zp. NearestNeighbor() algorithm is used.
SegregatedVMSSolver.ReadAirfoilResults.extract_Cf
— Methodextract_Cf(nodes::GeometryNodes, Friction::DataFrame; u0::Float64, μ::Float64, rho::Float64)
For a given set of nodes and Ph dataframe, it provides the friction coefficient for top and bottom
SegregatedVMSSolver.ReadAirfoilResults.extract_Cp
— Methodextract_Cp(nodes::GeometryNodes, Ph::DataFrame ; u0::Float64, rho::Float64)
For a given set of nodes and Ph dataframe, it provides the pressure coefficient for top and bottom
SegregatedVMSSolver.ReadAirfoilResults.get_idx_sort_reduct
— Methodget_idx_sort_reduct(res_path::String,tagname::String,offset::Int64,offend::Int64)
In res_path directory, for the boundary tagname, it provides the sorted file indexes
SegregatedVMSSolver.ReadAirfoilResults.get_nodes
— Methodget_nodes(path::String)
It provides a DataFrame
with the nodes of the Airfoil
boundary
SegregatedVMSSolver.ReadAirfoilResults.get_normals
— Methodget_nodes(path::String)
It provides a DataFrame
with the normals vectors at the surface of the Airfoil
boundary
SegregatedVMSSolver.ReadAirfoilResults.read_fluctuations
— Methodread_fluctuations(res_path::String, xpyp::Vector{Float64};tagname="topairfoil", offset=1,offend=-1)
It is reading the results in res_path
, for all the points aligned in Z direction of coordinates xpyp
. It provides the ZProbe which has the information of the actual nodes used. Vel_Mat is a dense matrix: Time x Points x Velocity Components (3) offset and offend can be used to skip intial and final files (avoiding OutOfMemory() error)
SegregatedVMSSolver.ReadAirfoilResults.time_space_average_field
— Methodtime_space_average_field(path::String, field_name::String, nodes::GeometryNodes; offset=1, offend = 0, step::Int64=1, tagname="airfoil")
It computes a time and span-average for a specific field.
SegregatedVMSSolver.WallDistance
SegregatedVMSSolver.WallDistance.boundary_layer_height
— Methodboundary_layer_height(Re::Real, L::Float64)
From Reynolds and characteristic dimension extimates the boundary layer height
SegregatedVMSSolver.WallDistance.boundary_layer_quadratic_profile
— Methodboundary_layer_quadratic_profile(x, δ99::Float64, u_in::Real)
Parabolic approximation for boundary layer growth
SegregatedVMSSolver.WallDistance.get_initial_conditions
— Methodgetinitialconditions(meshfile::String, uin::Float64, Re::Real, walltag; chord::Float64=1.0, D::Int64=2, p::Int64=6)
It runs Picard iterations of the p-Poisson problem up to p=6 with relaxation factor of 0.5. It is require p>3 It creates the .vtu
file with the boundary layer initialization and also the .csv
file which can be used to start a simulation over an airfoil. It return a dataframe where for each nodes are provided the coordinates and the velocity vector components.
SegregatedVMSSolver.WallDistance.intialize_picard_iteration
— Methodintialize_picard_iteration(solver, Vg, V0, dΩ)
Solve the p poisson for p=1
SegregatedVMSSolver.WallDistance.run_picard_iteration
— Methodrun_picard_iteration(solver, Vg, V0, dΩ, uh_adv, p, γ)
Solve the linearized p-Poisson. uh_adv
is the solution at the previous iteration. γ
is the relaxation parameter.