porousMultiphaseFoam and OpenFOAM-CalculiX Coupling

Hello,everyone,

I want to simulate groundwater seepage . I want to use porousMultiphaseFoam(an open-source toolbox for OpenFOAM)
Can I use porousMultiphaseFoam for OpenFOAM-CalculiX Coupling?
Thanks.

I don’t know, but maybe @Alphaoo1 or @ajaust have encountered this solver in the context of preCICE.

Generally, any standard OpenFOAM solver can be used with the OpenFOAM-preCICE adapter, as long as it follows the typical structure of OpenFOAM solvers (most importantly: calls function objects). But, since you want to couple porous media related fields, you may need to extend the adapter for those: Extend the OpenFOAM adapter | preCICE - The Coupling Library

1 Like

Hi! I have never used the OpenFOAM porous-medium solver and never got around testing it. In my project we always used DuMuX for the porous-medium solver which is a package highly specialized in solving various porous-medium problems.

2 Likes

Hi :slight_smile:

Sorry for the late reply.

I have used VoF (interFoam) solver for multiphase flow.

I have added a field for porosity and a field called source to createFields.H. (I have to compile this solver with additional fields using wmake).
I then use fvOptions (fvModels for OF v9) with vectorCodedSource to compute the “drag” source and inject it into the momentum equations.

Here is the example,

porousSource
{
    type            vectorCodedSource; // coded source for the effect of the porosity using Darcy-Forchheimer formula
    
    active          true;
    
    selectionMode   all;
    
    fields          (U);
    
    name            sourceTime;
    
    codeCorrect
        #{
            
        #};
    
    codeAddSup
        #{    
            //volVectorField& source = mesh_.lookupObjectRef<volVectorField>("source");
            
            vectorField& Usource = eqn.source();
            
            const volVectorField& Velocity = eqn.psi() ;
            
            const volScalarField& porosity = mesh_.lookupObject<volScalarField>("Volume_Porosity");    // get the porosity field  
            
            const volScalarField& MU = mesh_.lookupObject<volScalarField>("mu"); // dynamic viscocity
            
            const vectorField& C = mesh_.C();   // get the cell centers of the mesh
            
            const scalarField& V = mesh_.V();   // get the cell volume (a specific source is wanted, ie /m^3)   
            
            const scalar Dp = 0.01 ;  // : Dp = mean diameter of the particles
            
            scalar alpha = 0;  
                    
            forAll(C, i) // for every cell
                {
                    alpha = 0; 

                    if (porosity[i] != 0 && porosity[i] != 1)  
                    {
                            
                            alpha = (pow(Dp, 2)/150) * (pow(porosity[i], 3)/pow((1-porosity[i]), 2));
                            Usource[i] = ((MU[i]/alpha)*Velocity[i] ) * V[i] ;
                        }
                    }
        #};
}

I hope this helps.

Cheers,
Prasad

2 Likes