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

Simultaneous fine and course Meshes for two parts of a solver

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By GerhardHolzinger

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 26, 2013, 01:56
Default Simultaneous fine and course Meshes for two parts of a solver
  #1
New Member
 
Masoud Ami
Join Date: Sep 2013
Posts: 15
Rep Power: 12
MasAmi is on a distinguished road
Hello All.
I have built a solver which solves turbulent mixed convection flow and Radiation heat transfer in a vertical parallel plates channel.

Does anyone know that how we can set different meshes for these two parts? I mean because radiation doesn't need a very fine mesh, can we set a course mesh for solving RTE and at the same time a fine mesh for flow part?

As you may know, after each iteration in RTE solution, result goes to energy equation via source term. Then the flow equations are solved for one iteration and this procedure goes on.
Best Regards,
Mas
MasAmi is offline   Reply With Quote

Old   December 28, 2013, 17:55
Default
  #2
New Member
 
H. Kriete
Join Date: Dec 2013
Posts: 4
Rep Power: 12
kriete is on a distinguished road
The standard solvers don't allow calculating different mechanisms on different meshes.

But if you are writing your own solver, you can calculate radiation on a coarse mesh, interpolate (and smooth) it onto the fine mesh, calculate the flow on the fine mesh and interpolate it back onto the coarse mesh. Repeat both interpolations in each time step.

Helge
kriete is offline   Reply With Quote

Old   December 29, 2013, 06:50
Default
  #3
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
Hi Mas,

First of all, yes it is possible, but it will require a substantial amount of work to get it running. A couple of things you should consider are:

1. Is the radiation part so expensive that it will substantially speed up the execution to work with two meshes?

2. If yes, you should carefully consider how to implement the mesh coupling, such that you will experience a seemless execution in parallel. This will be the part, which will require a careful analysis prior to any implementation, and it might also require quite some additional pre-processing and runTime utilities/functionalities.

I am not saying this to scare you, but depending on your expertise in C++/OpenFoam libraries, this will be a potential very time consuming task to undertake. Alternatively, you should seek professional guidance.

Kind regards,

Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

Old   December 30, 2013, 06:47
Default Mesh SubSet eventual solution?
  #4
Senior Member
 
Bernhard Linseisen
Join Date: May 2010
Location: Heilbronn
Posts: 183
Blog Entries: 1
Rep Power: 15
Linse is on a distinguished road
Hi Mas,

I do not know which version of OF you are using. But some time ago I heard about the possibility of using meshSubSet from OF 1.6-ext for similar purposes. Maybe this helps a bit on that way? Then probably you would not have to redo stuff others already have completed...

Cheers,
Bernhard
Linse is offline   Reply With Quote

Old   January 4, 2014, 03:56
Default
  #5
New Member
 
Masoud Ami
Join Date: Sep 2013
Posts: 15
Rep Power: 12
MasAmi is on a distinguished road
Dear Helge, Niels and Bernhard

Hello guys and thanks a lot for your comments. By the way, do you know the steps I should follow in order to make it work?

Actually, my case is not very time consuming because I have used RANS but the run time gradually becomes higher when I change the radiation model (DOM) to its higher schemes. I wanted to find if that method can help me to reduce the run time especially for my future studies on complicated geometries.

Moreover, I have added radiation to existing buoyantBoussinesqSimpleFOAM. Therefore I haven't written the code from the scratch. Helge, as you said I can't add that concept to this solver. Did I get your point?!

Bernhard, do you know the exact use of the meshsubset?

I appreciate if you please tell me briefly the steps I should follow to implement this feature in openFOAM.

Thanks again guys.

Greatest Regards,
Mas
MasAmi is offline   Reply With Quote

Old   January 4, 2014, 04:58
Default
  #6
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
Hi Mas,

Note that the fvMeshSubset, as pointed to by Bernhard, does only support working on a subset of the computational domain (a different volume) and therefore not with a coarsening of the mesh, while still covering the same volume.

Kind regards,

Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

Old   January 10, 2018, 02:12
Default
  #7
Senior Member
 
krishna kant
Join Date: Feb 2016
Location: Hyderabad, India
Posts: 133
Rep Power: 10
kk415 is on a distinguished road
Hi Mas

I want to develop a solver similar to yours. I am working with interFoam or sclsVOFFoam and want to solve the alpha equations in a fine mesh and the fluid flow equations in a coarse mesh.

I am just beginning in this direction so any help or suggestions that you can give ?
kk415 is offline   Reply With Quote

Old   January 10, 2018, 21:42
Default
  #8
Senior Member
 
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 339
Rep Power: 28
GerhardHolzinger will become famous soon enoughGerhardHolzinger will become famous soon enough
It can be done, however, once you start mapping fields from one mesh to another one, you might introduce errors.
Solving flow on one mesh and radiative heat transfer on the other one, as the original poster suggested, seems quite feasible.

In a VOF solver, solving for alpha one one mesh and all the rest on another one seems to me as asking for too much trouble.

Anyway, OpenFOAM has everything on-board to make a solver work on several meshes, as in the cht* solvers.

The image attached is from some proof-of-idea tinkering: flow is solved on a fine mesh, scalar transport on a coarser one.
Attached Images
File Type: jpg dualMesh.jpg (180.0 KB, 65 views)
kk415 likes this.
GerhardHolzinger is offline   Reply With Quote

Old   January 11, 2018, 02:00
Default
  #9
Senior Member
 
krishna kant
Join Date: Feb 2016
Location: Hyderabad, India
Posts: 133
Rep Power: 10
kk415 is on a distinguished road
Thanks , the image is exactly what I was looking for.

I went through the chtMultiRegionFoam solver also. It seems I am able to solve my problem if I create a cellset for all the cells in fine mesh and another cellset for all the cells in coarse mesh.
But how to do that?

I can create two overlapping blocks; one with fine mesh and other with coarse. When I use toposet to create the cellset it selects all the cell i.e combining the cells of fine mesh and coarse mesh.
kk415 is offline   Reply With Quote

Old   January 11, 2018, 03:34
Default
  #10
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29
akidess will become famous soon enough
You don't need two blocks, you need two meshes. And you don't need topoSet at all - the cht* examples just use cellSets to split the meshes.
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
akidess is offline   Reply With Quote

Old   May 8, 2018, 05:44
Default
  #11
Senior Member
 
krishna kant
Join Date: Feb 2016
Location: Hyderabad, India
Posts: 133
Rep Power: 10
kk415 is on a distinguished road
Hi All,

I make a model for solving different PDE in different grids using mapField utility of OpenFoam. This work as following:

#!/bin/sh

cd testFoam_cavity; //case folder of coarse mesh
blockMesh;
for ((i=0;i < 100;i=i+1)) {
cd ../testFoam_cavityfine_scalar //case folder of fine mesh
mapFields ../testFoam_cavity -consistent
cd ../testFoam_cavity
testFoam //solver same as icoFoam i.e. solving NS equation and energy equation is commented
cd ../testFoam_cavityfine_scalar
testFoamScalar //solver for energy equation and NS equation is commented
cd ../testFoam_cavity
mapFields ../testFoam_cavityfine_scalar -consistent
}

It works fine in terms of result but the way is inefficient as It requires reading mesh too many times in one timeStep. Any suggestions to improve it.

Thanks
kk415 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 10:46.