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

Concentration Modification to ScalarTransportFoam: Ptr unallocated Issue

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 5, 2019, 16:47
Default Concentration Modification to ScalarTransportFoam: Ptr unallocated Issue
  #1
New Member
 
Join Date: May 2018
Posts: 4
Rep Power: 5
Braedan is on a distinguished road
To begin i apologize if im unaware for many things as im not that most knowledgeable of everything on openfoam and all of its source code.
I am attempting to modify the ScalarTransportFoam solver for a diffusion of a particular ion concentration. The equation that i need to solver for is;
d/dt (C) = - Div(N) + R;
Where N is the mass transfer flux depending on C
And R is the reaction rate depending on C also.
I have gotten the solver to be able to run only by writing the equation in terms of the time partial derivative of C and the laplacian of C rather than even using the mass transfer flux. Although i should be solving that term explicitly.
Ie. fvm::ddt(C) == -fvm::laplacian(C) + fvOptions;
Does run but obviously not as i want it to.
But i couldnt solve the laplacian explicitly.
fvm::ddt(C) == -fvc::laplacian(C) + fvOptions;

As it gave me the error:
--> FOAM FATAL ERROR:
lowerPtr_ or upperPtr_ unallocated

From function const scalarField& Foam::lduMatrix::lower() const
in file matrices/lduMatrix/lduMatrix/lduMatrix.C at line 269.

Eventually i went to solve the issue with using the mass transfer flux, which is a different issue in its own. Although i came across the same error using;
fvm::ddt(C) == -fvc::div(N) + fvOptions(C);

So i assumed that using this equation (inside fvScalarMatrix), is causing an issue with creating the coefficients of the matrix and therefore a part or all of the matrix is unallocated. I could not seem to find a solver that solved a simple case with only one implicit variable on the LHS, so im not exactly sure how to approach this issue. Ive been stuck for about a month on this issue so any suggestions would be great.
Thank you!
Attached Images
File Type: png Capture.PNG (7.0 KB, 9 views)

Last edited by Braedan; November 5, 2019 at 16:52. Reason: Grammer
Braedan is offline   Reply With Quote

Old   November 6, 2019, 09:58
Default
  #2
Senior Member
 
Lucky Tran
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 4,294
Rep Power: 51
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
What OpenFOAM are you using? If very old, it can be an old bug. Otherwise, there's just not enough info to determine what's wrong except we can 100% your solver will not work.


Quote:
Originally Posted by Braedan View Post
So i assumed that using this equation (inside fvScalarMatrix)
What this means? You mean you are declaring a tmp<fvScalarMatrix>? Because that might break it.
LuckyTran is offline   Reply With Quote

Reply

Tags
ptr_unallocated, scalartransportfoam

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
scalarTransportFoam issue with dynamic meshes Thangam OpenFOAM Programming & Development 5 August 18, 2015 15:52


All times are GMT -4. The time now is 05:59.