CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

How to delete faces in faceZone and update mesh during runtime?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 15, 2017, 19:08
Default How to delete faces in faceZone and update mesh during runtime?
  #1
New Member
 
Nuttita Pophet
Join Date: Oct 2016
Location: Mississippi, USA
Posts: 10
Rep Power: 10
nuttita is on a distinguished road
Hello,

I'm trying to simulate a dam break flow with lifting gate using interFoam. The gate is lifted with a velocity 6 m/s.

At the beginning, I created the gate as a thin wall using "topoSet" and then "createBaffle". After using "blockMesh", I obtained a "faceZones" file:

Quote:
1
(
baffleFaces
{
type faceZone;
faceLabels List<label>
80
(
45255
45256
45257
45258
45259
45260
.
.
.
flipMap List<bool>
80
(
0
0
0
0
0
0
.
.
.
Then, I tried to update the gate position by removing some faces in the faceZone. So I added these lines in the solver (myInterFoam):

Code:
while (runTime.run())
{
label zID = mesh.faceZones().findZoneID("baffleFaces");
faceZone& facesZone = mesh.faceZones()[zID];
forAll(facesZone,II)
{
	Info << "\n faceZoneID :::::::::::: " << facesZone[II] << endl;
	Info << "\n faceZoneGeo :: " << Cf[II][0] << " " 
		<< Cf[II][1] << " " 
		<< Cf[II][2] << endl;
}
I obtained:

Quote:
faceZoneID :: 45255

faceZoneCoordinate :: 0.01 0.005 0.05

faceZoneID :: 45256

faceZoneCoordinate :: 0.005 0.01 0.05

faceZoneID :: 45257

faceZoneCoordinate :: 0.02 0.005 0.05

faceZoneID :: 45258

faceZoneCoordinate :: 0.015 0.01 0.05

faceZoneID :: 45259

faceZoneCoordinate :: 0.03 0.005 0.05

faceZoneID :: 45260

faceZoneCoordinate :: 0.025 0.01 0.05

.
.
.
How can I remove some faces in the faceZone and then update mesh?

Thank you.
nuttita is offline   Reply With Quote

Reply


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



All times are GMT -4. The time now is 02:36.