# Calculation on two meshes

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

 September 19, 2012, 02:47 Calculation on two meshes #1 Member   Join Date: May 2012 Location: Dresden, Germany Posts: 32 Rep Power: 7 In my solver I have to do Biot-Savart, which are NumberOfCells² operations. That takes time. On the other hand, the mesh has to be fine enough for the simulation to be correct. That is why I am thinking of calculating with two seperate meshes: (1) fine mesh for Navier-Stokes Eqn (2) a coarse mesh for Biot-Savart Are there any examples / predefined functions for working with two meshes and for interpolation between them? Thanks a lot!!!

September 19, 2012, 06:53
#2
Member

Join Date: May 2012
Location: Dresden, Germany
Posts: 32
Rep Power: 7
I already solved the problem, following this explanation:
http://www.cfd-online.com/Forums/ope...time-step.html

Just in case someone has the same problem:
(1) you have to make 2 separate meshes
Quote:
 Originally Posted by meshIT # generiert 2 Netze # die blockMeshDics als fineMesh und bMesh an gewohntem Ort # zuerst das bMesh produzieren ./Allclean cp -r org 0 cp constant/polyMesh/bMesh constant/polyMesh/blockMeshDict blockMesh mkdir constant/bMesh mkdir constant/bMesh/polyMesh # jetzt in den Ordner 'bMesh' kopieren cp constant/polyMesh/* constant/bMesh/polyMesh # es folgt das fineMesh cp constant/polyMesh/fineMesh constant/polyMesh/blockMeshDict blockMesh mkdir system/bMesh # fvSolution und fvSchemes braucht man für jedes Netz!!! cp system/fvSolution system/bMesh/fvSolution cp system/fvSchemes system/bMesh/fvSchemes
Quote:
 Foam::fvMesh bMesh ( Foam::IOobject ( "bMesh", runTime.timeName(), runTime, Foam::IOobject::MUST_READ ) );
(3) define fields for both meshes, if necessary
Quote:
 volVectorField j ( IOobject ( "j", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), mesh, dimensionedVector("zero", dimensionSet(0,-2,0,0,0,1,0), vector::zero) // ); volVectorField jGrob ( IOobject ( "jGrob", runTime.timeName(), bMesh, IOobject::NO_READ, IOobject::NO_WRITE ), bMesh, dimensionedVector("zero", dimensionSet(0,-2,0,0,0,1,0), vector::zero) // );
(4) create an instance of meshToMesh
Quote:
 meshToMesh fine2coarse(mesh, bMesh); // source, target
(5) map it
Quote:
 fine2coarse.interpolate(jGrob, j); // target, source
(6) don't forget:

Quote:
 #include "meshToMesh.H" -I\$(LIB_SRC)/sampling/meshToMeshInterpolation/meshToMesh (options/EXE_INC) -lsampling (options/EXE_LIBS)

 September 24, 2012, 02:56 #3 New Member   Sebastian Bomberg Join Date: Aug 2012 Location: Munich, Germany Posts: 12 Rep Power: 7 Actually the blockMesh utility understands the "-region" option, so that you do not need to copy meshes from one directory to the other. Also decomposePar and e.g. funkySetfields know about the "-region" option.

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post FelixL OpenFOAM Bugs 27 March 27, 2012 09:02 camoesas OpenFOAM Post-Processing 2 March 9, 2012 11:03 Susan YU FLUENT 0 June 2, 2010 08:46 mannobot FLUENT 1 June 2, 2010 04:20 AB Siemens 6 November 15, 2004 05:41

All times are GMT -4. The time now is 23:00.