CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Two dynamic meshes, one solver (https://www.cfd-online.com/Forums/openfoam-programming-development/251791-two-dynamic-meshes-one-solver.html)

Luke99 September 7, 2023 03:51

Two dynamic meshes, one solver
 
1 Attachment(s)
I am currently trying to modify interfoam. I would like to solve some equations on one dynamic mesh and the rest one the other and transfer the data with the help of the meshToMesh functionality.


In interfoam the dynamic mesh is declared by


Code:

autoPtr<dynamicFvMesh> meshPtr(dynamicFvMesh::New(args, runTime));
dynamicFvMesh& mesh = meshPtr();


If I want to create a second mesh in the same way by just changing mesh to FLmesh for example, wmake throws the following error:
"FLmesh was not declared in this scope"


this also happens if you try to do that in the way proposed in this Thread:

https://www.cfd-online.com/Forums/op...rent-mesh.html
or if you just rename mesh to something else.


So i guess i have to declare FLmesh somewhere before the main loop, but I don't know where.


Further I am unsure if I can actually declare/initialize the second mesh in the same way or if I need to change the arguments that are used in the meshPtr or if it is enough to just rename meshPtr to meshPtr2 for example.


If anyone needs a code to look at you can find it attached as a zip-File down below. It is an EHD solver with which I am trying to simulate Electrosprays. however the liquid is contacted somewhere back in the feeding of it and the capillary is a nonconducting resin so the electric field results mainly from the accumulated charges at the surface/interface of the liquid. As the resin has a low relative permitivity the electric field will behave differently if I include the permitivity and the region of the resin. Therfore I wanted to solve the Electric and Thermal(mainly joule heating in liquid) on a seperate mesh compared to the liquid calculations.

Luke99 September 11, 2023 10:40

Solution for at least one dynamic mesh and other static meshes can be found here if anyone is interested. Should also work for multiple dynamic ones, have not tested it though.


All times are GMT -4. The time now is 19:15.