CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   How to change a term of an equation (http://www.cfd-online.com/Forums/openfoam-solving/59591-how-change-term-equation.html)

dimi July 4, 2007 08:46

Hi I would like to change t
 
Hi

I would like to change the laplacian term in the momentum predictor in sonicFoam.C to get something like :

div( 2*mu (0.5(grad(U)+t.grad(U)) - 1/3*div(U) I) )

Do I have to keep the form of the left-hand side operators : operator(xxx, U) ? like div(phi,U) or can I do something like :

fvc::div(2.0*mu*(symm(fvc::grad(U))-1.0/3.0*fvc::div(U)*I)) ?

When I do that way, I can compile but I can't execute, I obtain this error :

Caught FoamXIOError exception in FoamXCaseServer::main(int argc, char **argv) :
FoamXIOError "Non-optional dictionary entry 'div(2.0*mu*(symm(fvc::grad(U))-1.0/3.0*fvc::div(U)*I))' not found in dictionary\
/home/dbonnet/OpenFOAM/OpenFOAM-1.4/applications/solvers/compressible/nsonicFoam /FoamX/defaults/system/fvSchemes::divSchemes"
File "/home/dbonnet/OpenFOAM/OpenFOAM-1.4/applications/solvers/compressible/nsonicFoa m/FoamX/defaults/system/fvSchemes::divSchemes" starting at line 39 ending at line 44

Thank you

Dimitri

gschaider July 4, 2007 09:08

What you're experiencing is a
 
What you're experiencing is a FoamX-error (it can't find the correct discretization scheme for your expression).

At first. If your solver differs from the original solver, call it differently (for instance: dimitrisSonicFoam). It saves you a lot of confusion later.
As soon as you have done that it won't work with FoamX anymore. Two solutions:
1. Write cfg-files to support your solver in FoamX
2. Use the solver from the command-line (without FoamX)
Solution 2 is easier (really!). The solver WILL complain about missing entries on fvSchemes of your case, but these can be easily added by hand.

Bernhard

dimi July 4, 2007 09:26

Hi Bernhard and thank you for
 
Hi Bernhard and thank you for your answer

I had changed the name of the solver "nsonicFoam" instead of "sonicFoam".
I have tried to change the cfg-files, but it doesn't work, I would like to know if it is because of the attributes of the operator which are not the same than operators used for the rest of the programm.
So do you know how to change the the cfg-files to run the case with FoamX ?

Furthermore, when I use the command-line, I get the error :
--> FOAM FATAL IO ERROR : keyword div(2.0*mu*(symm(fvc::grad(U))-1.0/3.0*fvc::div(U)*I)) is undefined in dictionary "/home/dbonnet/OpenFOAM/dbonnet-1.4/run/tutorials/nsonicFoam/testmarche/system/f vSchemes::divSchemes"

Thank you

Dimitri

gschaider July 4, 2007 09:50

Hi Dimitri! No. I once fidd
 
Hi Dimitri!

No. I once fiddled around with these cfg-files and decided not to do it again if it can be avoided (which doesn't mean that the concept is bad, it's just that I don't use FoamX and it's therefor not worth the effort for me)

Your error: I predicted that in the previous posting. Edit the fvSchemes-file to have an entry in the divSchemes-subdictionary. The format is quite easy to understand (but it is also documented in Chapter 4 of the User Guide)

Bernhard

gschaider July 4, 2007 10:32

<> should be something like li
 
<> should be something like linear/upwind. <> is just a placeholder (for FoamX I think). There is a whole section in chapter 4 dedicated to the discussion of what is valid for fvSchemes (an absolute must-read if you're working outside of FoamX)

dimi July 4, 2007 10:43

Ok thank you I will work again
 
Ok thank you I will work again on that.

jerem February 2, 2012 12:33

Installation de nsonicFoam
 
Bonjour Dimitri

Je suis actuellement A2 à l'ensma et je travaille en projet aéro en soufflerie supersonique avec ton solveur nsonicfoam. je souhaiterai l'installer sur mon portable (qui est sous ubuntu 10.04) et j'ai pour cela récupéré l'archive nsoncifoam que j'ai décompressé dans le dossier compressible du openfoam que j'ai télécharger. arriver au stade d'éxécuter la commande wmake (qui à ce que j'ai pu comprendre créé des liens avec openfoam pour qu'il reconnaisse nsonicFoam comme une commande), j'obtiens le message suivant :
"make: *** Pas de règle pour fabriquer la cible « /opt/openfoam201/src/finiteVolume/lnInclude/newFvPatchField.C », nécessaire pour « nsonicFoam.dep ». Arrêt."

est-ce du au fait que j'ai openfoam 2.01 et que ton solver marchait sur une version précédente? si non, peux-tu m'aider

remarque : j'ai pourtant bien suivi avec rigueur le protocole d'installation que tu avais rédiger dans ton rapport de stage


All times are GMT -4. The time now is 01:29.