CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

solve equation

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 30, 2010, 12:09
Default solve equation
  #1
Member
 
Diego Villa
Join Date: Mar 2010
Location: Genova Italy
Posts: 37
Rep Power: 16
DiegoNaval is on a distinguished road
Hi all,
I have a stupid question but I don't find the solution.
I must solve the following equation:
U & grad(eta) - Uz=0
where eta is a scalar field and U is velocity vector and Uz is the z-component of U.

How can I write the scalar matrix etaEqn and solve it?

Thanks.
DiegoNaval is offline   Reply With Quote

Old   November 30, 2010, 13:08
Default
  #2
Senior Member
 
santiagomarquezd's Avatar
 
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 452
Rep Power: 24
santiagomarquezd will become famous soon enough
Hi, Is your U field divergence free [div(U)==0]???, in this case you have

U & grad(eta) - Uz=0 -> div(U eta)-Uz=0

so that in FOAM

solve(fvm::div(phi,eta)-U.component(vector::Z)==0);

where phi is previously defined as phi=U&Sf, like is scalarTransportFoam, icoFoam, etc.

Regards.
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D.
Research Scientist
Research Center for Computational Methods (CIMEC) - CONICET/UNL
Tel: 54-342-4511594 Int. 7032
Colectora Ruta Nac. 168 / Paraje El Pozo
(3000) Santa Fe - Argentina.
http://www.cimec.org.ar
santiagomarquezd is offline   Reply With Quote

Old   November 30, 2010, 13:15
Default
  #3
Senior Member
 
santiagomarquezd's Avatar
 
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 452
Rep Power: 24
santiagomarquezd will become famous soon enough
One more thing, Is your equation dimensionally consistent?

Best.
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D.
Research Scientist
Research Center for Computational Methods (CIMEC) - CONICET/UNL
Tel: 54-342-4511594 Int. 7032
Colectora Ruta Nac. 168 / Paraje El Pozo
(3000) Santa Fe - Argentina.
http://www.cimec.org.ar
santiagomarquezd is offline   Reply With Quote

Old   November 30, 2010, 14:45
Default
  #4
Member
 
Diego Villa
Join Date: Mar 2010
Location: Genova Italy
Posts: 37
Rep Power: 16
DiegoNaval is on a distinguished road
Thank you Santiago Marquez Damian
I solve like you suggest and it works.
Info<<"Inizio calcolo Matrice Eta"<<endl;
faScalarMatrix etaEqn
(
fam::div(phis,eta)
);
Info<<"Inizio Relax"<<endl;
etaEqn.relax();
Info<<"Inizio Solve"<<endl;
solve(etaEqn == (Us & aMesh.faceAreaNormals()));

Dimensionally is consistent because eta is a areaSaclarField and U is a areaVectorField.
But now I have an other problem, I use as linear solver the
eta smoothSolver
{
smoother DILU;
tolerance 1e-06;
relTol 0;
};
and as boundary condition:
in
{
type fixedValue;
value uniform 0;
}
out
{
type zeroGradient;
}
carena
{
type zeroGradient;
}
far
{
type zeroGradient;
}
but after few iteration the solution explode, do you think I make some macroscopical error? I use also a relax factor of 0.3 for the etaEqn.

Thanks.
DiegoNaval is offline   Reply With Quote

Old   November 30, 2010, 14:59
Default
  #5
Senior Member
 
santiagomarquezd's Avatar
 
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 452
Rep Power: 24
santiagomarquezd will become famous soon enough
I don't know, may be you can post the console output at the exploding moment and some data about the physical problem.

Regards.
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D.
Research Scientist
Research Center for Computational Methods (CIMEC) - CONICET/UNL
Tel: 54-342-4511594 Int. 7032
Colectora Ruta Nac. 168 / Paraje El Pozo
(3000) Santa Fe - Argentina.
http://www.cimec.org.ar
santiagomarquezd is offline   Reply With Quote

Old   November 30, 2010, 16:46
Default
  #6
Member
 
Diego Villa
Join Date: Mar 2010
Location: Genova Italy
Posts: 37
Rep Power: 16
DiegoNaval is on a distinguished road
I find the problem is the div shemes, I use a Gauss Linear and all explode, than I change in a Upwind and all works fine!!!

Thank for the help.
DiegoNaval is offline   Reply With Quote

Reply

Tags
equation, solve


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Q: how to solve linear equation dut_thinker FLOW-3D 2 September 2, 2010 23:17
Poisson equation combined with transport equation Se-Hee CFX 0 December 27, 2007 02:00
Solve Poissons Equation Anil CFX 8 September 25, 2007 13:57
How to solve a scalar equation with Fluent Tomik FLUENT 1 January 8, 2006 07:18
how to solve an equation at an interface sreenivas CFX 0 May 14, 2004 10:35


All times are GMT -4. The time now is 16:24.