adding source term to interDyMFoam
2 Attachment(s)
I am new in openFoam programming.
I am going to add a source term in momentum equation in interDyMFoam which equation is shown in the picture. as you can see there are different term which are in x and y directions ,the most important thing is the source term should be actived for x>x1 which x1 is an specific location in domain and the source term is dependent on x. Is there any idea? thanks a lot :) |
You could set a field name alphaSources, which should be 0 where you don't want to have the sources terms, and 1 if you want to have de sources. This can be done with groovyBC or funkySetFields , and you'll need to modify the createFields.H in the solver to read the new field
After that just multiply sources*alphaSources, taking care that both have the same type definition. You may have to play a bit with it. |
thanks, its seems to be a good idea...
the variable Ca which defined in the picture is dependent to x. does openfoam recognize the x??? or should we have to define the x?? if yes how??? |
Quote:
|
Have a look at fvOptions. I would select all relevant cells via a cellZone and then code my own fvOption, which can be added to the solver at runtime. If you hardcode that into the solver, you have to recompile it and have your own custom solver, which is not as versatile as the fvOptions approach.
|
thanks for your attention
should I use funky set field in order to define two conditional function ? how can I define two conditions in funkysetfields? In all of examples which I have seen just one condition were set. thanks in advance |
All times are GMT -4. The time now is 17:48. |