|
[Sponsors] |
August 28, 2014, 13:13 |
Solving Poisson's equation in OpenFoam
|
#1 |
New Member
Shakil Masum
Join Date: Aug 2014
Posts: 11
Rep Power: 12 |
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. |
|
August 29, 2014, 05:56 |
|
#2 |
Member
Join Date: Nov 2012
Posts: 83
Rep Power: 14 |
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 |
|
August 29, 2014, 11:22 |
Thanks Henning
|
#3 |
New Member
Shakil Masum
Join Date: Aug 2014
Posts: 11
Rep Power: 12 |
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 |
|
Tags |
constant, laplacianfoam, poisson equation |
|
|
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 |