CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   How to let the mesh motion solver just solve a small region near a moving boundary? (http://www.cfd-online.com/Forums/openfoam-solving/80003-how-let-mesh-motion-solver-just-solve-small-region-near-moving-boundary.html)

zhajingjing September 12, 2010 00:11

How to let the mesh motion solver just solve a small region near a moving boundary?
 
Hi,
I use mesh motion solver for a moving boundary, and it takes a lot of time to move the whole mesh, if setting the part of mesh just near the moving boundary to move can be realized(that means just solve mesh equation in a region near the moving boundary), then I can save much time to run the case.

So how to let the mesh motion solver just solve a small region near a moving boundary? Can someone give me a hint?
Thanks!

Jingjing

deepsterblue September 12, 2010 01:03

Take a look at subsetMotionSolverFvMesh (I think that's what it's called). Lets you use a subset mesh and prescribe mesh motion for that alone.

zhajingjing September 12, 2010 06:57

Hi
I use OpenFOAM-1.5, may I ask where is "subsetMotionSolverFvMesh", I cann't find it. Or you mean I should write a class that inherit from dynamicMotionSolverFvMesh" which will have the function I want?

deepsterblue September 12, 2010 08:53

I suppose this is one of those features that are only available on OF-1.5-dev. You can find it at:

($FOAM_SRC)/dynamicFvMesh/subsetMotionSolverFvMesh

It does precisely what you're looking for, using a cellSet for the subset mesh. It also includes a relaxation coefficient for blending.

zhajingjing September 16, 2010 23:18

Thank you very much! I succeed in using subsetMotionSolverFvMesh, and can run my case in serial pattern,but fail in parallel pattern.

Code:

--------------------------------------------------------------------------
[duanmu@localhost deckMesh]$ mpirun -np 2 interDyMFoam -parallel
/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  1.5-dev                              |
|  \\  /    A nd          | Revision: exported                              |
|    \\/    M anipulation  | Web:      http://www.OpenFOAM.org              |
\*---------------------------------------------------------------------------*/
Exec  : interDyMFoam -parallel
Date  : Sep 17 2010
Time  : 07:13:36
Host  : localhost.localdomain
PID    : 1482
Case  : /home/duanmu/zjj/deckMesh
nProcs : 2
Slaves :
1
(
localhost.localdomain.1483
)

Pstream initialized with:
    floatTransfer    : 0
    nProcsSimpleSum  : 0
    commsType        : blocking

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create dynamic mesh for time = 0.05

Selecting dynamicFvMesh subsetMotionSolverFvMesh
Uncoupled 172 faces on coupled patches. (processorPolyPatch, cyclicPolyPatch)
You might need to run couplePatches to restore the patch face ordering.

[0] Number of cells in new mesh : 10800
[0] Number of faces in new mesh : 37447
[0] Number of points in new mesh: 16529
[1] Number of cells in new mesh : 10800
[1] Number of faces in new mesh : 37158
[1] Number of points in new mesh: 16083
[0]    oldInternalFaces : 9188
[1]    oldInternalFaces : 8697
Selecting motion solver: displacementLaplacian
--> FOAM Warning :
    From function dlLibraryTable::open(const fileName& functionLibName)
    in file db/dlLibraryTable/dlLibraryTable.C at line 86
    could not load /home/duanmu/OpenFOAM/OpenFOAM-1.6/lib/linuxGccDPOpt/libfvMotionSolvers.so: undefined symbol: _ZN4Foam15pointPatchFieldIdE5debugE
processorPointPatch::calcPatchPatchPoints() : constructing patch-patch points
processorPointPatch::calcPatchPatchPoints() : constructed patch-patch points
[0]
[0]
[0] size 31775 is not equal to the given value of 16529
[0]
[0] file: /home/duanmu/zjj/deckMesh/processor0/0.05/motionSubset/pointDisplacement from line 18 to line 31839.
[0]
[0]    From function Field<Type>::Field(const word& keyword, const dictionary& dict, const label s)
[0]    in file /home/duanmu/OpenFOAM/OpenFOAM-1.5-dev/src/OpenFOAM/lnInclude/Field.C at line 224.
[0]
FOAM parallel run exiting
[0]
--------------------------------------------------------------------------
MPI_ABORT was invoked on rank 0 in communicator MPI_COMM_WORLD
with errorcode 1.

NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes.
You may or may not see output from other processes, depending on
exactly when Open MPI kills them.
--------------------------------------------------------------------------
[1]
[1]
[1] size 31775 is not equal to the given value of 16083
[1]
[1] file: /home/duanmu/zjj/deckMesh/processor1/0.05/motionSubset/pointDisplacement from line 18 to line 31839.
[1]

-It shows the size mismatch, is there something need to pay attention during parallel decomposition after using motionSubset ? What should I do?

-How to display the decomposed part of every processor in paraFoam ,in order to examine?

Thank you!

zhajingjing September 17, 2010 15:18

Hi,
I use the modified decomposePar , but the case still can't work in parallel
(see posts:
http://www.cfd-online.com/Forums/ope...epar-sets.html
http://www.cfd-online.com/Forums/ope...-part-2-a.html)

First, I'm not sure whether I decompose correctly. I didn't use the decomposeParWithSets, just add some sentence to the original source file according to the domainDecomposition.C.Patch in the fist post, compile and run the modified decomposePar, Then I get the decompose information,

Code:

[duanmu@localhost deckMesh]$ decomposePar -force
/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  1.5-dev                              |
|  \\  /    A nd          | Revision: exported                              |
|    \\/    M anipulation  | Web:      http://www.OpenFOAM.org              |
\*---------------------------------------------------------------------------*/
Exec  : decomposePar -force
Date  : Sep 18 2010
Time  : 11:22:28
Host  : localhost.localdomain
PID    : 29413
Case  : /home/duanmu/zjj/deckMesh
nProcs : 1

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Time = 0.02
Create mesh for region region0

Calculating distribution of cells
Selecting decompositionMethod simple

Finished decomposition in 1.35 s

Calculating original mesh data

Distributing cells to processors

Distributing faces to processors

Calculating processor boundary addressing

Distributing points to processors

Checking for face/cell-Sets
Found cell sets:
1
(
c0
)


Constructing processor meshes

Processor 0
    Number of cells = 291550
    Writing cell set c0 with 54000 cells
    Number of faces shared with processor 1 = 1826
    Number of processor patches = 1
    Number of processor faces = 1826
    Number of boundary faces = 30496

Processor 1
    Number of cells = 291550
    Writing cell set c0 with 0 cells
    Number of faces shared with processor 0 = 1826
    Number of processor patches = 1
    Number of processor faces = 1826
    Number of boundary faces = 29314

Number of processor faces = 1826
Max number of processor patches = 1
Max number of faces between processors = 1826
water depth 1.4
wave type linearWave
wave omega 5.5478
wave height 0.14
wave number 3.13837735726
w=1.99404041929
piston stroke 0.0351046043615

Processor 0: field transfer
Processor 1: field transfer

End.

It seems the decomposition is correctly if just from the decomposition information, only processor 0 's domain cover the subsetMotion area c0. So I know my previous decomposition that directly using the original decomposePar is absolutely wrong.

However, parallel running still fail.

Code:

[duanmu@localhost deckMesh]$ mpirun -np 2 interDyMFoam -parallel
/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  1.5-dev                              |
|  \\  /    A nd          | Revision: exported                              |
|    \\/    M anipulation  | Web:      http://www.OpenFOAM.org              |
\*---------------------------------------------------------------------------*/
Exec  : interDyMFoam -parallel
Date  : Sep 18 2010
Time  : 11:03:30
Host  : localhost.localdomain
PID    : 29174
Case  : /home/duanmu/zjj/deckMesh
nProcs : 2
Slaves :
1
(
localhost.localdomain.29175
)

Pstream initialized with:
    floatTransfer    : 0
    nProcsSimpleSum  : 0
    commsType        : nonBlocking

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create dynamic mesh for time = 0.02

Selecting dynamicFvMesh subsetMotionSolverFvMesh
[1] Number of cells in new mesh : 0
[1] Number of faces in new mesh : 0
[1] Number of points in new mesh: 0
[0] Number of cells in new mesh : 54000
[0] Number of faces in new mesh : 166350
[0] Number of points in new mesh: 58466
[1]    oldInternalFaces : 0
[0]    oldInternalFaces : 1800
Selecting motion solver: displacementLaplacian
--> FOAM Warning :
    From function dlLibraryTable::open(const fileName& functionLibName)
    in file db/dlLibraryTable/dlLibraryTable.C at line 86
    could not load /home/duanmu/OpenFOAM/OpenFOAM-1.6/lib/linuxGccDPOpt/libfvMotionSolvers.so: undefined symbol: _ZN4Foam15pointPatchFieldIdE5debugE
processorPointPatch::calcPatchPatchPoints() : constructing patch-patch points
processorPointPatch::calcPatchPatchPoints() : constructed patch-patch points
water depth 1.4
wave type linearWave
wave omega 5.5478
wave height 0.14
wave number 3.13837735726
w=1.99404041929
piston stroke 0.0351046043615
Selecting motion diffusion: inverseDistance
[localhost.localdomain:29175] *** An error occurred in MPI_Waitall
[localhost.localdomain:29175] *** on communicator MPI_COMM_WORLD
[localhost.localdomain:29175] *** MPI_ERR_TRUNCATE: message truncated
[localhost.localdomain:29175] *** MPI_ERRORS_ARE_FATAL (your MPI job will now abort)
--------------------------------------------------------------------------
mpirun has exited due to process rank 1 with PID 29175 on
node localhost.localdomain exiting without calling "finalize". This may
have caused other processes in the application to be
terminated by signals sent by mpirun (as reported here).
--------------------------------------------------------------------------

The warning doesn't matter, it also pops out when running in serial, my case run well in serial, but that's too slow for 3D case, so I really need parallel runnning.

I desperately don't know what to do facing this information.
Is there anyone can give me hint?
Thank you all!

msbealo March 4, 2011 16:27

Did you solve this? I'm not using a subsetMesh, but my case that works fine on one processor fails to work in parallel.

interFoam single and parallel work fine.
interDyMFoam works for single but not parallel processors case.

I'm using OF1.7.1 if that helps.

Mark

Arnoldinho July 8, 2011 05:48

Zhajingjing,

I'm also interested if you ever solved this. I'd like to use the subsetMotionSolver in combination with interDyMFoam on OF 1.6-ext. It is working fine in serial so far, but fails in parallel mode as well.
I patched the domainDecomposition.C, but it seems that the patched one does not correctly decompose the subfolders in /0 for the subSet part.

Any hints would be highly appreciated!

Arne

misklach April 7, 2014 11:10

Any update for make subsetmotion solver work in parallel?

Ya_Squall2010 April 28, 2016 04:15

Any update on this issue?


All times are GMT -4. The time now is 12:48.