IBAMR CAD Transfer

234 views
Skip to first unread message

Ahmad

unread,
Feb 21, 2021, 4:28:25 PM2/21/21
to IBAMR Users
Hi,

I am new in IBAMR and I would like to know how to extract the model from ANSYS or Solidworks to IBAMR? Also, how do I run the uniform and daptive mesh? Do you have a startup step by step to follow?

Last, how do I know what example to use in IBAMR: IB etc.? Is their a guide of what each example mean and when to use and for what?

Thanks,
Ahmad

Keerthi Anand

unread,
Mar 3, 2021, 11:20:42 AM3/3/21
to IBAMR Users
I am also interested in this!

Ahmad

unread,
Mar 25, 2021, 3:23:04 PM3/25/21
to IBAMR Users
Hi professor,

I am following up on my previous question:

Can I import an STL CAD file or STEP file or others to IBFE Ex5 or other examples in IBAMR? From what I understand is that I need to open the c++ file and change the geometry I like to change but I would like to import the STL or Step CAD instead of changing the geometry in the C++ file, can I do that? How?

My geometry is a 3D nozzle and am trying to run a velocity for the internal blood flow of the nozzle or cylinder. Its non-Newtonian. Which IBAMR example do you recommend to use? Which example accept to import the STL/ Step CAD file? 

Also, lets say, I cant import an STL 3D CAD file into IBAMR/IBFE ex5 , then I need to change the geometry in the C++ file, can you please direct me how to change the geometry related to my 3D Nozzle design? 

I appreciate your help!
Thanks!
Ahmad

Boyce Griffith

unread,
Mar 27, 2021, 12:16:55 AM3/27/21
to ibamr...@googlegroups.com
Ahmad —

What kind of non-Newtonian fluid model do you want to use? Most of our work on non-Newtonian fluid models has been focused on polymeric fluids. IBAMR also has incompressible Navier-Stokes solvers that work with variable viscosities, but I don’t think that they have been used for generalized Newtonian fluid models (e.g. with shear-dependent viscosities).

