CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

Boundary Conditions & Vector PDE solving

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   June 16, 2011, 23:03
Default Boundary Conditions & Vector PDE solving
  #1
New Member
 
Tanay Deshpande
Join Date: Aug 2010
Posts: 20
Rep Power: 6
Tanay is on a distinguished road
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 is offline   Reply With Quote

Old   June 21, 2011, 23:31
Default
  #2
New Member
 
Tanay Deshpande
Join Date: Aug 2010
Posts: 20
Rep Power: 6
Tanay is on a distinguished road
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
{
type zeroGradient;
}
flowInlet
{
type fixedValue;
value uniform 0;
}
minorInlet
{
type fixedValue;
value uniform 10;
}
walls
{ type zeroGradient;}
}

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

0/U-
boundaryField
{
flowInlet
{
type fixedValue;
value uniform (5 0 0);
}
flowOutlet
{
type zeroGradient;
}
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.
Please help with any suggestions. :-)
Also, does anyone have a simple pipeflow case with the correct boundary conditions for me to read and understand?
Tanay is offline   Reply With Quote

Old   June 22, 2011, 10:22
Default
  #3
Senior Member
 
santiagomarquezd's Avatar
 
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 418
Rep Power: 14
santiagomarquezd will become famous soon enough
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.
Attached Files
File Type: gz icoScalarTransportFoam.tar.gz (5.1 KB, 10 views)
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D.
Post-doctoral Fellow
Research Center for Computational Mechanics (CIMEC) - CONICET/FICH-UNL
T.E.: 54-342-4511594 Ext. 1005
Güemes 3450 - (3000) Santa Fe
Santa Fe - Argentina
http://www.cimec.org.ar
santiagomarquezd is offline   Reply With Quote

Old   June 23, 2011, 01:10
Default
  #4
New Member
 
Tanay Deshpande
Join Date: Aug 2010
Posts: 20
Rep Power: 6
Tanay is on a distinguished road
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.
Tanay is offline   Reply With Quote

Old   June 23, 2011, 07:16
Default
  #5
Senior Member
 
santiagomarquezd's Avatar
 
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 418
Rep Power: 14
santiagomarquezd will become famous soon enough
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.
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D.
Post-doctoral Fellow
Research Center for Computational Mechanics (CIMEC) - CONICET/FICH-UNL
T.E.: 54-342-4511594 Ext. 1005
Güemes 3450 - (3000) Santa Fe
Santa Fe - Argentina
http://www.cimec.org.ar
santiagomarquezd is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Floating point exception error Alan OpenFOAM Running, Solving & CFD 10 April 6, 2012 14:02
Full pipe 3D using icoFoam cyberbrain OpenFOAM 4 March 16, 2011 10:20
Velocity blows up suddenly after 30,000+ iterations lordvon OpenFOAM 14 October 27, 2010 11:13
lift and drag on ship superstructures vaina74 OpenFOAM Running, Solving & CFD 3 June 8, 2010 12:30
Computational time sunnysun OpenFOAM Running, Solving & CFD 5 March 16, 2009 04:32


All times are GMT -4. The time now is 19:42.