CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Boundary Conditions & Vector PDE solving (http://www.cfd-online.com/Forums/openfoam-solving/89585-boundary-conditions-vector-pde-solving.html)

 Tanay June 16, 2011 23:03

Boundary Conditions & Vector PDE solving

Hello Foamers,
After learning the basics of OpenFOAM and its programming, I have two questions-
1. We need to specify the boundary condition of every defined field variable (p, U, temp, conc) at every patch in the 0/ directory. What happens if we do not know the BC beforehand?
For example, if I'm writing a solver for laminar mixing of two species, one with conc=0 and the other with conc=1mol/m3 (at their respective inlets), what boundary conditions should I give for concentration at the walls and the outlet? zeroGradient doesn't help and fixedValue isn't possible.

2. For basic solvers (like laplacian, potential and scalarTransport PDEs), I've observed that the code is simply the euqtion statement solve(...==...); iterated a number of times with the controls being set by SIMPLE. But of course, for a vector equation like Navier-Stokes, the method is longer (predictor PEqn some n times- then corrector). So, if we have to code a scalar equation coupled to a vector
e.g.- ddt(C) == laplacian(diff,C) - div(C,U) where U is the velocity vector
will writing this equation statement in the outer loop of corr suffice to solve it?
What if we wish to write another vector equation?

 Tanay June 21, 2011 23:31

Ok, I guess it'll help if I write down my specific problem.
I'm solving a pipeflow with two inlets, flowInlet has water coming in, minorInlet has ethanol (or any other miscible liquid) coming in at a right angle downwards. flowOutlet is the exit for the mixed flow. I'm trying to model this using a 'tampered' version of icoFoam.

So, here are the boundary conditions-
0/conc-
boundaryField
{
flowOutlet
{
}
flowInlet
{
type fixedValue;
value uniform 0;
}
minorInlet
{
type fixedValue;
value uniform 10;
}
walls
}

0/p-
boundaryField
{
flowOutlet
{
type fixedValue;
value uniform 1e+05;
}
flowInlet
{
}
minorInlet
{
}
walls
}

0/U-
boundaryField
{
flowInlet
{
type fixedValue;
value uniform (5 0 0);
}
flowOutlet
{
}
minorInlet
{
type fixedValue;
value uniform (0 -1 0);
}
walls
{ type fixedValue;
value uniform (0 0 0);
}
}

To icoFoam, I've added this equation in the main PISO loop-
solve
(fvm::ddt(conc) == fvm::laplacian(diff,conc) - (U & fvc::grad(conc)));
and set the variable conc and constant diff without any wmake compilation errors.
So, the mistake lies primarily in the boundary conditions I've set.
Are these boundary conditions correct?
On running the case I get the output that U is 0 for the outlet, p is constant everywhere and conc is 0 everywhere.
Also, does anyone have a simple pipeflow case with the correct boundary conditions for me to read and understand?

 santiagomarquezd June 22, 2011 10:22

1 Attachment(s)
Tanay, I've attached a coupled solver for p-U-T, which was programmed following a tutorial (I think it is this one: http://www.tfd.chalmers.se/~hani/kur...ngTutorial.pdf). Excuse me for the Spanish comments, nevertheless you will be able to understand anyway. BC's you've posted are correct. So try and tells us how things have gone.

Regards.

 Tanay June 23, 2011 01:10

Santiago,
He programado icoScalarTransport ya. Pero gracias por la ayuda. Yo no estaba funcionando correctamente Paraview en el caso de la concentración. Que acaba de añadir la ecuación de la temperatura para el circuito PISO exterior. Me pregunto si esto funciona incluso si queremos resolver algunos otros PDE con un volVectorField. Estoy trabajando en que en la actualidad.

 santiagomarquezd June 23, 2011 07:16

Tanay, I can't understand at all what are you referring to with coupling a volVectorField. Solving ddt(C) == laplacian(diff,C) - div(C,U) and U at the same time is exactly what icoScalarTransportFoam does.

Regards.

 All times are GMT -4. The time now is 04:21.