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

read mesh from another case

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 29, 2019, 18:54
Default read mesh from another case
  #1
New Member
 
Mohamed Ali
Join Date: Apr 2017
Posts: 5
Rep Power: 9
Mohadali is on a distinguished road
Hi all,


I am trying to read a mesh from another case in order to interpolate between both cases (fine and coarse)


Foam::fvMesh meshSource
(
Foam::IOobject
(
Foam::fvMesh::defaultRegion,
path, // I am giving the exact path for the source caseDirectory
mesh,
Foam::IOobject::MUST_READ
)
);


I tried a lot of possibilities without succeed.


Can someone help please?
Mohadali is offline   Reply With Quote

Old   August 13, 2019, 02:41
Default
  #2
Member
 
Ashish Magar
Join Date: Jul 2016
Location: Mumbai, India
Posts: 81
Rep Power: 9
ashishmagar600 is on a distinguished road
Hi

If you just want to interpolate between the same geometries but different mesh sizes, you can use mapFields utility.

Eg: you want to interpolate values for fine grid case, use:
Code:
mapFields /path/to/coarse/grid -consistent
The "-consistent" arg is used if both the meshes with patches and BCs are identical.

Try
Code:
mapfields -help
ashishmagar600 is offline   Reply With Quote

Old   August 26, 2019, 03:17
Default
  #3
New Member
 
Mohamed Ali
Join Date: Apr 2017
Posts: 5
Rep Power: 9
Mohadali is on a distinguished road
Thank you Ashish,


I am trying to interpolate at each time step, so the mapFielads utility is not useful here.


Any other suggestion.
Thx
Mohadali is offline   Reply With Quote

Old   August 26, 2019, 03:31
Default
  #4
Member
 
Ashish Magar
Join Date: Jul 2016
Location: Mumbai, India
Posts: 81
Rep Power: 9
ashishmagar600 is on a distinguished road
It could be used if you just want to interpolate between two meshes.

I did it once for simulation of 15s (save time 0.001; i.e, 15000 timesteps) for
separate coarse and fine mesh.

You could write a bash script for creating a new time folder & use mapFields -sourceTime ../pathToCase in a loop. The mapFields utility maps -sourceTime specified to the latest Time folder specified in current dir.

Hope this helps.
ashishmagar600 is offline   Reply With Quote

Old   August 27, 2019, 02:24
Default
  #5
New Member
 
Mohamed Ali
Join Date: Apr 2017
Posts: 5
Rep Power: 9
Mohadali is on a distinguished road
Thank you Ashish for your reply,


I am trying to do interpolation inside the time loop to avoid the bash scripts.

I saw that people are doing it, but my problem is how to define a new mesh (as foam object) inside the main solver.
Mohadali is offline   Reply With Quote

Old   August 27, 2019, 02:36
Default
  #6
Member
 
Ashish Magar
Join Date: Jul 2016
Location: Mumbai, India
Posts: 81
Rep Power: 9
ashishmagar600 is on a distinguished road
I think using a script to run mapFields is easier.

Anyway, you could take a look at mapFields source code, you might get some idea how do they do it and implement it in your code.
ashishmagar600 is offline   Reply With Quote

Old   August 27, 2019, 03:14
Default
  #7
New Member
 
Mohamed Ali
Join Date: Apr 2017
Posts: 5
Rep Power: 9
Mohadali is on a distinguished road
Thank you Ashish for your help
Mohadali 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
Reconstruction of the parallel case with dynamic mesh makaveli_lcf OpenFOAM Post-Processing 7 October 18, 2023 11:28
Is Playstation 3 cluster suitable for CFD work hsieh OpenFOAM 9 August 16, 2015 14:53
Mesh motion with Translation & Rotation Doginal CFX 2 January 12, 2014 06:21
Can't run a case in HelyxOS with an imported mesh from Fluent HHOS OpenFOAM Running, Solving & CFD 0 July 2, 2013 06:25
999999 (../../src/mpsystem.c@1123):mpt_read: failed:errno = 11 UDS_rambler FLUENT 2 November 22, 2011 09:46


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