CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Impose a flux at BC for the transport of a scalar (http://www.cfd-online.com/Forums/openfoam-programming-development/99203-impose-flux-bc-transport-scalar.html)

Cyp March 28, 2012 10:08

Impose a flux at BC for the transport of a scalar
 
Hi!

The problem looks very simple. I want to impose a flux at the inlet of a domain. My solver is made of an advective-diffusive equation :

Code:

fvScalarMatrix TEqn
(
fvm::ddt(T) + fvm::div(phi,T) -fvm::laplacian(DT,T)
);

I know that I can get the corresponding flux from TEqn.flux()
Code:

surfaceScalarField phiT = TEqn.flux();
How can I impose a value to this flux at the inlet of my domain ? In that case, the BC velocity is non-zero and consequently the usual trick using fixedGradient can't work. I thought of something like
Code:

phiT.boundaryField()[patchID] == Q;
but this doesn't work (of course...)

May be something like
Code:

  (TEqn.flux()).boundaryField()[patchID] == Q;
(but it doesn't compile...)

Is anybody has an idea ??

Best regards,
Cyp

CedricVH March 28, 2012 10:18

Giving a calculated value to a boundary can be achieved using the codedFixedValue boundary condition (http://www.openfoam.org/version2.0.0...me-control.php).

Cyp March 28, 2012 13:05

Thank you for your reply.

Indeed I read the information about codedFixedValue, but I do not know how this can satisfy my request..

I think that imposing a flux should be a very easy thing in finite volume method..

Arnoldinho May 22, 2012 15:04

Hi Cyprien,

any progress so far? I'm struggling with the same problem for a couple of days now, but also have not yet found a way of directly imposing a flux. I need a flux and zero-flux boundary condition, but within the solver.

So far, in my case I could manage it with a source/sink term in the patch nearest cells, but that is not exactly what I wanted.

Greeting,
Arne


All times are GMT -4. The time now is 03:39.