Reg. generation of a mesh file with heterogeneous permeability

Dear Sir,

I want to assign a random distribution of material parameters to the mesh (e.g., porosity and permeability).

I have seen such a mesh in Tests\Data\Parabolic\ComponentTransport\heterogeneous\ogs5_H_2D.

How can I generate such a mesh file?


1 Like

I am using meshio import meshio, then you can use a lines like

mesh = 
mesh.cell_data['vm_permeability'] = [np.array(k_cell)]

of course behind the array there must be some logic (even random numbers, since I assume some depth-trend), evaluations of coordinates, interpolation etc.

Dear Dominik,

In case if I need to give a heterogeneous permeability tensor for 2D approximation, do I need to generate a 3x3 tensor or 4x1 vector for simplification?

Because if I need to give MeshElement type permeability, it might result in an error if any tensorial element (xx,yy,zz,xy) is not provided.

Let me know.


Never mind, I was able to develop the code in Python. Thank you.

Dear Pavan,

nice that you found a solution. Is it possible to share your solution? I think that would be helpful also for others that want to do similar things.

Best regards,

Dear Thomas,

Sure, why not!

But, the Python code was developed for quad elements. However, you can modify the code for other mesh element types. The code basically generates a random log-normal distribution of permeability between maximum and minimum values. You can perform the needful changes.

Pavan. (907 Bytes)