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
How can I generate such a mesh file?
I am using meshio
import meshio, then you can use a lines like
mesh = meshio.read(inputfile)
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.
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.
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.
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.
rand_lognormal.zip (907 Bytes)