Hello,
I am trying to modify the potentialFlux solver to incorporate a source term, but I have problems to get it to work properly. I am trying to define a problem in which a unit rectangular domain contains a small source in the middle and has an outflow at one side. After searching through the OpenFoam forums I have tried the following solution :
The solution converges, but if I plot the distribution of p, it seems that the source is not in the middle but shifted to one side. I also tried:
for nonOrth in range(nNonOrthCorr + 1):
pEqn = ( ref.fvm.laplacian(unity_term, p) == source_term )
pEqn.setReference( pRefCell, pRefValue )
pEqn.solve()
but that gave me the same result. Does anyone know what I am doing wrong? Is what I am doing the proper way to add an explicit source term or should I do this differently?
thanks for any feedback,
Hon Fai
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I am trying to modify the potentialFlux solver to incorporate a source term, but I have problems to get it to work properly. I am trying to define a problem in which a unit rectangular domain contains a small source in the middle and has an outflow at one side. After searching through the OpenFoam forums I have tried the following solution :
I have added this code after the call to '_createFields(runTime, mesh, potentialFlow, args)'.
I then modify the equation as:
The solution converges, but if I plot the distribution of p, it seems that the source is not in the middle but shifted to one side. I also tried:
but that gave me the same result. Does anyone know what I am doing wrong? Is what I am doing the proper way to add an explicit source term or should I do this differently?
thanks for any feedback,
Hon Fai