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

Confirmation Needed on fvMeshSubset and Moving Meshes

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 10, 2010, 17:14
Default Confirmation Needed on fvMeshSubset and Moving Meshes
  #1
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
Hi all

I am solving an advection-diffusion equation for suspended sediment transport (variable c). The physical models describe the boundary condition to be set some distance from the bed, say 2d_50 (d_50 being median grain diameter), hence I will use fvMeshSubset to get the computational domain on which I will solve for c.

The sediment transport results in bed level changes and it is being moved using the moving mesh capabilities on the entire mesh.

My question/confirmation quest is:

The fvMesh obtained using fvMeshSubset (local mesh) is a reference to the global fvMesh, so please confirm that moving the pointField on the global mesh carries over to the local mesh?

Thank you very much for your time,

Niels
ngj is offline   Reply With Quote

Old   September 17, 2010, 09:06
Default
  #2
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
Hi all

To follow up on my questions, I have come closer to an answer. First of all, it is possible to do what I described (thanks to the OpenFOAM for a very flexible mesh handling). However, there is a little twist in the mesh handling, as the points in the submesh is not updated automatically. Therefor, this is a small guide to how I handled the coupling (everything is based on 1.5, where the fvMeshSubset is constructed differently as in 1.7!):

1. Create the submesh:
Code:
fvMeshSubset submesh( c, mesh ); // c is in this case a volScalarField

cellSet cCells(mesh, "cCells");

submesh.setLargeCellSubset(cCells, patchID, true); // patchID is the patch number, which the previously internal faces must adopt.

fvMesh & cMesh = submesh.subMesh();
2. How to move cMesh when mesh has been moved (using the movePoints interface in fvMesh):

Code:
const labelList & pointMap_(submesh.pointMap());
const pointField & pp(mesh.points());

pointField cpp(pointMap_.size(), vector::zero);

forAll ( pointMap_, pointi )
{
    cpp[pointi] = pp[pointMap_[pointi]];
}

cMesh.movePoints(cpp);
I hope the above can help someone.

Have a nice weekend,

Niels
ngj 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 19:22.