CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Inject tracer within the simulation volume via fvOptions (https://www.cfd-online.com/Forums/openfoam-solving/183650-inject-tracer-within-simulation-volume-via-fvoptions.html)

sisetrun February 9, 2017 09:31

Inject tracer within the simulation volume via fvOptions
 
Hello everybody,

I am struggeling with fvOptions in OF2.3.x . I want to use a cellZone as a source of tracer T and solve the equations with scalarTransportFoam on a steady simpleFoam velocity field. I have tube and an obstacle, so I do not want to inject the tracer at the beginning of the tube but right before the obstacle. I want to use the source more or less as a internal "inlet-patch" for the tracer. Values should be 1 in the source and after a while in the whole domain after the source (just like with the fixedValue inlet BC for scalarTransportFoam).

I made the cellZone, set up the fvOptions file like this:

Code:

tracer
{
  type scalarSemiImplicitSource ;
  active on;
  timeStart 0;
  duration 10000;
  selectionMode cellZone;
  cellZone Tracer;

  scalarSemiImplicitSourceCoeffs
  {
      volumeMode absolute; //implicit
      injectionRateSuSp
      {
        T (1 0);
      }
  }
}

I end up with very high values of T around 5.4e4.

Is the source of 1 mole / itteration added to the domain every time step?

Can I set a fixedValue BC for fvOption like in inletBC?


Every help is thankfully appreciated. Thank you

Best regards,

Sebastian

sisetrun February 10, 2017 03:27

FYI:

I managed the problem in a different way...

Copied the scalarTransportFoam and added the following:

Code:

    // Reading from the tracerInletDict from constant folder
    Info<< "\n*** Detecting injection Plane from tracerInletDict in control directory***\n" << endl;
    Info<< "Z position is " << z_position << endl;
    Info<< "Deviation is " << deviation << endl;

    // List to store the indices of the matching mesh.C()
    DynamicList<label> tracer_location(0);
   
    // Extract all Cells which are in the proper range
    forAll(mesh.C(), idx)
    {
      if (mesh.C()[idx].component(2) >= (z_position.value() - deviation.value()))
          if (mesh.C()[idx].component(2) <= (z_position.value() + deviation.value()))
          {
              tracer_location.append(idx);
          }
    }

    // solver loop
    while (simple.loop())
    {
        Info<< "Time = " << runTime.timeName() << nl << endl;
   
        while (simple.correctNonOrthogonal())
        {
          // set the T value of proper cells to 1
          forAll(tracer_location,tracer_idx)
            {
                T[tracer_location(tracer_idx)] = 1;
            }
           
            solve
            (
                fvm::ddt(T)
              + fvm::div(phi, T)
              - fvm::laplacian(DT, T)
            ==
                fvOptions(T)
            );


sisetrun February 16, 2017 03:42

I have to open the question again...

My proposed solution worked fine on one core.
When I run the simulation on a HPC, I can not use my approach.

Does anybody have an idea how to run the code in parallel? Or an idea of a different solution?

Thanks a lot,

Best regards

Lucky August 16, 2021 05:20

Injecting a tracer from a patch inside a geometry
 
Hallo Foamers, i am new to OpenFoam, i am trying to calculate the RTD over a small section of porous media. This means that i have ti inject my tracer at some plane inside the geometry, to do this, i created an inside patch using topoSet and createBaffles, when i then impose the tracer inlet boundary condition on that boundary condition, my scalarTransportFoam simulation diverges within the first two timesteps. i read one thread mentioning the use of fvOptions, i have never used that before, i need help. While i am still at that. I am using OF9 and it got rid of fvOptions and introduced fvModels and fvConstraints instead. i need help on how i can set up my ksimulation to be able to inject this pulse tracer at an inside zone or patch


Best regards


Lucky


All times are GMT -4. The time now is 15:59.