Explore chapters and articles related to this topic
Program Managing
Published in Leonid Burstein, ® Basics, 2022
A user-defined function can be used to calculate some expression containing one of the function output parameters. For example, to calculate the water dynamic viscosity by the expression μ = 2.414–10−2·10247.8/(T–140) (whereμin mPa·s and T in K) at the temperature T = 80 F, we must convert Fahrenheit to Kelvin using the Fah2CK function and then calculateμ; the following commands solve the problem interactively: >>T_F = 80; % assigns temperature in K to the T_F variable >>[T_C,T_K] = Fah2CK(T_F); % converts F to C and K >>mu_water = 2.414e-2*10^(247.8/(T_K-140))%usesT_K output parameter mu_water = 0.8576
PSI: An Established Block-Oriented Simulation Program
Published in Derek A. Linkens, CAD for Control Systems, 2020
The user-defined function allows the inclusion in PSI of any user-defined function. The user can write his own procedure in the programming language C. After compilation and linking with an appropriate compiler, for example, Microsoft C, the user will have an executable program. PSI will load this program in memory and supply this program with the required information and retrieve the calculated quantities. Of course, the user has to obey some rules concerning the interface of data between PSI and his own procedure. Although this approach requires some additional memory, it allows an easy way to extend the capabilities of PSI.
Magnetic Phase Transitions
Published in Alan Stevens, Monte-Carlo Simulation, 2023
Note that the random order in which each site is visited is achieved by using the in-built function, permutation. The resulting one-dimensional list of indices must be turned into lists of row and column numbers needed to address the two-dimensional lattice sites. This is done in the user-defined function, ind2sub.
Motion characteristics and residence time of particles in the new cross structure under constant-pulse condition
Published in Numerical Heat Transfer, Part A: Applications, 2023
Shuyu Su, Yuan Xi, Yan Dai, Hongjing Liu, Hanli Wang
Throughout all of the simulations, the shape of the single particle remains precisely that of a sphere and does not alter. Air represents the gas phase. It has been proposed that a novel cross structure be used in reactors of the coaxial novel cross-type type to investigate the effects of impact inlet velocity conditions, reactor geometry, and particle characteristics on the motion behavior of single particles and the amount of time that particles spend in the reactor. The novel cross-type structure reactor’s mesh model consists of two coaxial nozzles and an impinging chamber, as depicted in Figure 1. Both the conditions used in the simulation and the properties of the gas phase are listed in Tables 2 and 3, respectively. Figure 1 also depicts the boundary conditions of the new cross-type structure reactor. The refined meshes were adopted in both velocity inlet and pressure outlet boundary conditions. The user-defined function (UDF) was used in Fluent 19.2. The Rem is the typical inlet Reynolds number. The typical inlet speeds and Rem values for the three distinct impinging stream types remain constant across all simulations.
Numerical simulation of two experiments for studying propeller exciting forces
Published in Ships and Offshore Structures, 2018
Flow around the bare hull was simulated to obtain the nominal wake. Figure 1 shows the computational domain and the main boundary conditions, where L is the ship length. The hull was fixed and set as a no-slip boundary. Uniform inflow with the speed of 2.1964 m/s was assigned to the velocity inlet boundary. The pressure distribution on the outlet boundary was specified by user defined function. The trimmed cell mesher (CD-Adapco 2015) was applied to discretise the computational domain. Figure 2 shows the computational meshes on the free-water surface and a mid-plane. For a better simulation of turbulences after the ship, vortices shedding from the hull and ship waves, multiple blocks were designed to improve local mesh resolutions in these areas of interest. There are six layers of boundary layer meshes near the hull. Figure 3 shows that the average wall y+ value is about 30. A simple multiphase model, volume of fluid (Seo et al. 2010), was applied to resolve the interface (waves) between water and air. When the waves reach wall boundaries of the virtual tank, they will be reflected back and interfere with the newly generated waves. The wave damping function (Choi and Sung 2009) was used to block the reflected waves. The governing equations were solved using URANS method with the SST (shear stress transport) K-Omega model (CD-Adapco 2015). The time-step size was set to 0.4 s, and the maximum iterations value within each time step is 10. A personal computer with Intel Core i7-4790 (quad core and eight threads) was employed for the simulation. Both residuals and physical quantities monitoring plots were used for the rate of convergence.
Composite laminate design with strength and fatigue life optimization using Elite–Scout Genetic Algorithm (ESGA)
Published in Mechanics of Advanced Materials and Structures, 2018
Tony Kanjirath, Ekambaram Thirupalli
The fitness function is a user-defined function employed to measure the quality of a given solution. In all practical laminate optimization problems, the ideal laminate depends on multiple parameters such as static strength, fatigue life, buckling loads, cost, weight and thickness to name a few. Hence, the best solutions may not be the absolute best when evaluated for an individual parameter; however, by considering all the parameters together they form the optimum solutions. Such solutions are known as Pareto-optimal solutions.