CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   codedFixedValue to couple velocity and pressure? (https://www.cfd-online.com/Forums/openfoam-solving/241789-codedfixedvalue-couple-velocity-pressure.html)

seilgu March 20, 2022 03:13

codedFixedValue to couple velocity and pressure?
 
I'm trying to simulate a Fan Filter Unit, when trying to model the HEPA filter at the output, I'm trying to impose the condition that for a small area, the outward velocity component builds up a pressure difference.
For example if the outflow velocity is 1m/s, the pressure on the inside surface of the filter is locally 10Pa; if the outflow is 2m/s, pressure inside is 20Pa.

This is different from the "type fanPressure" condition which sums the total flow rate, so I'm trying to use fixedCodedValue type condition.

the 0/p file contains this outlet patch:

Code:

out_hepaface
{
    type    codedFixedValue;
    value  $internalField;
    name    test;
   
    code
    #{
        scalarField& pField = *this;
        const vectorField& UFace = patch().lookupPatchField<volVectorField, vector>("U");
        const vectorField& np = patch().nf();

        int prop_coef = 1;
        forAll(pField, faceI) {
            pField[faceI] = prop_coef*UFace[faceI] & np[faceI];     
        }
    #};
}

The 0/U file contains :

Code:

out_hepaface
{
    type            pressureInletOutletVelocity;
    value          $internalField;
    inletValue      $internalField;
}

The solver is simpleFoam, and with deltaT = 0.001, it still makes sigFpe errors.

I've been learning OpenFOAM for only about 2 weeks so if you could kindly explain in detail if anything doesn't make sense.


All times are GMT -4. The time now is 07:41.