fvOptions for scalar source term #650
uttamcadambi07
started this conversation in
General
Replies: 2 comments 1 reply
-
Do you want to add this source term to the U equation or the T equation? If the former, you should add it as the first component of the fvSource term in UEqn. If the later, you need to add a fvSourceT term into TEqn in DASimpleTFoam. DAFoam should support fvOption, but the fvOption is not in TEqn of DASimpleTFoam. |
Beta Was this translation helpful? Give feedback.
1 reply
-
In this case, you can do a dirty workaround by adding another source term called fvSource1 into the T equation. Then, you can prescribe the driving source term for fvSource1. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
My goal is to add a point source of scalar in my domain and use
runPrimal
option in DAFoam to run the case (my ultimate goal is optimization but let us start with this simple case)The test case is a very simple cylinder flow with a circular cylinder placed in a domain at Reynolds number = 150. The incoming flow is U = 1m/s and we use a SpalartAllmaras turbulence model to get the mean flow fields.
Now this is straightforward, everything converges well.
I want to now introduce a scalar source of constant strength to this domain. I want to introduce it along a constant line JUST after the inlet patch.
I do it using my
controlDict
file which goes like thisOf course i run topoSet to set the cells that will hold this scalar source (which is seen as
cellZone source1
).When I run this case in OpenFOAM, I get something like this

This is expected and physical - the scalar is swept away by the flow and diffuses throughout the domain following the fluid velocity.
Now when I try to do the same thing with DAFoam, my solver exits in 1 iteration.
The scalar residual is 0 (which is because i set the inlet patch to be fixedValue 0) BUT I have set the cellZone to contain the scalar strength of 5 units from t = 0. Which means the scalar field is not uniformly 0 at t = 0, it has a non-zero value along a thin line which is located just downstream of the inlet patch (if you look closely you can see it in the attached figure above).
So this means that DAFoam is not able to pick up the source initialized through fvOptions. Why is this the case? Here is the source code from DASimpleTFoam
is it because there is no fvOptions?
So to circumvent the problem , I set the inlet patch to be 0.01 and the internalField of the scalar to be 0.01
This is to ensure that the residual at t = 1 is not zero and the solver does not exit.
I get this
Please can you tell me how to fix this issue?
Beta Was this translation helpful? Give feedback.
All reactions