Multi-physics interface

This category replaces the missing input manual
User avatar
Jaakko Leppänen
Site Admin
Posts: 2404
Joined: Thu Mar 18, 2010 10:43 pm
Security question 2: 0
Location: Espoo, Finland
Contact:

Re: Multi-physics interface

Post by Jaakko Leppänen » Mon Mar 31, 2014 6:27 pm

The structure of the OpenFOAM interface file was slightly modified in update 2.1.19:

Code: Select all

7 <mat> 1
<output_file>
<rho0> <T0>
<msh_split> <msh_dim> <s0> <sz1> ... <sz_dim>
<points_file>
<faces_file>
<owner_file>
<neighbour_file>
<density_file> <dm>
<temperature_file> <tm>
<maping_file>
The new parameters <dm> and <dt> define the type of values given in the density and temperature distributions. At the moment, <dm> must be set to 1, but <dt> has two values: 1 = given value is the cell temperature, 2 = given value is an increment relative to the nominal value.

The interface also provides the option to write output in OpenFOAM file format. For this, the output flag on the first line must be set to 1, followed by the output file name. The output also requires a mapping file, which links the calculated power distribution to OpenFOAM cells. The syntax of the file is:

Code: Select all

<nc>
<b_1>
<b_2>
...
<b_nc>
where <nc> is the number of OpenFOAM cells, followed by a list of bin indexes that determine the output bin assigned for each cell. If multiple cells are assigned with the same bin index, their results are combined, and the same average value printed for each cell in the output. The values in the output file are power densities in W/m3.

I also updated the example case at:

http://virtual.vtt.fi/virtual/montecarl ... Interface/

Please let me know if you encounter any problems. The development of this interface is still at an early stage.
- Jaakko

jesse.johns
Posts: 114
Joined: Wed Apr 20, 2011 5:19 am

Re: Multi-physics interface

Post by jesse.johns » Mon Jul 07, 2014 8:02 am

Hello,

The import of an OpenFOAM mesh from http://ttuki.vtt.fi/serpent/viewtopic.p ... 6fecb4d8e6 allows for multiple regions to be imported. However, once one moves to the multiphysics inferace, it isn't obvious to me how to bring in each region serperatly while still maintaining a consistent OpenFOAM interface.

It there still a way to define a seperate material file like you have in the geometry import?

Thanks,

Jesse

Ville Valtavirta
Posts: 478
Joined: Fri Sep 07, 2012 1:43 pm
Security question 1: No
Security question 2: 92

Re: Multi-physics interface

Post by Ville Valtavirta » Tue Jul 08, 2014 11:03 am

Jesse,

providing a separate material-file to link the cells with materials is currently not available for the interface. It would, however, be very useful and since some of the needed routines are already available in the unstructured mesh based geometry generation, this is probably something that will be implemented in the near future.

Currently, the only way to import temperature and density data for multiple materials (that I can think of) is to write the different material blocks into separate interfaces.

-Ville

jesse.johns
Posts: 114
Joined: Wed Apr 20, 2011 5:19 am

Re: Multi-physics interface

Post by jesse.johns » Wed Jul 09, 2014 6:47 am

Currently, the only way to import temperature and density data for multiple materials (that I can think of) is to write the different material blocks into separate interfaces.
That's what I was considering, but it looks like I will have to break apart the OpenFOAM mesh so that the cellZones connectivity matches for the seperate inputs, which would be unpleasent.

I think for now, I'll wait patiently.

Edit: I think I should be a little more clear on what I meant previously, just in case (I said seperately when I shouldn't have). I am using the normal solid import with the material deck. With a multi-region OpenFOAM mesh these are defined in the cellZones file. I parse this to determine which materials go where and generate a materials file very similar to the bunny example. I would imagine there might be an easy way for Serpent to read that file and set its own region names for appling materials. I'll take a look at it.

Ville Valtavirta
Posts: 478
Joined: Fri Sep 07, 2012 1:43 pm
Security question 1: No
Security question 2: 92

Re: Multi-physics interface

Post by Ville Valtavirta » Wed Jul 09, 2014 3:08 pm

I wrote a small hotfix to enable the usage of material files with the OpenFOAM interface. It seems to work, but there might be some unexpected behavior. I'll send it to you by email for testing.

-Ville

orca.blu
Posts: 59
Joined: Wed Apr 20, 2011 1:39 pm

Re: Multi-physics interface

Post by orca.blu » Tue Jul 15, 2014 2:43 pm

I might be missing something but...
if you want to run a multi-region simulation in OpenFOAM (e.g., with chtMultiRegionFoam and co.),
you need to split the domain into separate meshes for each region, anyway.
Manuele Aufiero
LPSC/IN2P3/CNRS Grenoble

jesse.johns
Posts: 114
Joined: Wed Apr 20, 2011 5:19 am

Re: Multi-physics interface

Post by jesse.johns » Thu Jul 17, 2014 10:06 pm

That's correct.

In the OpenFOAM mesh, you'll have each region (specified by CellZones) and the output will correspond to those locations via the index, as with any mesh.

The purpose of the hot fix is to associate separate materials within Serpent to these regions. Basically, what Ville did was allow for a material input that associates various materials to regions of the mesh, now. Previously, only one material would be specified over the entire mesh. I hope that clears it up!

orca.blu
Posts: 59
Joined: Wed Apr 20, 2011 1:39 pm

Re: Multi-physics interface

Post by orca.blu » Fri Jul 18, 2014 12:29 pm

Thanks Jesse!
Anyway, to run multi-region simulations in OpenFOAM is not enough to have different cellZones or cellSets.
You need to run a splitMeshRegions on your original mesh (or other equivalent command) in order to have the different regions separated in different meshes.
You will end up with the equivalent of the polyMesh folder (''points'' file, ''faces'' file, ''owner'' file, ecc) for each region. You should be able to use directly these files with the serpent interface.
This new meshes are usually located in ''constant/nameOfTheRegion/polyMesh''.
The original unified mesh (with cellZones or cellSets addressing) is not used in the multi-region OpenFOAM simulation and, in some cases, you do not even have an original unified mesh. That's why I think that handling the separate regions (meshes) with a single mesh is not the best (more general) solution for the serpent interface.

Of course, that's just my opinion, and I might be wrong.
What I said is not fully true if you are using special coupled solvers of the OF-ext version.
Is this your case? Which solver are you using?

Thanks

Ciao

Manu
Manuele Aufiero
LPSC/IN2P3/CNRS Grenoble

jesse.johns
Posts: 114
Joined: Wed Apr 20, 2011 5:19 am

Re: Multi-physics interface

Post by jesse.johns » Sat Jul 19, 2014 6:49 am

Thank you for the suggestion,

I see what you're talking about now. I am not actually running anything in OpenFOAM. I use the UNV mesh with FEM codes, then convert that to OpenFOAM to be read into Serpent. If it is desired to make the multiRegion import within Serpent more robust, the approach should look more like what you're suggesting.

Have youbeen successful with bringining in multiple solids with the current interface and using the mesh splitting?

orca.blu
Posts: 59
Joined: Wed Apr 20, 2011 1:39 pm

Re: Multi-physics interface

Post by orca.blu » Tue Jul 29, 2014 2:13 pm

Hi Jesse,
no, I do not think that it is possible with the current interface (but I am not sure).
(I'm using an internally coupled Serpent/OpenFOAM).
Manuele Aufiero
LPSC/IN2P3/CNRS Grenoble

Post Reply