As far as the geometry goes — IBAMR’s support for unstructured meshes relies on libMesh (http://libmesh.github.io/). If you want to use a mesh-based geometry, then you will need a mesh that libMesh can read in. libmesh.github.io provides a list of supported file formats; see: http://libmesh.github.io/doxygen/index.html.

If you have a mesh that libMesh can read, all you need to do to import the mesh is something like:

        Mesh mesh(init.comm(), NDIM);
mesh.read("mesh-filename");

In the current IBAMR release, I would recommend using a volumetric structural mesh with IBFEMethod. This approach lets you handle both rigid and elastic structures. See, e.g., https://link.springer.com/article/10.1007%2Fs10439-020-02466-4 for an example that includes both in the same model.

We also have been developing support for the immersed interface method in IBAMR. This method seems to allow us to do a good job with surface meshes; see, e.g., https://arxiv.org/abs/1812.06840 and https://arxiv.org/abs/2003.12046. This code is in a separate branch, but we are aiming to get it merged into the main branch relatively soon. Because of the way that the immersed interface coupling scheme works, the current implementation may break if you have a surface mesh with very small elements. This code also is currently specialized to constant-coefficient incompressible Navier-Stokes equations. It would need to be extended to treat non-Newtonian fluid models.

— Boyce

-- 
You received this message because you are subscribed to the Google Groups "IBAMR Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibamr-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ibamr-users/576389f5-fd74-42fe-96a4-35bf0763f1b7n%40googlegroups.com.

Boyce Griffith

unread,
Mar 27, 2021, 12:22:49 AM3/27/21
to noreply-spamdigest via IBAMR Users

On Mar 27, 2021, at 12:16 AM, Boyce Griffith <boy...@gmail.com> wrote:

Ahmad —

What kind of non-Newtonian fluid model do you want to use? Most of our work on non-Newtonian fluid models has been focused on polymeric fluids. IBAMR also has incompressible Navier-Stokes solvers that work with variable viscosities, but I don’t think that they have been used for generalized Newtonian fluid models (e.g. with shear-dependent viscosities).

As far as the geometry goes — IBAMR’s support for unstructured meshes relies on libMesh (http://libmesh.github.io/). If you want to use a mesh-based geometry, then you will need a mesh that libMesh can read in. libmesh.github.io provides a list of supported file formats; see: http://libmesh.github.io/doxygen/index.html.

BTW, For mesh generation and modification, we commonly use TetWild (https://github.com/Yixin-Hu/TetWild), Meshmixer (https://www.autodesk.com/research/projects/meshmixer), and/or Cubit (https://coreform.com/products/coreform-cubit/). These packages are not part of IBAMR, but they can generate meshes that libMesh (and, consequently, IBAMR) can use.

Ahmad

unread,
Mar 29, 2021, 10:00:36 PM3/29/21
to IBAMR Users

Hi Professor, 

Thanks for your feedback. 

Polymeric fluids is what am using. 
I was able to create a .msh file using gmsh software as attached here. Libmesh shall read .msh file? I have added the .msh file in IBFE ex5 main folder but then how do I get IBFE ex5 read the .msh? I tried the commands you shared 
Mesh mesh(init.comm(), NDIM);
mesh.read("mesh-Nozzle.msh");
 or for file name I just tried Nozzle, still didnt work. 

I opened terminal in IBFE ex5 and inserted the command above and it says: bash: syntax error near unexpected token `('. Am not sure what this error is. 

Thanks!
Ahmad
Nozzle.msh

Ahmad

unread,
Mar 29, 2021, 10:14:18 PM3/29/21
to IBAMR Users
Hi Professor, 

To add to that, in the .cpp file I saw the following:
// Create a simple FE mesh.
        Mesh solid_mesh(init.comm(), NDIM);
        const double dx = input_db->getDouble("DX");
        const double ds = input_db->getDouble("MFAC") * dx;
        string elem_type = input_db->getString("ELEM_TYPE");
        const double R = 0.5;
        if (NDIM == 2 && (elem_type == "TRI3" || elem_type == "TRI6"))
        {
 I do see Mesh mesh(init.comm(), NDIM);
under it there are other information. Shall I remove the other information and insert mesh.read("mesh-Nozzle.msh"); ? 
I guess am facing difficulty on running my Nozzle.msh file.

Thanks!
Ahmad

Wells, David

unread,
Apr 6, 2021, 5:15:09 PM4/6/21
to IBAMR Users
Hi Ahmad,

Yes, that should do it - did this work?

Best,
David Wells

From: ibamr...@googlegroups.com <ibamr...@googlegroups.com> on behalf of Ahmad <akra...@gmail.com>
Sent: Monday, March 29, 2021 10:14 PM
To: IBAMR Users <ibamr...@googlegroups.com>
Subject: Re: [ibamr-users] IBAMR CAD Transfer
 

Ahmad

unread,
Apr 10, 2021, 4:05:02 PM4/10/21
to IBAMR Users
Hi Professor,

Thanks for your feedback! No, it didnt work.

I wasnt able to find a 3D flow IBAMR example that has a .msh file in it. I was hoping to find an example with .msh so I can edit the .CPP file to read my 3D Nozzle mesh that I created. 
I found an example that has a 2D Nozzle which is very close to what am looking for but its not 3D flow. This example is located in CIB ex3. I wasnt able to run the this command ./main2d input2d.nozzle though. Therefore, I wasnt able to visualize it in Visit to see if it is similar to my Nozzle design I created. 

Based on these findings I would like to ask the following questions:
1- Is their an IBAMR example that has a 3D flow .msh file?
2- For IBAMR example CIB ex3, can you generate a 3D flow so I can run from the ibamr-objs-opt directory? 
3- Is it possible to create a 3D .msh file located in CIB ex3 and update the .cpp to read this 3D flow .msh file?
4- It would be great if am able to find an IBAMR example that can read my attached 3D flow Nozzle.msh file. Is it possible to create an example for me please that can read my 3D flow Nozzle.msh file?

Thanks!
Ahmad
Nozzle.msh

me.kol...@gmail.com

unread,
Apr 12, 2021, 2:05:33 PM4/12/21
to IBAMR Users
Ahmad--

Are you sure your .msh file is not corrupted? I am able to use meshes with .msh extension, but it appears something is wrong with the file you've attached. In any case, as Boyce and David already mentioned, unstructured meshes in IBAMR are handled through libMesh, and I'm sure there are libMesh examples that directly read .msh files (see  https://github.com/libMesh/libmesh/blob/master/examples/reduced_basis/reduced_basis_ex7/reduced_basis_ex7.C as one example). It should really not be any different than .e files.

-Amin

Wells, David

unread,
Apr 12, 2021, 2:57:51 PM4/12/21
to IBAMR Users
Hi Amin and Ahmad,

Just to check - the code you showed at first was from an IBFE example, but later on you mentioned CIBMethod. Which one do you want to use with the nozzle? If you want to use CIBMethod you will need to extract the vertices - that class doesn't know how to handle meshes.

I think Amin is right. If you cannot load the msh file back into gmsh then something else is wrong outside of IBAMR. What, exactly, didn't work?

Best,
David

From: ibamr...@googlegroups.com <ibamr...@googlegroups.com> on behalf of me.kol...@gmail.com <me.kol...@gmail.com>
Sent: Monday, April 12, 2021 2:05 PM

Ahmad

unread,
Apr 17, 2021, 5:13:52 PM4/17/21
to IBAMR Users
Hi Professors,
Thanks for your feedback.

I imported the STL CAD file in gmsh. i have uploaded the STL CAD, can you please help me convert it to a .vertex or .m file? 

Dr. David,
Correct IBFE was at first but realized that CIB ex3 has a nozzle example which is similar to what am working on. Therefore, i would like to work with it. CIB ex3 has nozzle2d.vertex which i need to do for my nozzle example. First step is for me to understannd how the nozzle2d.vertex was created in CIB ex3. I learned that you need to have a generate_mesh2d.m file and in Mathlab you can run it and it will created the .vertex file for you. However, CIB ex3 dont have the generate)mesh2d.m file in it so I am unable to run in Mathlab. Can you help me with that file please?

Potentially I need a 3d nozzle generate_mesh3d.m to create a nozzle3d.vertex so i can run it. Therefore, i need to create an input3d.nozzle. For teh STL CAD I attached, is it possible to create an input3d.nozzle and .vertex file for me please so I can run it?

Also, another question, once the 2d CAD nozzle is created and I am able t run IBAMR, how do i change mesh to automatic adaptive mesh? 
How do i control the L2 norm of the error to be 20% less or 10% less? 

I have been trying a lot and reviewed multiple slides but have no luck.

Thanks!
Ahmad
Nozzle.STL

Boyce Griffith

unread,
Apr 19, 2021, 1:22:26 PM4/19/21
to IBAMR Users
There are a few different questions here. I will try to answer each inline below.


On Apr 17, 2021, at 5:13 PM, Ahmad <akra...@gmail.com> wrote:

I imported the STL CAD file in gmsh. i have uploaded the STL CAD, can you please help me convert it to a .vertex or .m file? 

A vertex file is just a list of point positions. See documentation here:


If you want to use a vertex file to specify the geometry, you will need to extract a list of points on the surface. You can get the vertices of your STL surface from the STL file itself (although probably with repeats that should be pruned).

I am not able to recommend specific software extracting the nodes from an STL file, but I will note that MATLAB has some tools for working with STLs. Here is a random Python library that may also work: https://trimsh.org/.

Correct IBFE was at first but realized that CIB ex3 has a nozzle example which is similar to what am working on. Therefore, i would like to work with it. CIB ex3 has nozzle2d.vertex which i need to do for my nozzle example. First step is for me to understannd how the nozzle2d.vertex was created in CIB ex3. I learned that you need to have a generate_mesh2d.m file and in Mathlab you can run it and it will created the .vertex file for you. However, CIB ex3 dont have the generate)mesh2d.m file in it so I am unable to run in Mathlab. Can you help me with that file please?

CIBMethod implements an "exactly constrained” IB algorithm, along the lines of those described in these papers:

https://arxiv.org/abs/1602.02170

These algorithms are important for cases where you need to impose constrained motion “exactly” in an IB computation. This can be critical if you are working with a neutrally buoyant body in low Reynolds number or Stokes flow conditions. If you are operating in higher Reynolds number conditions, I am not sure if it is necessary. Another benefit of the CIB formulation is that there are not any penalty parameters to tune. The major cost is that the linear algebra is very expensive, and the current implementation may not scale well to large 3D objects.

IBMethod and IBFEMethod will allow you to use approximate constraints. This simplifies the linear algebra, which generally allows individual time steps to be much faster than with CIBMethod, but generally the time step size must decrease as you increase the penalty parameter value. These papers all use penalty formulations for flows through channels:


Potentially I need a 3d nozzle generate_mesh3d.m to create a nozzle3d.vertex so i can run it. Therefore, i need to create an input3d.nozzle. For teh STL CAD I attached, is it possible to create an input3d.nozzle and .vertex file for me please so I can run it?

We can try to get a channel flow-type example in the library. I’ve created an issue here: https://github.com/IBAMR/IBAMR/issues/1247.

Also, another question, once the 2d CAD nozzle is created and I am able t run IBAMR, how do i change mesh to automatic adaptive mesh? 
How do i control the L2 norm of the error to be 20% less or 10% less? 

The region near the immersed structures is automatically refined. IBAMR uses feature detection criteria to determine where to refine away from the structures. The primary criteria that we use are based on the local magnitude of the vorticity. See this recent thread for some more discussion:


IBAMR does not implement error estimators that provide guarantees on the accuracy of the computed solution. You will need to run a grid convergence study to determine whether particular quantities of interest have converged.

— Boyce

Reply all
Reply to author
Forward
0 new messages