CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Confirmation Needed on fvMeshSubset and Moving Meshes (https://www.cfd-online.com/Forums/openfoam-programming-development/79990-confirmation-needed-fvmeshsubset-moving-meshes.html)

ngj September 10, 2010 16:14

Confirmation Needed on fvMeshSubset and Moving Meshes
 
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 September 17, 2010 08:06

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


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