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

How to change a term of an equation

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

Reply
 
LinkBack Thread Tools Display Modes
Old   July 4, 2007, 08:46
Default Hi I would like to change t
  #1
New Member
 
dimitri bonnet
Join Date: Mar 2009
Posts: 9
Rep Power: 8
dimi is on a distinguished road
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
dimi is offline   Reply With Quote

Old   July 4, 2007, 09:08
Default What you're experiencing is a
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
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
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   July 4, 2007, 09:26
Default Hi Bernhard and thank you for
  #3
New Member
 
dimitri bonnet
Join Date: Mar 2009
Posts: 9
Rep Power: 8
dimi is on a distinguished road
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
dimi is offline   Reply With Quote

Old   July 4, 2007, 09:50
Default Hi Dimitri! No. I once fidd
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
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
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   July 4, 2007, 10:32
Default <> should be something like li
  #5
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
<> 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)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   July 4, 2007, 10:43
Default Ok thank you I will work again
  #6
New Member
 
dimitri bonnet
Join Date: Mar 2009
Posts: 9
Rep Power: 8
dimi is on a distinguished road
Ok thank you I will work again on that.
dimi is offline   Reply With Quote

Old   February 2, 2012, 12:33
Default Installation de nsonicFoam
  #7
New Member
 
Jérémie BISSON
Join Date: Feb 2012
Posts: 1
Rep Power: 0
jerem is on a distinguished road
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
jerem is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
RANS equation - don't understand a term Micael Boulet FLUENT 3 July 31, 2008 18:32
How to add a source term in u or v equation? luckyluke Phoenics 3 December 13, 2004 03:52
Add source term in species equation zhou1 FLUENT 1 October 21, 2003 06:28
UDF sourse term for VOF equation ROOZBEH FLUENT 5 April 22, 2003 06:56
buoyant term in vorticity equation junomian Main CFD Forum 1 September 17, 2002 05:28


All times are GMT -4. The time now is 10:20.