Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.
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.
Boundary Condition, mesh, nodes
Posted 30 ago 2011, 06:56 GMT-4 Version 4.2 8 Replies
Please login with a confirmed email address before reporting spam
Suppose if I have a geometry, circular for example, with triangular mesh and I apply a boundary condition. Lets say that this is a magnetic field problem. Can I then access the nodal values(for e.g. the value of magnetic vector potential at a given node/nodes) at any given time? Can I change the value? How can the nodes be accessed??
Help needed urgently!
Regards,
Bishal
Please login with a confirmed email address before reporting spam
in COMSOL you do not access the "mesh elements nor the nodes" as in other or older software. Physics are applied to domains and boundaries, and the results are retrieved there from too, read carefully the doc
--
Good luck
Ivar
Please login with a confirmed email address before reporting spam
you can access the nodal values of any dependent variable via Matlab. I don't now how to do it in Comsol 4.2, but in Comsol 3.5a, if I well remember, you can get the nodal coordinates by means of the get (fem.mesh,'p') command and then with the postinter function you obtain the desired values.
Summarizing:
node=get(fem.mesh,'p');
dvar=postinterp(fem,'variable',node);
where "fem" is the data structure while "variable" is the dependent variable you are looking for.
Hope this help!
Regards
Pasquale
Please login with a confirmed email address before reporting spam
thank you so much for your help. I found that there is another corresponding command to 'postinterp' in COMSOL 4.2 version. I scripted in MATLAB and it worked. The new command in 'mphinterp'.
Thanks again.
And one more thing, do you know if we can change those values??'
Regards
Please login with a confirmed email address before reporting spam
sorry for replying so late!
Really, I do not understand why you need to manually modify the values of some dependent variables. Anyway, in comsol 3.5a it was possible to use the "femsol" command. In comsol 4.2 I have no idea!
Pasquale
Please login with a confirmed email address before reporting spam
I am sorry for replying late because I did not get the notification of your reply due to some problem in my email. I hope it is fixed now.
Actually, I have been working in a project that deals with the study of eddy currents in a solid rotor. For that purpose, I need to compute the magnetic vector potential in the air gap of the machine. For this, I am using an in-house 2D simulation software of our lab. The computed vector potential is then used as a source for a 3D model of the rotor. I am intended to do the 3D simulation in Comsol software.
I have the results of 2D simulation, the computed magnetic vector potential, in each nodes of the mesh. Now, for the 3D model, I want to first create an identical mesh (same as the 2D mesh) in Comsol and then extrude it to make a 3D model.
Now, the main problem is that I am not being able to transfer the 2D datas into Comsol. I am not being able to create an identical mesh as 2D in Comsol (by identical I mean, there are same number of elements and nodes and the value of magnetic vector potential is also same in all the node).
For this purpose I wanted to check if we could change the nodal values so that I can input my 2D solution into Comsol. I am not sure if this idea works, but I wanted to try.
Can you please help me by suggesting any other way through which I can make such input to the Comsol software. I would be very obliged to have your valuable suggestions.
Thank you in advance.
Please login with a confirmed email address before reporting spam
well, now your project is clear to me. I think you may operate by defining an interpolation function.
More specifically:
1. export from your home-made software the potential vector at nodal points. Format data into a csv ascii file containing the node coordinates and the solution;
2. into comsol define an interpolation function (under definition>function>interpolation). See the user guide for more information on how to work with this feature,
3. finally, having your "analytic" function, say z=f(x,y), you can set such a function as a source on your domain.
I hope this work.
Please let me know!
Good luck
Pasquale
Please login with a confirmed email address before reporting spam
thank you.. I'll try this one and then tell yu if it works or not!
Regards
Please login with a confirmed email address before reporting spam
I have the interpolated the solution that I got from my in-house software in Comsol. But I don't understand how to use that interpolation function as a source on my domain.
Can you please elaborate a little on that. Since, I am a beginner in Comsol I need some help.
Regards
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.
Suggested Content
- KNOWLEDGE BASE What Does Degrees of Freedom (DOFs) Mean in COMSOL Multiphysics?
- KNOWLEDGE BASE The Usage of Form Union and Form Assembly
- FORUM Mesh nodes at rotating boundary not aligning
- BLOG Using Discontinuous Meshes for Conjugate Heat Transfer Modeling
- KNOWLEDGE BASE My Flux Calculation Seems Wrong