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

Solving Poisson's equation in OpenFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 28, 2014, 13:13
Default Solving Poisson's equation in OpenFoam
  #1
New Member
 
Shakil Masum
Join Date: Aug 2014
Posts: 11
Rep Power: 12
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, 05:56
Default
  #2
Member
 
Join Date: Nov 2012
Posts: 83
Rep Power: 14
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, 11:22
Default Thanks Henning
  #3
New Member
 
Shakil Masum
Join Date: Aug 2014
Posts: 11
Rep Power: 12
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


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
a problem with convergence in buoyantSimpleFoam skuznet OpenFOAM Running, Solving & CFD 6 November 15, 2017 13:12
conjugate heat transfer in OpenFOAM skuznet OpenFOAM Running, Solving & CFD 99 March 16, 2017 06:07
High Courant Number @ icoFoam Artex85 OpenFOAM Running, Solving & CFD 11 February 16, 2017 14:40
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


All times are GMT -4. The time now is 13:51.