CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   Mapping Field Data for Mesh Regions from Another Simulation (https://www.cfd-online.com/Forums/openfoam-pre-processing/203916-mapping-field-data-mesh-regions-another-simulation.html)

veterator July 10, 2018 05:55

Mapping Field Data for Mesh Regions from Another Simulation
 
Hi Everyone,

I am working on a quiet academic case but I got stuck: my goal is to simulate a single rising bubble (e.g. with interFoam) in decaying homogeneous, isotropic turbulence. The domain is a simple cubic block. The turbulence is calculated in a precursor simulation (also in a cubic block domain, fully periodic BCs and linear forcing, a mean velocity is applied with meanVelocityForce). So far this works fine.

My problem now is the following: I need to get the fully transient velocity data from the precursor simulation to "flow" into the inlet of the actual simulation. As this problem is still single phase everything from now on can be done with any incompressible solver, e.g. pimpleFoam.

I tried transferring the turbulence from a patch of the precursor simulation to the inlet patch of the actual simulation with timeVaryingFixedValueFvPatch. The transferred patch data are correct but it leads to heavy oscillations right after the inlet. So the turbulence is not transferred correctly. It seems that this problem cannot be tackled with boundary conditions only. (As this is a 2nd order method, I would need at least two layers of cell data to be transferred).

So I switched to a different approach: I transfer the velocity field data for every time step (very large amount of data!) from the precursor simulation to the actual simulation via mapFields and rename it: U -> Uturb. The latter is read in every single time loop in the actual simulation (yes, it takes some time). I add a forcing term to the momentum equation (rhs):

a\frac{U_{turb} - U}{\Delta t}


Code:

    ...
==

  + IFweight*Uturb/runTime.deltaT()
  - fvm::SuSp(IFweight/runTime.deltaT(), U);

where IFweight (a) is a volScalarField, which is (with setFields) set to 1 in the vicinity of the inlet and 0 elsewhere. This forces U to be nearly identical to Uturb in the selected region - so far so good.

I want to reduce the amount of data I have to save in the precursor simulation and I need to transfer. My idea was to create meshRegions/cellZones (what is the difference?) with topoSet (where IFweight is 1 at the moment) and to only map the velocity data for the part of the mesh. mapFields provides the options to select source- and targetRegion. I probably need topoSet for this. Do I need to splitMeshRegions for every single time step in the source (precursor) simulation and in the target (actual) simulation? Do I really have to change the startTime in controlDict for every time step I want to map (it may be done with sed -i). Is there any way to do that with standard OpenFOAM tools? Maybe with a limited amount of commands for all time steps or do I need to (bash) script this to loop over the time steps?

I hope, the description is clear enough. I appreciate your help.

Thanks, veterator


Comment:
Both meshes may have different resolutions.

veterator July 10, 2018 06:28

1 Attachment(s)
Please, find a sketch of the problem attached.


All times are GMT -4. The time now is 07:30.