Time Dependant GeometryFromEdges in PDE thermal analysis

3 visualizzazioni (ultimi 30 giorni)
I am trying to understand if it is possible to have a time dependant geometry in PDE thermal analysis. I am modelling the combustion of a rocket motor solid grain, and the inside diameter gets larger and larger with respect to time.
% Modélisation du casing
% On cherche a démontrer la régression du grain
EmptyRegion = @(~,state) 0.0254 + reg*state.time;
Grainthk = @(~,state) OR - reg*state.time;
% [3,4,x1,x2,x3,x4,y1,y2,y3,y4]
Grain = [3,4,EmptyRegion,OR,OR,EmptyRegion,0,0,L,L];
Liner = [3,4,OR,OR + linerthk,OR + linerthk,OR,0,0,L,L]';
gm = [Grain Liner];
ns = char('Grain + Liner');
g = decsg(gm, 'Grain', 'Liner',ns');
I have decided to model the inside edge getting farther and farther away from the center line (EmptyRegion). When I try to implement it in the Geometry, I receive the follwing error message.
  • Error using horzcat
  • The following error occurred converting from double to function_handle:
  • Too many output arguments.
I was wondering if you could help me figure out a time-dependant geometry or if its even a possibility.
Thank you!

Risposte (1)

Aditya
Aditya il 25 Gen 2024
Hi Jean,
I understand that you want to know if time dependant geometry is possible for PDE thermal analysis.
In MATLAB, using the Partial Differential Equation Toolbox for thermal analysis with time-dependent geometries can be quite complex, as the toolbox is generally designed for static geometries. However, there are some workarounds that you might consider to simulate a changing geometry, such as updating the geometry at each time step or using a level set method to represent the evolving boundary.
The error you're encountering is because the decsg function expects specific input formats, and it seems you're trying to concatenate function handles with numeric values, which is not allowed.
Here's a conceptual outline of how you might approach modeling a time-dependent geometry for your problem:
In MATLAB, using the Partial Differential Equation Toolbox for thermal analysis with time-dependent geometries can be quite complex, as the toolbox is generally designed for static geometries. However, there are some workarounds that you might consider to simulate a changing geometry, such as updating the geometry at each time step or using a level set method to represent the evolving boundary.
The error you're encountering is because the decsg function expects specific input formats, and it seems you're trying to concatenate function handles with numeric values, which is not allowed.
Here's how you might approach modeling a time-dependent geometry for your problem:
  1. Discretize the Time Domain: Break your simulation into discrete time steps, and for each time step, define a new geometry that represents the state of your rocket motor solid grain at that point in time.
  2. Update Geometry at Each Time Step: For each time step, you'll need to create a new geometry in MATLAB that represents the current state of the grain. This may involve creating a new geometry matrix and calling decsg at each time step.
  3. Solve PDE for Each Time Step: After updating the geometry, solve the PDE for the current time step. Store the results and then move on to the next time step.
  4. Interpolate or Map Results: If necessary, interpolate or map the results from the previous time step onto the new mesh for the next time step.
Here's a very high-level pseudocode outline to give you an idea of how the loop structure might look:
% Define initial geometry
initialGeometry = [...]; % Define your initial geometry matrix here
% Define time steps
timeSteps = linspace(0, finalTime, numberOfTimeSteps);
% Initial state
state = initialState;
% Loop over each time step
for i = 1:length(timeSteps)
currentTime = timeSteps(i);
% Update geometry based on current time
updatedGeometry = updateGeometry(initialGeometry, currentTime);
% Create the geometry using decsg
[g, ~, ~] = decsg(updatedGeometry);
% Create PDE model for the current geometry
model = createpde();
geometryFromEdges(model, g);
% Solve the PDE for the current time step
result = solvepde(model);
end
The function updateGeometry is a placeholder for your actual implementation, which would modify the geometry matrix based on the current time to represent the regression of the grain.
Hope this helps.

Prodotti


Release

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by