Method for optimizing a casting design based on lost foam casting
By optimizing the design of the foaming mold using computer-aided design and conditional generative adversarial networks, a gradient lattice support structure is generated, which solves the problems of uneven shrinkage deformation and coating penetration of the foaming mold in lost foam casting, and improves the dimensional accuracy and surface quality of the castings.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 嘉禾县佳达合金有限公司
- Filing Date
- 2026-04-22
- Publication Date
- 2026-07-14
Smart Images

Figure CN122389237A_ABST
Abstract
Description
Technical Field
[0001] This invention discloses a casting design optimization method based on lost foam casting, belonging to the field of computer-aided design technology. Background Technology
[0002] In lost foam casting, the design of the foaming mold directly determines the dimensional accuracy of the final casting. Existing conventional design methods, after obtaining the 3D model of the target casting, scale up the casting model proportionally based on the fixed shrinkage rate of the selected foaming material to generate the 3D design model of the foaming mold. Regarding the surface defects caused by coating penetration into the foaming mold during the casting process, current processes typically rely on operator experience to adjust the coating ratio or increase the coating thickness to prevent penetration during the coating application stage.
[0003] The aforementioned conventional design scheme has a core flaw: the foaming molds for complex structural castings exhibit significant differences in wall thickness distribution and local geometric features. During the foaming process, the heat conduction paths and expansion resistances in different regions are inconsistent, resulting in uneven spatial shrinkage deformation. Using a fixed shrinkage rate for overall proportional scaling fails to reflect the true deformation gradient in different regions of the foaming mold. This leads to dimensional deviations still existing in localized areas of the compensated model. Furthermore, placing anti-penetration design after structural design leaves dimensional deviation control and coating penetration avoidance in a disconnected state. Summary of the Invention
[0004] The purpose of this invention is to provide a solution that can effectively address the problems described in the background section.
[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0006] A casting design optimization method based on lost foam casting includes:
[0007] Obtain the three-dimensional model, dimensional tolerance requirements, and foaming material performance parameters of the target casting, and generate the initial parametric geometric model of the foaming mold through computer-aided reverse design;
[0008] The structural complexity and wall thickness distribution of the initial foaming mold are extracted. A gradient lattice support structure is generated inside using three-dimensional Voronoi lattice parameterization design. The lattice parameters are then correlated with the foaming shrinkage rate and thermal deformation parameters.
[0009] Using historical foaming deformation data, dimensional deviation data, and coating penetration defect data as training sets, a conditional generative adversarial network is constructed. With foaming mold geometric parameters, lattice parameters, and process parameters as conditional inputs, the network predicts the shrinkage deformation amount and coating penetration risk area of the entire region and outputs geometric compensation correction parameters.
[0010] The modified foaming mold is subjected to porous media permeation simulation. The simulation results are fed back to the conditional generative adversarial network for iterative optimization until the convergence condition is met, and the final three-dimensional design model of the foaming mold is output.
[0011] Preferably, the computer-aided reverse design for generating the initial parametric geometric model of the foaming mold includes:
[0012] A nonlinear mapping relationship between the geometric features of the target casting and the thermophysical properties of the foaming material is established. A manifold learning algorithm is used to reduce the dimensionality of the high-dimensional spatial geometric features of the three-dimensional model of the casting and extract the core topological manifold.
[0013] The core topological manifold is input into a pre-constructed inverse deformation field. By combining the anisotropic thermal expansion coefficient and density distribution constraints of the foamed material, the inverse thermal deformation partial differential equation is solved through backpropagation, and the parameterized geometric model of the initial foaming mold is calculated.
[0014] Preferably, the generation of gradient lattice support structures using parametric design of a three-dimensional Voronoi lattice includes:
[0015] The three-dimensional voxel mesh of the initial foaming mold is transformed into graph structure data, where nodes represent voxel centers and edges represent spatial adjacency relationships.
[0016] Structural complexity and wall thickness distribution are used as node attributes and edge weights, respectively, and input into a graph neural network. The spatial attention mechanism is used to capture the differential effects of local structural features on foaming shrinkage.
[0017] Based on the node embedding vectors output by the graph neural network, a three-dimensional Voronoi seed point distribution is adaptively generated through a spatial clustering algorithm to construct a three-dimensional Voronoi lattice support structure in which the rod diameter and relative density vary with gradient.
[0018] Preferably, the conditional generative adversarial network predicts the total shrinkage deformation and coating penetration risk areas, including:
[0019] A spatiotemporal graph convolutional network and Transformer architecture are introduced into the generator to convert the geometric parameters, lattice parameters and process parameters of the foaming mold into spatiotemporal feature sequences.
[0020] Spatiotemporal graph convolutional networks are used to extract local physical field evolution features of three-dimensional spatial geometric topology, and the Transformer architecture is used to capture the global dependence of physical fields in the time dimension under different combinations of process parameters.
[0021] By fusing local and global features, a full-area shrinkage deformation field tensor and a coating penetration probability distribution matrix aligned with the input conditions are generated.
[0022] Preferably, the porous media permeation simulation of the modified foaming mold includes:
[0023] A porous media seepage dynamics model of coating on foam mold surface is established based on lattice Boltzmann method, and the gradient parameters of lattice support structure are set as seepage boundary conditions.
[0024] A Fourier neural operator surrogate model is introduced to replace the traditional numerical solution process of fluid mechanics, and the flow field evolution law under different lattice configurations and seepage pressure boundaries is learned in the frequency domain.
[0025] The coating penetration depth distribution field and velocity vector field output by the Fourier neural operator proxy model are fed back to the conditional generative adversarial network as simulation results.
[0026] Preferably, the parametric geometric model of the initial foaming mold also includes:
[0027] In the process of backpropagation to solve the partial differential equation of inverse thermal deformation, a multi-objective deep reinforcement learning strategy is introduced, with the manufacturability index of foaming mold and the structural stiffness index as reward functions.
[0028] The agent, which uses deep reinforcement learning, dynamically adjusts the boundary constraint weights in the inverse deformation field in the continuous action space. It uses the Pareto optimization mechanism to find the optimal equilibrium solution between the foaming shrinkage rate compensation margin and the preservation of the topology, and outputs the initial foaming mold parameterized geometric model that satisfies the multi-objective constraints.
[0029] Preferably, constructing a three-dimensional Voronoi lattice support structure with a gradient change in rod diameter and relative density further includes:
[0030] The node embedding vectors output by the graph neural network are mapped to the initial population of the adaptive differential evolution algorithm, with the objective function being to minimize the local thermal stress concentration during the foaming process.
[0031] In the crossover and mutation operations of the adaptive differential evolution algorithm, the physical phase transition dynamics equation of polymer materials is coupled, and the scaling factor of the lattice rod diameter and the node connectivity topology are dynamically adjusted according to the temperature gradient of different regions, driving the population to evolve to the optimal configuration for heat deformation prevention, and generating the final gradient lattice support structure.
[0032] Preferably, the training process of a conditional generative adversarial network also includes:
[0033] To address the issue of data distribution deviation in historical batch data caused by equipment replacement or environmental drift, a cross-domain contrastive learning mechanism is introduced into the discriminator of the conditional generative adversarial network.
[0034] Deformation data of the same foaming mold with the same geometric parameters under different working conditions are used as positive sample pairs, and deformation data with different geometric parameters are used as negative sample pairs. The similarity of positive sample pairs in the latent feature space is maximized and the distance between negative sample pairs is increased.
[0035] Preferably, feeding the simulation results back to the conditional generative adversarial network for iterative optimization includes:
[0036] An active learning strategy is embedded during the iterative optimization process to calculate the information entropy of the current coating penetration probability distribution matrix.
[0037] When the information entropy is higher than the preset uncertainty threshold, the local geometric region with the highest entropy value is actively selected as the key feedback node. The Fourier neural operator proxy model is triggered only for the key feedback node to perform local refined porous media permeation simulation. The local simulation results are injected into the conditional generative adversarial network as new samples to minimize the consumption of computing resources in the overall iteration process.
[0038] Preferably, the construction and training process of the cross-domain contrastive learning mechanism also includes:
[0039] A federated learning framework is used to aggregate historical batch data from different lost foam casting production lines, and a cross-domain comparative learning mechanism is used to extract local operating condition feature representations on each production line.
[0040] In the global aggregation phase of federated learning, a homomorphic encryption algorithm is introduced to encrypt the model gradients representing local working condition features.
[0041] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0042] This invention extracts the core topological manifold through computer-aided reverse design and solves the partial differential equations for reverse thermal deformation to obtain an initial parametric model of the foaming mold. A graph neural network is used to capture local structural features, adaptively generating a gradient-based Vinograph lattice support structure that correlates shrinkage rate and thermal deformation. Using lattice parameters and process parameters as conditions, a spatiotemporal graph convolutional network and transformer architecture predict the total shrinkage deformation and permeation risk areas, outputting compensation parameters. Iterative optimization is then performed by combining the results of porous media permeation simulations, integrating deformation pre-compensation and anti-permeation structures into the same design process, thus solving the problem that a fixed shrinkage rate cannot match uneven spatial shrinkage deformation.
[0043] In the simulation and iteration phases, a lattice Boltzmann method is used to establish a seepage model. A Fourier neural operator surrogate model is employed to learn the flow field evolution in the frequency domain, replacing the traditional numerical solution process in fluid mechanics. An active learning strategy is introduced to calculate the information entropy of the seepage probability distribution matrix, triggering localized refined simulations and injecting new samples only for high-uncertainty regions, thus reducing computational resource consumption. During the model training phase, a cross-domain comparative learning mechanism is used to eliminate data distribution biases under different operating conditions. A federated learning framework combined with a homomorphic encryption algorithm aggregates data from multiple production lines to update model parameters, achieving implicit alignment of multi-source heterogeneous operating condition data while ensuring data privacy. Attached Figure Description
[0044] Figure 1 This is the overall main flowchart of the present invention;
[0045] Figure 2 This is a flowchart of the computer-aided reverse engineering process of the present invention;
[0046] Figure 3 This is a flowchart illustrating the generation process of the gradient lattice support in this invention.
[0047] Figure 4 This is a flowchart of the CGAN deformation and penetration prediction process of the present invention;
[0048] Figure 5 This is a flowchart of the porous media permeation simulation process of the present invention;
[0049] Figure 6 This is a flowchart of the iterative optimization and convergence process of this invention. Detailed Implementation
[0050] Example 1: Reference Figure 1 The process involves acquiring the 3D model, dimensional tolerance requirements, and foaming material performance parameters of the target casting, and then using computer-aided reverse design to generate an initial parametric geometric model of the foaming mold. The 3D model of the target casting is a meshed 3D model in STL format. The dimensional tolerance requirements include linear dimensional tolerances and geometric tolerances for each feature surface of the casting. The foaming material performance parameters include the density, glass transition temperature, melting temperature, anisotropic coefficient of thermal expansion, thermal conductivity, elastic modulus, Poisson's ratio, and degree of polymerization parameters of the expanded polystyrene or copolymer resin. The computer-aided reverse design, constrained by the molding accuracy requirements of the target casting, completes the pre-deformation reverse solution of the casting model based on the thermophysical properties of the foaming material, generating a parametric and controllable initial foaming mold geometric model.
[0051] The structural complexity and wall thickness distribution of the initial foaming mold are extracted. A gradient lattice support structure is generated internally using a 3D Voronoi lattice parametric design, and the lattice parameters are correlated with the foaming shrinkage rate and thermal deformation parameters. The structural complexity is quantified by the number of geometric feature surfaces per unit volume, the rate of curvature change, and the number of topological pores. The wall thickness distribution is calculated using the voxelized distance field of the 3D model of the initial foaming mold; the wall thickness value corresponding to each voxel is the minimum Euclidean distance from the center of that voxel to the two nearest opposing model surfaces. The 3D Voronoi lattice parametric design generates a seed point distribution based on the spatial geometric features of the initial foaming mold, and constructs a 3D lattice structure using the edges of Voronoi polyhedra as lattice rod units. The lattice parameters include rod diameter, relative density, porosity, and unit edge length. The correlation between the lattice parameters and the foaming shrinkage rate and thermal deformation parameters is quantified by the following formula:
[0052] The relationship between zone shrinkage rate and lattice relative density:
[0053] in, This represents the foaming shrinkage rate for the corresponding region. This represents the relative density of the lattice in that region. , , These are the characteristic coefficients of the foamed material obtained by fitting historical foaming data;
[0054] The relationship between regional thermal deformation and lattice rod diameter:
[0055] in, This represents the amount of thermal deformation in the corresponding region. The coefficient of thermal expansion of the foamed material is _____. This refers to the temperature change during the foaming process. The length of the structural feature of this region. This is the stiffness influence coefficient. The diameter of the rod in this region's lattice. This represents the maximum design value for the lattice rod diameter.
[0056] Using historical foaming deformation data, dimensional deviation data, and coating penetration defect data as training sets, a conditional generative adversarial network (GAN) is constructed. With foaming mold geometric parameters, lattice parameters, and process parameters as input conditions, the network predicts the total shrinkage deformation and coating penetration risk areas, and outputs geometric compensation correction parameters. Each sample in the training set contains an input condition vector and corresponding labels. The input condition vector includes foaming mold geometric parameters, lattice parameters, and process parameters. The foaming mold geometric parameters include wall thickness, curvature, and structural complexity; the lattice parameters include rod diameter, relative density, and porosity; and the process parameters include foaming temperature, holding time, steam pressure, coating viscosity, and number of coating passes. The labels include a three-dimensional tensor of the total shrinkage deformation and a region labeling mask for coating penetration defects. The conditional generative adversarial network includes a generator and a discriminator. The generator generates a corresponding shrinkage deformation field and a penetration probability distribution based on the input condition vector. The discriminator is used to distinguish between generated data and real sample data. The network parameters are optimized and converged through adversarial training. Finally, the network outputs geometric compensation correction parameters that match the input conditions. The geometric compensation correction parameters are the three-dimensional displacement compensation vectors of each spatial node of the initial foaming mold.
[0057] A porous media permeation simulation was performed on the corrected foamed mold. The simulation results were fed back to a conditional generative adversarial network (GAN) for iterative optimization until the convergence condition was met, at which point the final 3D design model of the foamed mold was output. The porous media permeation simulation was used to simulate the seepage process of the coating slurry on the surface of the foamed mold and within the pores of the lattice support structure, obtaining data on the coating permeation depth distribution and flow field evolution. During the iterative optimization process, the actual permeation area and deformation data obtained from the simulation were used as feedback samples to update the training set of the GAN and complete incremental training, repeating the geometric compensation correction and permeation simulation process. The convergence condition was: the maximum value of the overall dimensional deviation in two consecutive iterations was less than a preset dimensional tolerance threshold, and the maximum permeation probability in the coating permeation risk area was lower than a preset permeation probability threshold. After meeting the convergence condition, the final 3D design model of the foamed mold was output.
[0058] As a preferred embodiment, refer to the appendix. Figure 2 The computer-aided reverse design for generating the initial parametric geometric model of the foaming mold specifically includes the following processes: establishing a nonlinear mapping relationship between the geometric features of the target casting and the thermophysical properties of the foaming material; using a manifold learning algorithm to reduce the dimensionality of the high-dimensional spatial geometric features of the casting's three-dimensional model; and extracting the core topological manifold. The high-dimensional spatial geometric features are vectors. ,in The high-dimensional feature dimension includes the coordinates, normal vectors, curvature, wall thickness, and local structural complexity of each mesh vertex in the 3D model of the casting. The manifold learning algorithm employs an isometric mapping algorithm, which constructs a geodesic distance matrix in the high-dimensional feature space and then uses a multidimensional scaling algorithm to reduce the dimensionality, resulting in a low-dimensional core topological manifold. ,in , Let be the dimension of the low-dimensional manifold, and take the value . Furthermore, the original high-dimensional feature variance contribution rate is retained after dimensionality reduction.
[0059] The core topological manifold is input into a pre-constructed inverse deformation field. Combining the anisotropic thermal expansion coefficient and density distribution constraints of the foamed material, the inverse thermal deformation partial differential equation is solved through backpropagation to obtain the parameterized geometric model of the initial foaming mold. The governing equations of the inverse thermal deformation partial differential equation are:
[0060]
[0061] in, This is the inverse displacement field vector, i.e., the geometric compensation quantity to be solved. Let be the stiffness tensor of the foamed material, and be the anisotropic coefficient of thermal expansion of the foamed material. ,density Relatedly, the expression for the stiffness tensor is: , The elastic modulus of the foamed material. Poisson's ratio, For the Kronecker function, This refers to the temperature change during the foaming and molding process. It is a volume force vector, consisting of steam pressure and mold constraint reaction force during the foaming process.
[0062] The boundary conditions for solving the partial differential equation of the reverse thermal deformation are as follows: at the critical mating surfaces of the casting, the normal component of the reverse displacement field satisfies the dimensional tolerance constraints. ,in The dimensional tolerance threshold for this mating surface; the stress boundary conditions are satisfied on the free surface of the foaming mold. ,in For stress tensor, Let be the normal vector of the free surface. The above partial differential equations are solved discretically using the finite element method to obtain the total nodal displacement compensation of the initial foaming mold, thus completing the construction of the parametric geometric model of the initial foaming mold.
[0063] In the process of solving the partial differential equation of inverse thermal deformation through backpropagation, a multi-objective deep reinforcement learning strategy is introduced, with the manufacturability index of the foam mold and the structural stiffness index as reward functions. The agent of deep reinforcement learning dynamically adjusts the boundary constraint weights in the inverse deformation field in the continuous action space, and uses the Pareto optimization mechanism to find the optimal equilibrium solution between the foam shrinkage rate compensation margin and the maintenance of the topology, and outputs the initial parametric geometric model of the foam mold that satisfies the multi-objective constraints.
[0064] The deep reinforcement learning agent employs a deep deterministic policy gradient algorithm, and its continuous action space is the weight vector of each boundary constraint in the inverse deformation field. , The number of boundary constraints; the reward function is a multi-objective combined reward, including the manufacturability index of the foam mold. With structural stiffness index The specific expression is:
[0065] Manufacturability Rewards:
[0066] in, This represents the volume percentage of the supporting structure of the foaming mold. This refers to the interference amount during mold opening and closing. , These are preset weighting coefficients;
[0067] Structural stiffness bonus:
[0068] in, This represents the maximum thermal stress on the foaming mold during the foaming process. For the maximum thermal deformation, , These are the preset weighting coefficients.
[0069] The Pareto optimization mechanism employs a non-dominated sorting genetic algorithm, with the foaming shrinkage compensation margin and topology preservation as optimization objectives. The shrinkage compensation margin is the ratio of the actual compensation amount to the theoretical shrinkage deformation amount, and the topology preservation is the cosine similarity between the initial foaming mold and the core topology manifold of the target casting. During the optimization process, the topology preservation is constrained to be no less than 0.95, and finally, the parameterized geometric model of the initial foaming mold corresponding to the Pareto optimal solution is output.
[0070] As a preferred embodiment, refer to Figure 3 The process of generating a gradient lattice support structure using a three-dimensional Voronoi lattice parametric design specifically includes the following steps: converting the three-dimensional voxel mesh of the initial foaming mold into graph structure data, where nodes represent voxel centers and edges represent spatial adjacency relationships. The graph structure data is represented as follows: , where the node set , For the total number of voxels, each node For each voxel element, the node attributes include the wall thickness value corresponding to that voxel. Structural complexity Local curvature Edge set , Representative node and Spatial adjacency relationships between two voxels: when two voxels are adjacent in 3D space (faces, edges, or vertices), corresponding edges are generated. edge weight It is the reciprocal of the difference in wall thickness between the two nodes, expressed as: ,in This is a smoothing coefficient used to avoid a denominator of 0.
[0071] Structural complexity and wall thickness distribution are used as node attributes and edge weights, respectively, and input into a graph neural network. A spatial attention mechanism is then used to capture the differential influence of local structural features on foaming shrinkage. The graph neural network employs a graph attention network, and the spatial attention mechanism uses attention weights to weighted aggregate the features of neighboring nodes. The spatial attention coefficients... The calculation formula is:
[0072]
[0073] in, For nodes The initial feature vector, For a trainable weight matrix, For attention weight vectors, For feature splicing operations, It is a non-linear activation function. For nodes All adjacent nodes Normalization is performed. The embedding vector for each node is output through encoding processing using a multi-layer graph attention network. , is the dimension of the embedding vector.
[0074] Based on the node embedding vectors output by the graph neural network, a three-dimensional Voronoi seed point distribution is adaptively generated using a spatial clustering algorithm to construct a three-dimensional Voronoi lattice support structure in which the rod diameter and relative density exhibit gradient changes. The spatial clustering algorithm employs a density peak clustering algorithm, specifically: calculating the local density of each node embedding vector. With distance The local density The distance is the number of nodes in the neighborhood of a given node whose embedded vector cosine similarity is greater than a preset threshold. To find the minimum Euclidean distance from this node to a node with higher local density, select... and Nodes whose values all exceed a preset threshold are used as 3D Voronoi seed points. A 3D Voronoi polyhedron is constructed based on the generated seed points. The edges of the Voronoi polyhedron are used as rod elements of the lattice to construct a 3D Voronoi lattice support structure. The rod diameter is positively correlated with the wall thickness of the corresponding region, expressed as: , This is the minimum rod diameter. , These represent the minimum and maximum wall thicknesses of the initial foaming mold, respectively; the lattice relative density is proportional to the square of the rod diameter, expressed as follows: ,in Let be the average side length of the Voronoi element. is the shape factor of the rod-shaped structure, with a value of 3.2.
[0075] The node embedding vectors output by the graph neural network are mapped to the initial population of the adaptive differential evolution algorithm, with the objective function being to minimize the local thermal stress concentration during the foaming process. In the crossover and mutation operations of the adaptive differential evolution algorithm, the physical phase transition kinetic equation of the polymer material is coupled, and the scaling factor of the lattice rod diameter and the node connectivity topology are dynamically adjusted according to the temperature gradient in different regions, driving the population to evolve to the optimal configuration for preventing thermal deformation, thus generating the final gradient lattice support structure.
[0076] The adaptive differential evolution algorithm employs an adaptive differential evolution framework, where each individual in the population represents a set of Voronoi seed point coordinates, stem diameter parameters, and node connectivity parameters. The objective function is expressed as follows:
[0077] in, The local thermal stress of each lattice element, The total volume of the lattice structure. This is the volume penalty coefficient.
[0078] The physical phase transition kinetic equation for the polymer material adopts the Avrami equation, and its expression is:
[0079]
[0080] in, for The crystallization conversion rate of the foaming material at all times. The crystallization rate constant is The Avrami index is related to the nucleation and growth mechanism of the foamed material. During the algorithm iteration process, it is adjusted based on the temperature gradient in different regions. Dynamically adjust the scaling factor of the dot matrix rod diameter The expression is ,in The initial scaling factor. This is the temperature influence coefficient. To determine the maximum temperature gradient during the foaming process, the node connectivity topology is adjusted synchronously to ultimately generate a gradient lattice support structure with optimal thermal deformation resistance.
[0081] As a preferred embodiment, refer to Figure 4 The conditional generative adversarial network predicts the total shrinkage deformation and coating penetration risk area, specifically including the following process: A spatiotemporal graph convolutional network and Transformer architecture are introduced into the generator to convert the geometric parameters, lattice parameters, and process parameters of the foaming mold into a spatiotemporal feature sequence. The construction process of the spatiotemporal feature sequence is as follows: the three-dimensional model of the foaming mold is discretized into a spatiotemporal graph structure. The spatial dimension is the nodes and edges of the graph, corresponding to the geometric topology of the three-dimensional space of the foaming mold. The temporal dimension is multiple time steps of the foaming process, including four stages: preheating, foaming, heat preservation, and cooling. Each time step corresponds to a set of process parameters and physical field states, ultimately generating the spatiotemporal feature sequence. ,in For the number of time steps, The number of spatial nodes. The feature dimensions for each node.
[0082] A spatiotemporal graph convolutional network is used to extract the local physical field evolution features of the 3D spatial geometric topology, and a Transformer architecture is used to capture the global dependencies of the physical field in the temporal dimension under different combinations of process parameters. The spatiotemporal graph convolutional network includes spatial graph convolutional layers and temporal convolutional layers. The calculation formula for the spatial graph convolutional layer is as follows:
[0083]
[0084] in, For the first The input features of the layer The adjacency matrix of the spatiotemporal graph. Adjacency matrix The degree matrix, The weight matrix is trainable; the temporal convolutional layer uses one-dimensional causal convolution with a kernel size of [value missing]. Convolution operations are performed on the time dimension to capture the physical field change characteristics of adjacent time steps.
[0085] The Transformer architecture includes multiple encoder layers, each consisting of a multi-head self-attention layer and a feedforward neural network. The core calculation formula for the multi-head self-attention layer is:
[0086]
[0087] in, , , These are the query matrix, key matrix, and value matrix, respectively, obtained from the input features through a linear transformation. Let be the dimension of the key matrix. Multi-head self-attention concatenates and linearly transforms the outputs of multiple independent self-attention heads, capturing the global features of global dependencies in the time dimension.
[0088] A fusion layer concatenates and linearly transforms the local features output by the spatiotemporal graph convolutional network with the global features output by the Transformer architecture, generating a full-area shrinkage deformation field tensor and a coating penetration probability distribution matrix aligned with the input conditions. The shrinkage deformation field tensor is... ,in The number of spatial nodes, 3 is , , The deformation in three spatial directions; the coating penetration probability distribution matrix is as follows: Each element represents the coating penetration probability for that node region.
[0089] The training process of the conditional generative adversarial network also includes: to address the data distribution deviation problem caused by equipment replacement or environmental drift in historical batch data, a cross-domain contrastive learning mechanism is introduced into the discriminator of the conditional generative adversarial network; deformation data of the same foaming mold geometric parameters under different working conditions are used as positive sample pairs, and deformation data of different geometric parameters are used as negative sample pairs. By maximizing the similarity of positive sample pairs in the latent feature space and widening the distance of negative sample pairs, the interference of working condition distribution differences on the prediction results is eliminated, and the generalization ability of the conditional generative adversarial network in cross-working condition scenarios is improved.
[0090] The source domain of the cross-domain contrastive learning mechanism is a dataset under historical standard operating conditions, and the target domain is a new operating condition dataset after equipment replacement or environmental drift. InfoNCE loss is used as the contrastive loss function, and its expression is:
[0091]
[0092] in, For the sample The latent feature vectors, These are the latent feature vectors of positive samples. These are the latent feature vectors of negative samples. The cosine similarity function is used. The temperature coefficient is used. During training, the feature space distribution is aligned by minimizing the contrastive loss function, thus eliminating the distribution shift caused by differences in operating conditions.
[0093] The construction and training process of the cross-domain comparative learning mechanism also includes: using a federated learning framework to aggregate historical batch data from different lost foam casting production lines, and using the cross-domain comparative learning mechanism to extract local working condition feature representations on each production line; in the global aggregation stage of federated learning, a homomorphic encryption algorithm is introduced to encrypt the model gradient of the local working condition feature representation, and implicit alignment and sharing of multi-source heterogeneous working condition data are achieved without distributing the original foaming mold design parameters and defect data of each production line, thereby completing the global model parameter update of the conditional generative adversarial network.
[0094] The federated learning framework is a horizontal federated learning framework. Each lost foam casting production line is a local client. Each client completes model training and cross-domain comparative feature extraction locally, and only uploads model gradient data. The homomorphic encryption algorithm adopts the Paillier homomorphic encryption algorithm. After the client encrypts the local model gradient, it uploads it to the global server. The server performs weighted average aggregation of the gradients of each client in the encrypted state to obtain the global model parameters. Then, the encrypted global model parameters are sent to each client. After the client decrypts, it updates the local model parameters and completes one round of global training.
[0095] As a preferred embodiment, refer to Figure 5 The simulation of porous media permeation on the modified foamed mold specifically includes the following steps: A porous media permeation dynamics model of the coating on the surface of the foamed mold is established based on the lattice Boltzmann method, and the gradient parameters of the lattice support structure are set as permeation boundary conditions. The lattice Boltzmann model adopts the D3Q19 three-dimensional lattice Boltzmann model, and the evolution equation of the distribution function is:
[0096]
[0097] in, for The particle distribution function in the direction, For spatial location, for Discrete velocity vectors in direction, For time step, The dimensionless relaxation time is related to the kinematic viscosity of the coating slurry. Relevant, satisfy , Let be the equilibrium distribution function. This is a volumetric force term, driven by the osmotic pressure gradient. The seepage boundary conditions are as follows: a rebound boundary condition is used at the solid-liquid interface of the lattice support structure; a pressure inlet boundary is set on the coating surface; and a pressure outlet boundary is set inside the foaming mold. The gradient parameters of the lattice support structure include porosity, rod diameter, and specific surface area, which are used to define the pore space distribution of the porous medium.
[0098] A Fourier neural operator surrogate model is introduced to replace the traditional numerical solution process in fluid mechanics, enabling the learning of flow field evolution under different lattice configurations and osmotic pressure boundaries in the frequency domain. The core of the Fourier neural operator is the Fourier layer, and the calculation formula for the Fourier layer is as follows:
[0099]
[0100] in, For the first The input features of the layer Let be the weight matrix of the spatial convolution. This is a Fourier transform operation. This is the inverse Fourier transform operation. For trainable convolutional kernels in the frequency domain, The activation function is nonlinear. The Fourier neural operator surrogate model takes lattice configuration parameters, permeation pressure boundary conditions, and coating viscosity parameters as inputs, and outputs the coating penetration depth distribution field. With velocity vector field , This represents the number of nodes in the spatial grid.
[0101] The coating penetration depth distribution field and velocity vector field output by the Fourier neural operator proxy model are fed back to the conditional generative adversarial network as simulation results.
[0102] refer to Figure 6 The step of feeding the simulation results back to the conditional generative adversarial network for iterative optimization includes: embedding an active learning strategy during the iterative optimization process to calculate the information entropy of the current coating permeation probability distribution matrix; when the information entropy is higher than a preset uncertainty threshold, actively selecting the local geometric region with the highest entropy value as a key feedback node, triggering the Fourier neural operator proxy model to perform local refined porous media permeation simulation only for the key feedback node, and injecting the local simulation results as new samples into the conditional generative adversarial network to minimize the computational resource consumption in the overall iterative process.
[0103] The formula for calculating the information entropy of the coating penetration probability distribution matrix is:
[0104]
[0105] in, For the first The coating penetration probability at each node, for or The node has an information entropy of 0. A preset uncertainty threshold is set. When global information entropy Higher than When, select the first one with the highest entropy value. A local geometric region is used as a key feedback node. Local fine-grained simulation is performed on this region. The mesh resolution of the local simulation is 4-8 times that of the global simulation. The penetration depth distribution and penetration region labeling obtained from the local simulation are used as new samples and injected into the training set of the conditional generative adversarial network to complete the incremental training of the network.
[0106] The convergence condition for iterative optimization is as follows: the mean square error between the predicted and simulated values of the full-area shrinkage deformation in two consecutive iterations is less than a preset deformation convergence threshold, and the maximum penetration depth in the coating penetration risk area is less than a preset penetration depth threshold. Once the convergence condition is met, the iteration stops, and the final 3D design model of the foaming mold is output.
Claims
1. A casting design optimization method based on lost foam casting, characterized in that, include: Obtain the three-dimensional model, dimensional tolerance requirements, and foaming material performance parameters of the target casting, and generate the initial parametric geometric model of the foaming mold through computer-aided reverse design; The structural complexity and wall thickness distribution of the initial foaming mold are extracted. A gradient lattice support structure is generated inside using three-dimensional Voronoi lattice parameterization design. The lattice parameters are then correlated with the foaming shrinkage rate and thermal deformation parameters. Using historical foaming deformation data, dimensional deviation data, and coating penetration defect data as training sets, a conditional generative adversarial network is constructed. With foaming mold geometric parameters, lattice parameters, and process parameters as conditional inputs, the network predicts the shrinkage deformation amount and coating penetration risk area of the entire region and outputs geometric compensation correction parameters. The modified foaming mold is subjected to porous media permeation simulation. The simulation results are fed back to the conditional generative adversarial network for iterative optimization until the convergence condition is met, and the final three-dimensional design model of the foaming mold is output.
2. The method according to claim 1, characterized in that, Computer-aided reverse engineering to generate the initial parametric geometric model of the foaming mold includes: A nonlinear mapping relationship between the geometric features of the target casting and the thermophysical properties of the foaming material is established. A manifold learning algorithm is used to reduce the dimensionality of the high-dimensional spatial geometric features of the three-dimensional model of the casting and extract the core topological manifold. The core topological manifold is input into a pre-constructed inverse deformation field. By combining the anisotropic thermal expansion coefficient and density distribution constraints of the foamed material, the inverse thermal deformation partial differential equation is solved through backpropagation, and the parameterized geometric model of the initial foaming mold is calculated.
3. The method according to claim 1, characterized in that, The generation of gradient lattice support structures using parametric design of a 3D Voronoi lattice includes: The three-dimensional voxel mesh of the initial foaming mold is transformed into graph structure data, where nodes represent voxel centers and edges represent spatial adjacency relationships. Structural complexity and wall thickness distribution are used as node attributes and edge weights, respectively, and input into a graph neural network. The spatial attention mechanism is used to capture the differential effects of local structural features on foaming shrinkage. Based on the node embedding vectors output by the graph neural network, a three-dimensional Voronoi seed point distribution is adaptively generated through a spatial clustering algorithm to construct a three-dimensional Voronoi lattice support structure in which the rod diameter and relative density vary with gradient.
4. The method according to claim 1, characterized in that, Conditional generative adversarial networks predict the total shrinkage deformation and coating penetration risk areas, including: A spatiotemporal graph convolutional network and Transformer architecture are introduced into the generator to convert the geometric parameters, lattice parameters and process parameters of the foaming mold into spatiotemporal feature sequences. Spatiotemporal graph convolutional networks are used to extract local physical field evolution features of three-dimensional spatial geometric topology, and the Transformer architecture is used to capture the global dependence of physical fields in the time dimension under different combinations of process parameters. By fusing local and global features, a full-area shrinkage deformation field tensor and a coating penetration probability distribution matrix aligned with the input conditions are generated.
5. The method according to claim 1, characterized in that, The simulation of porous media permeation of the modified foaming mold includes: A porous media seepage dynamics model of coating on foam mold surface is established based on lattice Boltzmann method, and the gradient parameters of lattice support structure are set as seepage boundary conditions. A Fourier neural operator surrogate model is introduced to replace the traditional numerical solution process of fluid mechanics, and the flow field evolution law under different lattice configurations and seepage pressure boundaries is learned in the frequency domain. The coating penetration depth distribution field and velocity vector field output by the Fourier neural operator proxy model are fed back to the conditional generative adversarial network as simulation results.
6. The method according to claim 2, characterized in that, The parameterized geometric model of the initial foaming mold also includes: In the process of backpropagation to solve the partial differential equation of inverse thermal deformation, a multi-objective deep reinforcement learning strategy is introduced, with the manufacturability index of foaming mold and the structural stiffness index as reward functions. The agent, which uses deep reinforcement learning, dynamically adjusts the boundary constraint weights in the inverse deformation field in the continuous action space. It uses the Pareto optimization mechanism to find the optimal equilibrium solution between the foaming shrinkage rate compensation margin and the preservation of the topology, and outputs the initial foaming mold parameterized geometric model that satisfies the multi-objective constraints.
7. The method according to claim 3, characterized in that, Constructing a three-dimensional Voronoi lattice support structure with a gradient between rod diameter and relative density also includes: The node embedding vectors output by the graph neural network are mapped to the initial population of the adaptive differential evolution algorithm, with the objective function being to minimize the local thermal stress concentration during the foaming process. In the crossover and mutation operations of the adaptive differential evolution algorithm, the physical phase transition dynamics equation of polymer materials is coupled, and the scaling factor of the lattice rod diameter and the node connectivity topology are dynamically adjusted according to the temperature gradient of different regions, driving the population to evolve to the optimal configuration for heat deformation prevention, and generating the final gradient lattice support structure.
8. The method according to claim 4, characterized in that, The training process for conditional generative adversarial networks also includes: To address the issue of data distribution deviation in historical batch data caused by equipment replacement or environmental drift, a cross-domain contrastive learning mechanism is introduced into the discriminator of the conditional generative adversarial network. Deformation data of the same foaming mold with the same geometric parameters under different working conditions are used as positive sample pairs, and deformation data with different geometric parameters are used as negative sample pairs. The similarity of positive sample pairs in the latent feature space is maximized and the distance between negative sample pairs is increased.
9. The method according to claim 5, characterized in that, Feeding simulation results back to the conditional generative adversarial network for iterative optimization includes: An active learning strategy is embedded during the iterative optimization process to calculate the information entropy of the current coating penetration probability distribution matrix. When the information entropy is higher than the preset uncertainty threshold, the local geometric region with the highest entropy value is actively selected as the key feedback node. The Fourier neural operator proxy model is triggered only for the key feedback node to perform local refined porous media permeation simulation. The local simulation results are injected into the conditional generative adversarial network as new samples to minimize the consumption of computing resources in the overall iteration process.
10. The method according to claim 8, characterized in that, The construction and training process of the cross-domain contrastive learning mechanism also includes: A federated learning framework is used to aggregate historical batch data from different lost foam casting production lines, and a cross-domain comparative learning mechanism is used to extract local operating condition feature representations on each production line. In the global aggregation phase of federated learning, a homomorphic encryption algorithm is introduced to encrypt the model gradients representing local working condition features.