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

simultaneously solve number of diffusion equations

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Henning86

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 26, 2014, 08:21
Default simultaneously solve number of diffusion equations
  #1
New Member
 
Shakil Masum
Join Date: Aug 2014
Posts: 11
Rep Power: 11
Shakil Masum is on a distinguished road
Hi,

I want to solve these equations using OpenFOAM. The diffusion equations are:

dC0/dt = D1 d2/dx2 C0
dC1/dt = D1 d2/dx2 C1 + D2 d2/dx2 C0 (please check the attachment, I have typed them properly in the attachment).

I can solve the equations using Laplacian Foam individually. But, I want to solve both equations simultaneously, I mean in every time steps. The problem is the second equation needs the value of C0 (from first equation) in every time step. What changes are required in laplacianFoam.C and also in the '0', 'constant' and 'system' folders? It will be much appreciated.

thanks
shakil
Attached Images
File Type: png Screen Shot 2014-08-26 at 13.08.35.png (12.6 KB, 43 views)
Shakil Masum is offline   Reply With Quote

Old   August 27, 2014, 06:04
Default
  #2
New Member
 
Alex
Join Date: Apr 2011
Location: München
Posts: 13
Rep Power: 15
al_pr is on a distinguished road
You could try to define your concentrations C1 and C0 as a vector and solve one PDE system instead of two separate PDEs.

That means a volVectorfield instead of a volScalarField in your createFields.H.

Best regards,
Al
al_pr is offline   Reply With Quote

Old   August 27, 2014, 08:59
Default simultaneously solve number of diffusion equations
  #3
New Member
 
Shakil Masum
Join Date: Aug 2014
Posts: 11
Rep Power: 11
Shakil Masum is on a distinguished road
Thanks for your reply al_pr.

But I am worried that you cannot consider C0 and C1 as vectors. These are concentrations which are scalars and direction independent.
Shakil Masum is offline   Reply With Quote

Old   August 27, 2014, 09:45
Default
  #4
Member
 
Join Date: Nov 2012
Posts: 83
Rep Power: 13
Henning86 is on a distinguished road
you could formulate it is explicit.

Equations.
dC0/dt = D1 d2/dx2 C0
dC1/dt = D1 d2/dx2 C1 + D2 d2/dx2 C0 (please check the attachment, I have typed them properly in the attachment).

in OpenFOAM:

C0Eqn
{
fvm::ddt(C0) == fvm::laplacian(D1,C0)
}
C1Eqn
{
fvm::ddt(C1) == fvm::laplacian(D1,C1) +fvc::laplacian(D2,C0)
}
shovon99 likes this.
Henning86 is offline   Reply With Quote

Old   August 27, 2014, 13:07
Default
  #5
New Member
 
Shakil Masum
Join Date: Aug 2014
Posts: 11
Rep Power: 11
Shakil Masum is on a distinguished road
Dear Henning86,

Thanks a lot. I think this is a brilliant idea.

I believe it will also solve the the problem of solving two equations simultaneously in every time step with the updated value of C0 to calculate C1. Am I right to interpret in this way?

Thanks again
Shakil Masum is offline   Reply With Quote

Old   August 29, 2014, 05:02
Default
  #6
Member
 
Join Date: Nov 2012
Posts: 83
Rep Power: 13
Henning86 is on a distinguished road
yes you are right.


As C1Eqn has an explicit term you are limited by the time step.
Henning86 is offline   Reply With Quote

Reply

Tags
diffusion, laplacian


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
timeVaryingMappedFixedValue: large data mapping on complex inlet boundaries vkrastev OpenFOAM Pre-Processing 7 June 2, 2016 15:50
compressible flow in turbocharger riesotto OpenFOAM 50 May 26, 2014 01:47
decomposePar pointfield flying OpenFOAM Running, Solving & CFD 28 December 30, 2013 15:05
AMI interDyMFoam for mixer danny123 OpenFOAM Running, Solving & CFD 4 June 19, 2013 04:49
modify fvMatrix / coupled equations / higher order diffusion Jinming OpenFOAM Programming & Development 0 May 7, 2011 06:20


All times are GMT -4. The time now is 23:15.