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

Calculation on two meshes

Register Blogs Community New Posts Updated Threads Search

Like Tree5Likes
  • 5 Post By dl6tud

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 19, 2012, 03:47
Default Calculation on two meshes
  #1
Member
 
Norbert Weber
Join Date: May 2012
Location: Dresden, Germany
Posts: 37
Rep Power: 14
dl6tud is on a distinguished road
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!!!
dl6tud is offline   Reply With Quote

Old   September 19, 2012, 07:53
Default
  #2
Member
 
Norbert Weber
Join Date: May 2012
Location: Dresden, Germany
Posts: 37
Rep Power: 14
dl6tud is on a distinguished road
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
(2) load your new mesh
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)
dl6tud is offline   Reply With Quote

Old   September 24, 2012, 03:56
Default
  #3
New Member
 
Sebastian Bomberg
Join Date: Aug 2012
Location: Munich, Germany
Posts: 12
Rep Power: 14
sebas is on a distinguished road
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.
sebas 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Wrong calculation of nut in the kOmegaSST turbulence model FelixL OpenFOAM Bugs 27 March 27, 2012 10:02
yPlus Calculation for lowRe Meshes camoesas OpenFOAM Post-Processing 2 March 9, 2012 11:03
MRF and Heat transfer calculation Susan YU FLUENT 0 June 2, 2010 09:46
Defining output as input for second calculation mannobot FLUENT 1 June 2, 2010 05:20
Warning 097- AB Siemens 6 November 15, 2004 05:41


All times are GMT -4. The time now is 15:19.