Boundary conditions (using exhaust fans)

Hi all, I’ve been stuck at this problem for quite a while. I’m not familiar with Openfoam but I’ve been playing around with Butterfly for quite a bit.

With reference to the indoor airflow example file (02_0_indoor_airflow.gh), currently the west_window is the inlet, and the east_window is the outlet boundary. I would interpret this setup similar to having an inlet fan pushing air in the room, and air is then pushed out via the opening defined by the outlet boundary.

If I were to change the design by using an exhaust fan at the outlet boundary to “pull” air out of the room, how should I modify the boundary conditions for the inlet and outlet portion accordingly?

Hi @cyshimz

I’ve never done this, as in most of my examples the inlet is set. I would imaging you could use a pressureInletOutlet bc for that. You can create, since you have some OF knowledge, custom BCs with butterfly. Or maybe setting an inletOutlet as your ‘inlet’ with zeroGradient conditions and then a pressureOutlet, or even an inlet with negative flow for your outlet?

Talking about these things as opposed to actually trying them is ofc dangerous. I woul expect a couple of issues with law of conservation and the relevant OF errors. I’d start with the pressure outlet, if you know it. JUst make sure one of the two BCs is detailed, and let OF calculate the rest.

Kind regards,
Theodore.

Dear @TheodorosGalanos

Thanks so much for such a quick response!

Just to report what I’ve tried so far - I’ve tried changing the inlet to the negative flow for my outlet.

Picture on the left: everything in the example file is the same, but I’ve changed the direction of the flow to negative by changing the value of the vector to -1.2 from 1.2. The vector for the inlet is now pointing out of the room. If this works, I would expect the airflow to be reversed as compared to the original simulation.

Picture on the right are the results in Paraview. As you can see, the airflow is exactly the same as the original simulation :sweat_smile::sweat_smile: to be honest, I don’t know why it worked like that.

I guess this rules out the “inlet with negative flow” idea.

Actually there might be a misunderstanding here - I’m not familiar with OF actually. But I’ve played around with Butterfly for quite a while now. I’ve seen the custom BC component. Would you be able to advise how do I define bType, etc?

Hi @cyshimz

Can you try the volumetric flow with vector for wind direction, it’s one of the available BCs. Also I think changing a vector of the surface for the inlet will not change flow direction is it is still a simple inlet boundary. You would need to probably assign an inletOutlet condition on your inlet (so without any wind velocity/flow, letting OF decide what’s best) and perhaps a pressure BC for the outlet to extract air.

What if this works. Make your inlet an outlet BC, with no velocity inputs, and make your outlet surface a volumetric flow with a vector pointing outwards (also try to flip the actual surface in Rhino to point outwards).

Sorry for the messy response, as I said talking about this stuff is rarely as useful as doing :slight_smile:

Kind regards,
Theodore.

Hi @TheodorosGalanos

Thanks so much for the input. I’ve tried to follow as you’ve explained:

So we have the following error now:

Reading/calculating face flux field phi
–> FOAM FATAL IO ERROR:
Unable to set reference cell for field p
Please supply either pRefCell or pRefPoint

file: /home/ofuser/workingDir/butterfly/indoor_airflow3/system/fvSolution.SIMPLE from line 97 to line 110.

From function void Foam::setRefCell(const volScalarField&, const volScalarField&, const Foam::dictionary&, Foam::label&, Foam::scalar&, bool)
in file cfdTools/general/findRefCell/findRefCell.C at line 105.

FOAM exiting


–> FOAM FATAL IO ERROR:
Unable to set reference cell for field p
Please supply either pRefCell or pRefPoint

file: /home/ofuser/workingDir/butterfly/indoor_airflow3/system/fvSolution.SIMPLE from line 97 to line 110.

From function void Foam::setRefCell(const volScalarField&, const volScalarField&, const Foam::dictionary&, Foam::label&, Foam::scalar&, bool)
in file cfdTools/general/findRefCell/findRefCell.C at line 105.

FOAM exiting


I would welcome any further input/ideas, as this is actually applicable to many HVAC studies that are exhaust driven.

Interesting that’s a value typically in fvSolution. I think because we are using these kind of bcs it’s giving this error. You can add the value:

