Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.
integrating a scalar field in one direction
Posted 22.09.2015, 05:12 GMT-4 Heat Transfer & Phase Change, LiveLink for MATLAB, Materials, Structural Mechanics Version 5.1 7 Replies
Please login with a confirmed email address before reporting spam
How can i accomplish this?
I played around with the derived values but nothing is satisfactory. the volume average gives the average temperature of the plate (scalar).
Please login with a confirmed email address before reporting spam
www.comsol.com/blogs/analyze-simulation-results-projection-operators/
Dan
Please login with a confirmed email address before reporting spam
Please login with a confirmed email address before reporting spam
I made a General projection node
in the source map in defined the following
x-expression: x
y-expression: y
z-expression: T
for the destination map in used the default values
x-expression: x
y-expression: y
the average temperature was plotted with a 2D plot group - Surface
for the expression i used genproj1(T)/length
the length is necessary to get the correct units of Kelvin[K] instead of m*K
Please login with a confirmed email address before reporting spam
Dan
Please login with a confirmed email address before reporting spam
i got the following error message
Projection coupling not supported for this mesh type.
- Mesh element type: prism
- Plot: surf1 (Surface)
I use a free triangular mesh in combination with swept. i recon that the prism are created in that step.
although the Face meshing method is set to Quadrilateral (generate hexahedrons).
What is the correct way to use the projection method with the prism elements?
Please login with a confirmed email address before reporting spam
It's true that COMSOL does not allow all combinations mesh and projection operators.
The only way I know is to use a "Convert" Domain to convert your swept structured mesh into tetrahedrals. But you get many elements like that ;)
There are often passionate discussions about mesh type and an old "habit" of stating that structured mesh is "better" than simple tetrahedral. I believe this comes from the "old" days when physics and mesh where embedded such that one could not distinguish one from the other, the higher order elements at that time and for some classical software today were more precise.
Mostly these people have not understood the COMSOL way: simple mesh to section the domains and boundaries into reasonable elements, w.r.t. the requirement coming from the equations to be solved; and then higher order "discretization" on these "simple" mesh elements.
Structured mesh has some advantages when one can reasonably use anisotropic mesh sizes, because the model suits it, but "tetrahedral" mesh are far better "in general cases" they distribute better the average error made when combining the solution over the mesh elements.
I believe it's linked to the fact that relative errors grow large when one take differences between two binary coded numbers almost similar, this is what happens with structured mesh, well aligned, but with free tets we are closer to the ideal alternating arrangement of random numbers, and differences of the resulting dependent variables between the elements are larger. And finally the FEM method boils down to series of differences and sums thereof
--
Good luck
Ivar
Please login with a confirmed email address before reporting spam
i solved it by using the matlab livelink.
using the mphinterp command to sample the temperature at a regular matrix
then applying a mean to that matrix. this circumvents the prism element limitation.
dimensions of the plate being h_plate w_plate t_plate
%% evaluating a grid of points
x_eval = linspace(0,w_plate,1e2);
y_eval = linspace(0,h_plate,1e2);
z_eval = linspace(0,t_plate,20);
[x,y,z] = meshgrid(x_eval,y_eval,z_eval);
list_xyz = [x(:),y(:),z(:)]';
%% evaluating the model
T_mesh = mphinterp(model,'T','coord',list_xyz);
T_mesh = reshape(T_mesh,length(x_eval),length(y_eval),length(z_eval));
%% mean temp in z direction
T_avg_z = mean(T_mesh,3);
%% plotting the temp
figure
surf (T_avg_z);
shading interp;
colorbar
Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.