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

Convection–diffusion equation solver

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 24, 2010, 16:24
Default Convection–diffusion equation solver
  #1
Senior Member
 
Daniele
Join Date: Feb 2010
Posts: 134
Rep Power: 16
Daniele111 is on a distinguished road
Hi
I would create my solver for convectio-diffusion equation:

Where v field is know. Where should I star to solve this problem? How can I create OpenFoam code? I would use simpleFoam to calculate U field and join simpleFoam solver with my solver to have only one solver to calculate scalar field c.
Thanks


Daniele111 is offline   Reply With Quote

Old   November 25, 2010, 05:25
Default
  #2
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29
akidess will become famous soon enough
Your problem is pretty much equivalent to this one: http://openfoamwiki.net/index.php/Ho...ure_to_icoFoam. Just instead of adding the equation to icoFoam, do so with simpleFoam.
akidess is offline   Reply With Quote

Old   November 25, 2010, 06:40
Default
  #3
Senior Member
 
Daniele
Join Date: Feb 2010
Posts: 134
Rep Power: 16
Daniele111 is on a distinguished road
Thanks
Perfect, but in simpleFoam (or pisoFoam) where I add this line:

dimensionedScalar nu ( transportProperties.lookup("nu") );

for my scalar transport properties?
Daniele111 is offline   Reply With Quote

Old   November 25, 2010, 09:54
Default
  #4
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29
akidess will become famous soon enough
I would add the following code to createFields.H:

Code:
Info<< "Reading transportProperties\n" << endl;

IOdictionary transportProperties
(
    IOobject
    (
        "transportProperties",
        runTime.constant(),
        mesh,
        IOobject::MUST_READ,
        IOobject::NO_WRITE
    )
);

dimensionedScalar DC
(
     transportProperties.lookup("DC")
);

Info<< "Reading field C\n" <<endl;
volScalarField C
(
    IOobject
    (
         "C",
         runTime.timeName(),
         mesh,
         IOobject::MUST_READ,
         IOobject::AUTO_WRITE
     ),
     mesh
);
akidess is offline   Reply With Quote

Old   November 25, 2010, 10:04
Default
  #5
Senior Member
 
Daniele
Join Date: Feb 2010
Posts: 134
Rep Power: 16
Daniele111 is on a distinguished road
Yes I just do it.
Then I would join electrostaticFoam with my_simpleFoam, so I'll modify createFieds.h and my_simpleFoam.c adding electrostaticFoam. It's correct?
But can I impose different boundary condition on the same patch? Example:
symmetryPlane for potential (for electric fields) and
zeroGradient for U (Velocity fields)

Thanks
Daniele111 is offline   Reply With Quote

Old   November 26, 2010, 06:21
Default
  #6
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29
akidess will become famous soon enough
Yes, of course boundary conditions are separate for every field. Otherwise you'd have a tough time even simulating a lid driven cavity
akidess is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Transport equation in chtMultiRegionSimpleFoam solver Aurelien Thinat OpenFOAM Programming & Development 19 April 11, 2012 07:35
Getting too many iterations by velocity solving (aborting). Changing U - Solver? suitup OpenFOAM Running, Solving & CFD 0 January 20, 2010 08:45
Solver Equations Carola CFX 9 August 12, 2003 09:27
compressible two phase flow in CFX4.4 youngan CFX 0 July 2, 2003 00:32
parallelized equation solver suan Main CFD Forum 1 August 16, 2002 05:51


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