CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Mesh Generation & Pre-Processing Software > ANSA

Exporting faceZones To OpenFOAM

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By tomf

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 17, 2025, 08:29
Question Exporting faceZones To OpenFOAM
  #1
New Member
 
Zack
Join Date: Jul 2024
Posts: 4
Rep Power: 2
MechaZ is on a distinguished road
Hello everyone,

I previously worked on ANSA with static meshes just fine ! Now, I am trying to make a dynamic mesh by using nonConformalCouple BC type.
The tutorial case in openFOAM uses Baffles to create two neighboring patches and rotate one relative to the other.
Long story short I couldn't use the feature ANSA offers for dynamic mesh (it exports as a regular patch) so I'm trying to create a baffles that I'll split manually with openFOAM code. faceZones file is empty when I export from ANSA (the code takes a facezone and duplicates it to rotate one and fix the other), while my PIDs are set correctly somehow it doesn't export faceZones (I'm not even 100% sure I need faceZones) and the boundary file is also weirdly defined, here's the boundary file :

Code:
FoamFile
{
	version 2.0;
	format binary;
	class polyBoundaryMesh;
	location "";
	object boundary;
}
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/


4
(

	MovingWall
	{
		type wall;
		startFace 157169;
		nFaces 256;
	}

	InnerCylinder       // the faceZone or surface i want to rotate
	{
		type wall;                 // PID is set to be baffle, why is it wall idk !
		startFace 157425;
		nFaces 1982;
	}

	InnerCylinder_shadow    // Somehow a shadow was created 
	{
		type wall;               // it's a good sign but idk where i'll need it
		startFace 159407;
		nFaces 1982;
	}

	Farfield
	{
		type patch;
		startFace 161389;
		nFaces 378;
	}

)
If you have any idea on how to set up dynamic mesh in ANSA for openFOAM I'd be grateful for your help. Please tell me if I'm completely heading in the wrong direction here !
MechaZ is offline   Reply With Quote

Old   March 18, 2025, 04:55
Default
  #2
Senior Member
 
Tom Fahner
Join Date: Mar 2009
Location: Breda, Netherlands
Posts: 656
Rep Power: 33
tomf will become famous soon enoughtomf will become famous soon enough
Send a message via MSN to tomf Send a message via Skype™ to tomf
Hi,

Not sure if there is an option to use the NCC directly from ANSA, but if you want to export the surfaces as faceZones you have to set the ANSA type to internal and have the checkBox use in model checked.

For the ESI versions there are options to setup the cyclicAMI in ANSA, but you need to make sets of faces, its a bit too complicated to explain in a single post.

Now you have basically two baffles in your exported mesh, maybe some mesh manipulation tools (createPatch/createBaffles?) in OpenFOAM can create the NCC from the baffles, or from the faceZones if you export them as such?

Regards,
Tom
rmaries likes this.
tomf is offline   Reply With Quote

Old   April 16, 2025, 08:51
Default
  #3
New Member
 
Zack
Join Date: Jul 2024
Posts: 4
Rep Power: 2
MechaZ is on a distinguished road
Quote:
Originally Posted by tomf View Post
Hi,

Not sure if there is an option to use the NCC directly from ANSA, but if you want to export the surfaces as faceZones you have to set the ANSA type to internal and have the checkBox use in model checked.

For the ESI versions there are options to setup the cyclicAMI in ANSA, but you need to make sets of faces, its a bit too complicated to explain in a single post.

Now you have basically two baffles in your exported mesh, maybe some mesh manipulation tools (createPatch/createBaffles?) in OpenFOAM can create the NCC from the baffles, or from the faceZones if you export them as such?

Regards,
Tom
Thank you Tom for answering my post, your solution seems to solve my problem.
I've put this project on hold and continued with other work that's why I'm only answering now, here's how this solves my issue (for future reference) :

I did as you said and set the ANSA type as internal, making sure the use in model is checked. This wrote the faceZones I needed, next I ran these commands that call the proper files :

> createBaffles -overwrite

Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  11
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       dictionary;
    object      createBafflesDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

internalFacesOnly true;

baffles
{
    nonCouple
    {
        type        faceZone;
        zoneName    innerCylinder;

        patches
        {
            owner
            {
                name        nonCouple1;
                type        patch;
            }

            neighbour
            {
                name        nonCouple2;
                type        patch;
            }
        }
    }
}
> splitBaffles -overwrite

(note : I don't have a splitBafflesDict file, as I understand it, it's a function that openFOAM knows, where in opposition, to create them (baffles) OF needs to know the names and original patches etc...)

> renumberMesh -noFields -overwrite

(note : as I understand it, this edits the U, P, Epsilon... files to have the correct BC)

> createNonConformalCouples -overwrite nonCouple1 nonCouple2

> decomposePar -noFields

(for parallel run where you specify the number of cores in the next command)

> mpirun -np 6 pimpleFoam -parallel

> reconstructPar

I hope that this might help someone who is experimenting with dynamic meshes for the first time, just like me.

kind regards,
Zack
MechaZ is offline   Reply With Quote

Reply

Tags
ansa, dynamic mesh, facezone, openfoam

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[CAD formats] Exporting OpenFOAM mesh as STL with boundary values bmercer OpenFOAM Meshing & Mesh Conversion 2 March 8, 2017 16:00
OpenFOAM Training Jan-Apr 2017, Virtual, London, Houston, Berlin cfd.direct OpenFOAM Announcements from Other Sources 0 September 21, 2016 11:50
OpenFOAM v3.0.1 Training, London, Houston, Berlin, Jan-Mar 2016 cfd.direct OpenFOAM Announcements from Other Sources 0 January 5, 2016 03:18
Cross-compiling OpenFOAM 1.7.0 on Linux for Windows 32 and 64bits with Mingw-w64 wyldckat OpenFOAM Announcements from Other Sources 3 September 8, 2010 06:25
Adventure of fisrst openfoam installation on Ubuntu 710 jussi OpenFOAM Installation 0 April 24, 2008 14:25


All times are GMT -4. The time now is 15:33.