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

Solving Poisson's equation in OpenFoam

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

Reply
 
LinkBack Thread Tools Display Modes
Old   August 28, 2014, 12:13
Default Solving Poisson's equation in OpenFoam
  #1
New Member
 
Shakil Masum
Join Date: Aug 2014
Posts: 10
Rep Power: 3
Shakil Masum is on a distinguished road
Dear All,

I want to solve the Poisson Equation:

solve(fvm::laplacian(H) == Constant)

I am using laplacianFoam solver. The problem is I am getting errors during compilation. The problem is the Constant value. The equation statement does not recognise any constant value.

I have tried to do it according the Section 2.4 of Programmers Guide of OpenFOAM but to do that I need to create a volScalarField for Constant which is not sensible as I have to give input for Constant in "0" folder as well which is irrelevant.

Can anyone please help me regarding this issue.

Many thanks in advance.
Shakil Masum is offline   Reply With Quote

Old   August 29, 2014, 04:56
Default
  #2
Member
 
Join Date: Nov 2012
Posts: 57
Rep Power: 4
Henning86 is on a distinguished road
you need to create a volScalarField with a constant value:

volScalarField Constant
(
IOobject
(
"Constant",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar("0", dimensionSet(0, 2, 0, 0, 0, 0, 0), 0),
"zeroGradient"
);

or

volScalarField p_rgh
(
IOobject
(
"p_rgh",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
),
mesh
);

the last on requires an input in the 0 Dictionary
Henning86 is offline   Reply With Quote

Old   August 29, 2014, 10:22
Default Thanks Henning
  #3
New Member
 
Shakil Masum
Join Date: Aug 2014
Posts: 10
Rep Power: 3
Shakil Masum is on a distinguished road
Hi Henning,

Thanks a lot for your reply. I have tried with the 1st approach and it worked !!! Thanks again.

As this is new to me, I have some questions to clarify the statements/ syntax of programming:

A)
dimensionedScalar("0", dimensionSet(0, 2, 0, 0, 0, 0, 0), 0), - I have modified it as:

dimensionedScalar("constant", dimensionSet(0, 2, 0, 0, 0, 0, 0), -6.5), - because, I have defined the variable as "constant" which has a value of -6.5. is this correct?

B)
"zeroGradient" - I am not sure about it. Is it a boundary condition of the constant scalar Field?

Much appreciated.
Shakil
Shakil Masum is offline   Reply With Quote

Reply

Tags
constant, laplacianfoam, poisson equation

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
conjugate heat transfer in OpenFOAM skuznet OpenFOAM Running, Solving & CFD 65 August 16, 2015 14:34
a problem with convergence in buoyantSimpleFoam skuznet OpenFOAM Running, Solving & CFD 5 February 19, 2014 05:30
rhoSimplecFoam Mach0.8 no pressure values CFDnewbie147 OpenFOAM Running, Solving & CFD 16 November 23, 2013 06:58
Micro Scale Pore, icoFoam gooya_kabir OpenFOAM Running, Solving & CFD 2 November 2, 2013 14:58
High Courant Number @ icoFoam Artex85 OpenFOAM Running, Solving & CFD 9 January 3, 2012 09:06


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