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.

changing Geometry by modifying MPHTXT file

Please login with a confirmed email address before reporting spam

Hi,
I am working on a 2-D ALE model. at a special time step I want to stop the model, change my boundary situation and then continue to run the model. The change I want to made is merging 3 adjacent boundary lines to each other and apply a special boundary condition to the resulted boundary line.
It 's important for me to have a single boundary line instead of three in my new geometry then I can continue my modeling using this new geometry.
I decided to create the new geometry by changing the MPHTXT file of the last geometry. So I terminate the model at a special time step, export analyzed geometry to an MPHTXT file and now I am trying to understand and change this file.
My plan is finding the coordinates and parameter values of three boundary lines among other Manifolds in the MPHTXT file and replace all three with a single manifold. the coordinates of this single manifold would be a combination of the coordinates of the three boundary lines, But I don't have any idea about the way that I should calculate the curve parameters at each point for the new manifold.
According to the MPHTXT file for each point of a manifold I should define three different values: x coordinate, y coordinate and parameter (curve parameter). curve parameter is a value between 0 to 1 in my 2 D modeling.
My question is How I should calculate the curve parameter at each point when I have the coordinates of that point?
Is it possible to change boundary situation and geometry by changing the MPHTXT file or there is a better way?
Thanks,
Atieh

2 Replies Last Post 22 janv. 2010, 19:45 UTC−5
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 19 janv. 2010, 14:26 UTC−5
Hi

I can understand yourt approach, but I'm not sure it will solve everything for you (furthermore its rather complex to learn the details of those files just like that, personally have given that up, but you might be more perseverant than me ;)

Now, I can only warn you about another issue when you change you topology, this means other (new or fewer) boundaries, hence boundary reordering and renumbering, and you must ensure that your Boundary Conditions remain on the correct physical boundaries even after a renumbering. This is not trivial. And Comsol cannot really guess for you.

I would rather consider to stop the model close to the dissaperance of a geometrical part and then correct the geoemtry by hand, recheck all BCs and then relaunch the simulation. But I do also understand that this is not so "nice" and demands some work each time you run.

I cannot propose anything better, but other out here might have some ideas, interesting issue anyhow:
how to deal with topology changes ?

Good luck
Ivar
Hi I can understand yourt approach, but I'm not sure it will solve everything for you (furthermore its rather complex to learn the details of those files just like that, personally have given that up, but you might be more perseverant than me ;) Now, I can only warn you about another issue when you change you topology, this means other (new or fewer) boundaries, hence boundary reordering and renumbering, and you must ensure that your Boundary Conditions remain on the correct physical boundaries even after a renumbering. This is not trivial. And Comsol cannot really guess for you. I would rather consider to stop the model close to the dissaperance of a geometrical part and then correct the geoemtry by hand, recheck all BCs and then relaunch the simulation. But I do also understand that this is not so "nice" and demands some work each time you run. I cannot propose anything better, but other out here might have some ideas, interesting issue anyhow: how to deal with topology changes ? Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 22 janv. 2010, 19:45 UTC−5
Hi Ivar;

Thanks for your answer. I agree that the easier way is manually making changes. But I confused because I don't really know how I can apply these changes manually. Recently I understood that the changes I want are related to the boundary mode not the geometry.
as you know my problem is I have a topological change in my domain. One of the boundaries in the domain shrinks gradually to a point and after that it should diminish completely from my geometry.
I stop the model close to the disappearance of the shrinking boundary. then I try to modify my model and get rid of the that boundary manually. I tried two different ways but none of them was successful:
1) I decided to merge the shrinking boundary with its two adjacent curved boundaries and then apply a same boundary condition for all of them. In geometry mode I could easily merge these three boundaries using coerce to curve command but it didn't have any effect in the boundary mode. In this mode again I had 3 different boundaries and I should apply different boundary conditions for them. It seems that merging boundary lines in the boundary mode is impossible. Am I correct?
2) Then I decided to delete the shrinking boundary (boundary 9) manually and attach its two adjacent curved boundaries (boundaries 17 and 18) to each other to make a closed region. for attaching these two boundaries to each other I wrote a COMSOL script. In this script I used the modified coordinates of boundaries 17 and 18 and the "geomspline" function as follow:

p=[% modified coordinates of boundaries 17 and 18%];
c=geomspline(p,'SplineMethod','foley','closed','off');

Again the geometry mode seemed correct. The shrinking boundary was deleted and its adjacent boundaries were attached to each other but in the boundary mode "geomspline" produced a bunch of small boundaries instead of boundaries 17 and 18. what is wrong with geomspline command? should I use another command?
I need to delete boundary 9 and then close the region by attaching boundaries 17 and 18 to each other. In the other hand I should substitute three boundaries with two. what is the best way to do this?

Thanks
Atieh
Hi Ivar; Thanks for your answer. I agree that the easier way is manually making changes. But I confused because I don't really know how I can apply these changes manually. Recently I understood that the changes I want are related to the boundary mode not the geometry. as you know my problem is I have a topological change in my domain. One of the boundaries in the domain shrinks gradually to a point and after that it should diminish completely from my geometry. I stop the model close to the disappearance of the shrinking boundary. then I try to modify my model and get rid of the that boundary manually. I tried two different ways but none of them was successful: 1) I decided to merge the shrinking boundary with its two adjacent curved boundaries and then apply a same boundary condition for all of them. In geometry mode I could easily merge these three boundaries using coerce to curve command but it didn't have any effect in the boundary mode. In this mode again I had 3 different boundaries and I should apply different boundary conditions for them. It seems that merging boundary lines in the boundary mode is impossible. Am I correct? 2) Then I decided to delete the shrinking boundary (boundary 9) manually and attach its two adjacent curved boundaries (boundaries 17 and 18) to each other to make a closed region. for attaching these two boundaries to each other I wrote a COMSOL script. In this script I used the modified coordinates of boundaries 17 and 18 and the "geomspline" function as follow: p=[% modified coordinates of boundaries 17 and 18%]; c=geomspline(p,'SplineMethod','foley','closed','off'); Again the geometry mode seemed correct. The shrinking boundary was deleted and its adjacent boundaries were attached to each other but in the boundary mode "geomspline" produced a bunch of small boundaries instead of boundaries 17 and 18. what is wrong with geomspline command? should I use another command? I need to delete boundary 9 and then close the region by attaching boundaries 17 and 18 to each other. In the other hand I should substitute three boundaries with two. what is the best way to do this? Thanks Atieh

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.