|
[Sponsors] |
July 29, 2019, 18:54 |
read mesh from another case
|
#1 |
New Member
Mohamed Ali
Join Date: Apr 2017
Posts: 5
Rep Power: 9 |
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? |
|
August 13, 2019, 02:41 |
|
#2 |
Member
Ashish Magar
Join Date: Jul 2016
Location: Mumbai, India
Posts: 81
Rep Power: 9 |
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 Try Code:
mapfields -help |
|
August 26, 2019, 03:17 |
|
#3 |
New Member
Mohamed Ali
Join Date: Apr 2017
Posts: 5
Rep Power: 9 |
Thank you Ashish,
I am trying to interpolate at each time step, so the mapFielads utility is not useful here. Any other suggestion. Thx |
|
August 26, 2019, 03:31 |
|
#4 |
Member
Ashish Magar
Join Date: Jul 2016
Location: Mumbai, India
Posts: 81
Rep Power: 9 |
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. |
|
August 27, 2019, 02:24 |
|
#5 |
New Member
Mohamed Ali
Join Date: Apr 2017
Posts: 5
Rep Power: 9 |
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. |
|
August 27, 2019, 02:36 |
|
#6 |
Member
Ashish Magar
Join Date: Jul 2016
Location: Mumbai, India
Posts: 81
Rep Power: 9 |
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. |
|
August 27, 2019, 03:14 |
|
#7 |
New Member
Mohamed Ali
Join Date: Apr 2017
Posts: 5
Rep Power: 9 |
Thank you Ashish for your help
|
|
|
|
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 |