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

Accessing the field values of a mesh within another mesh

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 16, 2022, 07:06
Unhappy Accessing the field values of a mesh within another mesh
  #1
New Member
 
Mohsen Hashemzadeh
Join Date: Jun 2012
Location: Australia
Posts: 2
Rep Power: 0
mohsen.hashemzadeh is on a distinguished road
Dear Foamers,

I am developing a new solver for fire modelling based on FireFOAM. I need to have two different regions (meshes). In the larger one (called environment) I have to solve a set of governing equations (PDEs).

For the other region (solid region), which should be embedded inside the environment region, I have to solve a set of ODEs. I know how to define two meshes and they work. The governing equations of each region are also working.

The only thing is that I want to access the field values (say velocity, temperature, ...) of the environment region inside the solid region to somehow couple the fields of each region.

I have two meshes, the definition of the meshes are based on the below link which I found useful:

As FireFoam is a complex solver and there are numerous variables, it is not easy to define two fields (for each region) for all of the variables. Instead, I am looking for a way that I could access the data of the other field.

To explain a bit more, I have two meshes (mesh and emMesh, same as the link above). On the mesh, the gas phase equations are solved, while on the emMesh, I have a couple of fields that should be solved. I tried to access the mesh while solving the solid region equation (i.e. emMesh using

Quote:
const fvMesh & mesh = objectRegistry::lookupObject<fvMesh>("mesh");
which couldn't be complied:
Quote:
cannot call member function ‘const Type& Foam::objectRegistry::lookupObject(const Foam::word&) const [with Type = Foam::fvMesh]’ without object
or

Quote:
const fvMesh & mesh = db().parent().lookupObject<fvMesh>("mesh");
which gives the below error:

Quote:
error: ‘db’ was not declared in this scope;


Please kindly help.
mohsen.hashemzadeh is offline   Reply With Quote

Old   June 20, 2022, 05:09
Default
  #2
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
It helps if you think of the mesh regions layout like a tree:
Code:
Time
|
|-- region1
|-- region2
|-- ...




\-- regionN

From your current mesh region, you first need to access its time() parent after which you can do a lookup for any of its siblings.
olesen is offline   Reply With Quote

Reply

Tags
multi regions, multiple meshing, objectregistry


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
sliding mesh problem in CFX Saima CFX 46 September 11, 2021 08:38
foam-extend-4.1 release hjasak OpenFOAM Announcements from Other Sources 19 July 16, 2021 06:02
problems after decomposing for running alessio.nz OpenFOAM 7 March 5, 2021 05:49
how to set periodic boundary conditions Ganesh FLUENT 15 November 18, 2020 07:09
Mapping values from 2D mesh to 3D mesh boundary during runtime benk OpenFOAM Programming & Development 1 June 13, 2014 03:39


All times are GMT -4. The time now is 02:51.