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

Reading a case with different mesh

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By FBenz

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 10, 2024, 10:51
Default Reading a case with different mesh
  #1
New Member
 
Eva
Join Date: Jan 2024
Posts: 3
Rep Power: 2
emunoz is on a distinguished road
Hello,
I am solving a flow (let's call it simulation0) that uses the solution of another simulation (let's call it simulation1) to compute some coefficients needed for the simulation.
I read the variables from simulation1 like:

Y_ref.set
(
I
new volScalarField
(
IOobject
(
name_Yref,
location_simulation1,
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
),
mesh
)
);

But, "mesh" is the mesh of simulation0, so the dimensions don't match with simulation1.

I tried to read the mesh of simulation1 like following, but I need runTime or an object similar which I don't know how to reach:

Foam::fvMesh mesh1
(
Foam::IOobject
(
Foam::fvMesh::defaultRegion,
location_simulation1,
runTime,
Foam::IOobject::MUST_READ
)
);

How can I read it?

Eva.
emunoz is offline   Reply With Quote

Old   May 6, 2024, 04:52
Default reading different Meshes
  #2
New Member
 
Felix Benz
Join Date: Jan 2020
Posts: 3
Rep Power: 6
FBenz is on a distinguished road
Hi,

i guess this question is already up for a couple of days, but maybe this will help:
If you want to read in a mesh from a different directory than constant (I assume here is your mesh from simulation0) you have to replace Foam::fvMesh::defaultRegion with the directory.

e.g.
Foam::fvMesh mesh1
(
Foam::IOobject
(
"region1", // read the mesh from constant/region1 directory
runTime.time().timeName(), // adjust the timestep here in case you have different meshes for different times
runTime,
Foam::IOobject::MUST_READ
)
);

Best regards
Felix
emunoz likes this.
FBenz is offline   Reply With Quote

Reply

Tags
mesh, openfoam10, read


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
Volume and Surface mesh taking a lot of time ghost_rider1145 FLUENT 0 March 20, 2024 12:36
[Commercial meshers] Problem with Mesh conversion from FLUENT Meshing to OpenFOAM mn17jyf OpenFOAM Meshing & Mesh Conversion 3 November 1, 2023 10:49
flow over cylinder in openFoam saeed jamshidi OpenFOAM Pre-Processing 3 August 11, 2023 16:16
execFlowFunctionObjects - unknown field problem Toorop OpenFOAM Post-Processing 16 March 14, 2016 04:25
[snappyHexMesh] No layers in a small gap bobburnquist OpenFOAM Meshing & Mesh Conversion 6 August 26, 2015 10:38


All times are GMT -4. The time now is 11:06.