CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   multi-region problem with dynamic mesh (https://www.cfd-online.com/Forums/openfoam/218710-multi-region-problem-dynamic-mesh.html)

shach934 July 1, 2019 13:38

multi-region problem with dynamic mesh
 
Hi foamers,
I am wandering if the multiregion solver like chtMultiRegionFoam support dynamicMesh. By dynamicMesh, i mean solid moving part, not dynamic refine mesh. Anyone has experience with it?
Thanks1

Tobi July 1, 2019 16:08

Hi,


simple answer. No it is not implemented. The meshes are derived from the fvMesh class and not the dynamic mesh class.


Code:

  forAll(fluidNames, i)                                                     
    {                                                                         
        Info<< "Create fluid mesh for region " << fluidNames[i]               
            << " for time = " << runTime.timeName() << nl << endl;             
                                                                               
        fluidRegions.set                                                       
        (                                                                     
            i,                                                                 
            new fvMesh                                                         
            (                                                                 
                IOobject                                                       
                (                                                             
                    fluidNames[i],                                             
                    runTime.timeName(),                                       
                    runTime,                                                   
                    IOobject::MUST_READ                                       
                )                                                             
            )                                                                 
        );                                                                     
    }


However, it is possible to re-built the solvers for dynamic meshes. As an idea, if we use dynamic meshes, we do have to implement it as follows (this is just the createDynamicMesh.H file.



Code:

    Info<< "Create mesh for time = "                                           
        << runTime.timeName() << nl << endl;                                   
                                                                               
    autoPtr<dynamicFvMesh> meshPtr                                             
    (                                                                         
        dynamicFvMesh::New                                                     
        (                                                                     
            IOobject                                                           
            (                                                                 
                dynamicFvMesh::defaultRegion,                                 
                runTime.timeName(),                                           
                runTime,                                                       
                IOobject::MUST_READ                                           
            )                                                                 
        )                                                                     
    );                                                                         
                                                                               
    dynamicFvMesh& mesh = meshPtr();

If you implement the dynamic mesh lib within the solid region, make sure to include the mesh fluxes into the energy equation. Right now, there are no fluxes included.


Code:

        fvScalarMatrix hEqn                                                   
        (                                                                     
            fvm::ddt(betav*rho, h)                                             
          - (                                                                 
                thermo.isotropic()                                             
              ? fvm::laplacian(betav*thermo.alpha(), h, "laplacian(alpha,h)") 
              : fvm::laplacian(betav*taniAlpha(), h, "laplacian(alpha,h)")     
            )                           

          + fvm::div(theMeshFluxFieldPhi, h)                                     
          ==                                                                   
            fvOptions(rho, h)                                                 
        );

I guess all information are given. Good luck,
Tobi

shach934 July 1, 2019 16:41

Hello Tobi,
I just tried with a simple case and found out the dynamicMesh is not implemented by chtMultiRegionFoam...
Thanks a lot for the instruction, I will try it tomorrow and update it later if it works.

shach934 July 2, 2019 07:22

Hi Tobi,
I am trying to implement this solver. However, I have a question about the fluid domain. I want to rotate the solid region, but the solid region is not a regular cylinder, the rotating region I difned is a cyliner, AMI boundary is used. Fluid cannot be totally excluded from the rotating region. So I do need to include the correctPhi for the fluid region too?
Then, if the solver works, the fluid and solid both need a dynamicMeshDict and with the same rotating velocity and coupled surface. Do you think this will work?
Thanks!


Quote:

Originally Posted by Tobi (Post 737701)
Hi,


simple answer. No it is not implemented. The meshes are derived from the fvMesh class and not the dynamic mesh class.


Code:

  forAll(fluidNames, i)                                                     
    {                                                                         
        Info<< "Create fluid mesh for region " << fluidNames[i]               
            << " for time = " << runTime.timeName() << nl << endl;             
                                                                               
        fluidRegions.set                                                       
        (                                                                     
            i,                                                                 
            new fvMesh                                                         
            (                                                                 
                IOobject                                                       
                (                                                             
                    fluidNames[i],                                             
                    runTime.timeName(),                                       
                    runTime,                                                   
                    IOobject::MUST_READ                                       
                )                                                             
            )                                                                 
        );                                                                     
    }


However, it is possible to re-built the solvers for dynamic meshes. As an idea, if we use dynamic meshes, we do have to implement it as follows (this is just the createDynamicMesh.H file.



Code:

    Info<< "Create mesh for time = "                                           
        << runTime.timeName() << nl << endl;                                   
                                                                               
    autoPtr<dynamicFvMesh> meshPtr                                             
    (                                                                         
        dynamicFvMesh::New                                                     
        (                                                                     
            IOobject                                                           
            (                                                                 
                dynamicFvMesh::defaultRegion,                                 
                runTime.timeName(),                                           
                runTime,                                                       
                IOobject::MUST_READ                                           
            )                                                                 
        )                                                                     
    );                                                                         
                                                                               
    dynamicFvMesh& mesh = meshPtr();

If you implement the dynamic mesh lib within the solid region, make sure to include the mesh fluxes into the energy equation. Right now, there are no fluxes included.


Code:

        fvScalarMatrix hEqn                                                   
        (                                                                     
            fvm::ddt(betav*rho, h)                                             
          - (                                                                 
                thermo.isotropic()                                             
              ? fvm::laplacian(betav*thermo.alpha(), h, "laplacian(alpha,h)") 
              : fvm::laplacian(betav*taniAlpha(), h, "laplacian(alpha,h)")     
            )                           

          + fvm::div(theMeshFluxFieldPhi, h)                                     
          ==                                                                   
            fvOptions(rho, h)                                                 
        );

I guess all information are given. Good luck,
Tobi


charlliemarshalll May 25, 2020 17:53

Thanks. Is there any chtMultiRegionFoam + moving mesh available in the community?

Moving solid + conjugate heat transfer seems not a rare scenario.


All times are GMT -4. The time now is 08:44.