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

Error: undefined in dictionary ...fvsolution.solvers

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By alexeym

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 5, 2017, 23:24
Default Error: undefined in dictionary ...fvsolution.solvers
  #1
New Member
 
Lieh
Join Date: Mar 2017
Posts: 26
Rep Power: 9
akesm is on a distinguished road
Hello

I have coded a new solver based on interFOAM, the new solver gets wmake(ed) fine, no errors. When I want to run a case with the solver I get the error as

--> FOAM FATAL IO ERROR:
keyword H is undefined in dictionary "/home/Dropbox/OpenFoam/system/fvSolution.solvers"

file: /home/Dropbox/OpenFoam/system/fvSolution.solvers from line 22 to line 63.

From function const Foam::dictionary& Foam::dictionary::subDict(const Foam::word&) const
in file db/dictionary/dictionary.C at line 642.

FOAM exiting

I am confused since "H" should not appear in my "fvsolution" file, it is just a parameter coded in my solver, so I believe there should not be a requirement for a keyword as H.

Can you give me a hint on how to find the problem and resolve the issue?

If you want I can even send you the new solver that I have written for your review.

Thanks
akesm is offline   Reply With Quote

Old   June 6, 2017, 14:58
Default
  #2
New Member
 
Lieh
Join Date: Mar 2017
Posts: 26
Rep Power: 9
akesm is on a distinguished road
Actually now I just define H in the "fvsolutions" similar to say "U" as
Code:
H
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance       1e-06;
        relTol          0;
    }
And my modified solver works fine.

My surprise is that, why there should be the need for defining H, because H in my solver is not solved actually and it is defined, it is basically a Heaviside function, so no need for specifying solver.

Probably I have messed up somewhere and that's why OF considers H as a parameter that needs to be solved, but I cannot find out where I have made this mistake.

Any hints helping to find this bug would be appreciated.

Thanks
akesm is offline   Reply With Quote

Old   June 6, 2017, 17:28
Default
  #3
Member
 
Lilian Chabannes
Join Date: Apr 2017
Posts: 58
Rep Power: 9
Lookid is on a distinguished road
Hi,

Far from being an expert , did you set up H in createFields ? How is it coded in the solver.C file ?
Lookid is offline   Reply With Quote

Old   June 6, 2017, 22:07
Default
  #4
New Member
 
Lieh
Join Date: Mar 2017
Posts: 26
Rep Power: 9
akesm is on a distinguished road
in createfields.H it is as
Code:
Info<< "Reading field H\n" << endl;
    volScalarField H
    (
        IOobject
        (
            "H",
            runTime.timeName(),
            mesh,
            IOobject::NO_READ,
            IOobject::AUTO_WRITE
        ),
        mesh,
        dimensionedScalar("H",dimless, 0.0)
    );
and in the solver.C it is as
Code:
// update Heaviside function
   forAll(mesh.cells(),celli)
   {
      if(psi[celli] < -epsilon.value())
         H[celli] = double(0);
      else if(epsilon.value() < psi[celli])
         H [celli] = double(1);
      else
         H[celli] = double(0.75);
   };
So not a magic behind, I don't know why it needs sth to be specified for it in the solver!
akesm is offline   Reply With Quote

Old   June 7, 2017, 03:37
Default
  #5
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi all,

@akesm

And these are the only additions you have made? Is there a possibility that as a result of copy-paste you have another field named H in registry for which you actually solve linear equation? (variable name for the field in your solver could be named differently).
alexeym is offline   Reply With Quote

Old   June 7, 2017, 17:54
Default
  #6
New Member
 
Lieh
Join Date: Mar 2017
Posts: 26
Rep Power: 9
akesm is on a distinguished road
Thanks for your reply.

But my new solver is based on interFoam, which does not have any field named as H, so I barely think that my introduced parameter H is being mistaken with an already existing field named as H.

If it helps I can post, or upload either my solver or the changes I have made!
akesm is offline   Reply With Quote

Old   June 7, 2017, 18:10
Default
  #7
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Well, it YOU, who has strange behaviour of new solver. So it is up to YOU to decide either you are happy with small addition to fvSolution file, or you would like to resolve this problem. Either the thread can be closed, or you post a link to your repository with code, so people can take a look and figure out why OpenFOAM(TM) needs addition to solvers dictionary in fvSolution file (and maybe propose solution).
akesm likes this.
alexeym is offline   Reply With Quote

Old   June 7, 2017, 18:25
Default
  #8
New Member
 
Lieh
Join Date: Mar 2017
Posts: 26
Rep Power: 9
akesm is on a distinguished road
Now when I am looking carefully, at a point of my code I give H to explicit solve in the way below
Code:
    MULES::explicitSolve(H, phi, phiH, 1, 0);
I think this is the reason, that like alpha in the interFoam solver for H should be specified as well.
akesm is offline   Reply With Quote

Reply

Tags
fvsolutions, openfoam 4.0.0


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
ill defined primitiveEntry starting at keyword 'value' on line 197 ChangeDictionary Struggle_Achieve OpenFOAM Pre-Processing 2 December 20, 2017 04:58
Including lists in a dictionary. Divyaprakash OpenFOAM Programming & Development 0 June 18, 2015 07:14
New Boundary Condition: Reading Dictionary Problem Koga OpenFOAM Programming & Development 0 November 26, 2012 06:01
Problem with rhoSimpleFoam matteo_gautero OpenFOAM Running, Solving & CFD 0 February 28, 2008 07:51
FoamX error aachenBomb case Ervin Adorean (Adorean) OpenFOAM Pre-Processing 13 March 7, 2005 04:50


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