pRefCell 0;

inside fvSolution/Simple part, somewhere before or after the nOrthogonalCorrectors line, but not sure we can make this work without manually running the case. Let’s see.

Hi @TheodorosGalanos

Appreciate the response. May I know how do I add the value? Is it done in Grasshopper, or do I need to change any files?

You’d need to change the files for now. Try and press false in BF solution, add the line to fvSolution, and then turn it to true.

Hi @TheodorosGalanos

Apologies, I feel really silly right now. Would you be able to explain how do I add the line to fvSolution? ^^;

No worries, it’s my bad for not being clear.

You’d need to open the /butterfly/your_case_folder_name_here/system/fvSolution file and manually type it.

@TheodorosGalanos

Thank you so much for your patience! I’ve added it after the nNonOrthoganalCorrectors line as you mentioned:

image

New errors now:

Reading/calculating face flux field phi
–> FOAM FATAL IO ERROR:
keyword pRefValue is undefined in dictionary “/home/ofuser/workingDir/butterfly/indoor_airflow3/system/fvSolution.SIMPLE”

file: /home/ofuser/workingDir/butterfly/indoor_airflow3/system/fvSolution.SIMPLE from line 97 to line 112.

From function const Foam::entry& Foam::dictionary::lookupEntry(const Foam::word&, bool, bool) const
in file db/dictionary/dictionary.C at line 564.

FOAM exiting


–> FOAM FATAL IO ERROR:
keyword pRefValue is undefined in dictionary “/home/ofuser/workingDir/butterfly/indoor_airflow3/system/fvSolution.SIMPLE”

file: /home/ofuser/workingDir/butterfly/indoor_airflow3/system/fvSolution.SIMPLE from line 97 to line 112.

From function const Foam::entry& Foam::dictionary::lookupEntry(const Foam::word&, bool, bool) const
in file db/dictionary/dictionary.C at line 564.

FOAM exiting


Oops my bad, add the pRefValue 0; as well right below!

I’ve tried adding it to the end of the file, but the same error occurs.

Not at the end, right below your pRefCell line. If you read the error you will see that OF is telling you the SIMPLE part of the fvSolution file lacks a pRefCell value.

Got it! image

I think that something interesting happened:

Starting time loop

Time = 1

smoothSolver: Solving for Ux, Initial residual = 1, Final residual = 0.09389171, No Iterations 7
smoothSolver: Solving for Uy, Initial residual = 0, Final residual = 0, No Iterations 0
smoothSolver: Solving for Uz, Initial residual = 0, Final residual = 0, No Iterations 0
–> FOAM FATAL ERROR:
Continuity error cannot be removed by adjusting the outflow.
Please check the velocity boundary conditions and/or run potentialFoam to initialise the outflow.
Total flux : 2.848611
Specified mass inflow : 1.2
Specified mass outflow : 0
Adjustable mass outflow : 0

From function bool Foam::adjustPhi(Foam::surfaceScalarField&, const volVectorField&, Foam::volScalarField&)
in file cfdTools/general/adjustPhi/adjustPhi.C at line 107.

FOAM exiting


–> FOAM FATAL ERROR:
Continuity error cannot be removed by adjusting the outflow.
Please check the velocity boundary conditions and/or run potentialFoam to initialise the outflow.
Total flux : 2.848611
Specified mass inflow : 1.2
Specified mass outflow : 0
Adjustable mass outflow : 0

From function bool Foam::adjustPhi(Foam::surfaceScalarField&, const volVectorField&, Foam::volScalarField&)
in file cfdTools/general/adjustPhi/adjustPhi.C at line 107.

FOAM exiting


It looks like a continuity error? Seems like this set of BCs might not work.

Yep exactly what I suspected will happen :slight_smile: As I said this is better done by doing and not saying, on my part. So we don’t have any outflow in our system, perhaps you can try and set an outflow (is the inlet patch an inletOutlet BC?). Also just play around with things now that you know how to make it run. If I get some time I’ll sit down and find the combination but I’m guessing you can do well with trial and error too!

Hi @TheodorosGalanos

Thanks for the help! May I know how do I change the inletOutlet BCs? Can it be defined using custom boundaries?