|
[Sponsors] |
mapFields functionObjects between two different cases |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 2, 2020, 05:51 |
mapFields functionObjects between two different cases
|
#1 |
New Member
Thomas
Join Date: Jul 2018
Posts: 16
Rep Power: 8 |
Hello Foamers.
I am running pimpleFoam on a domain composed of an unmeshed box (called box) surrounded by 6 patches (namely inlet, outlet, top, bottom, emptyFaces). I have access to the pressure field on the patch as a surfaceScalarField on the box patch. I am also running an in-house OpenFOAM solid solver on a box domain (also called box) that has the same cartesian coordinates than the box in the first case. I want to map the pressure field from the first case to that second case. As a first attempt, I wrote a coded functionObject that writes the pressure values on the box patch of the first case (it is a surfaceScalarField even if it is saved as a simple scalarField). The problem is the box patch from the first case has a different number of points than the box patch from the second case, and most likely the points are organised in a different way. Code:
label patchID = mesh().boundaryMesh().findPatchID("box"); IOField<scalar> pOut ( IOobject ( "pBox", mesh().time().timeName(), mesh(), IOobject::NO_READ, IOobject::NO_WRITE ), p.boundaryField()[ patchID ] ); Code:
/*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 7 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object mapFieldsDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // patchMap ( box box); cuttingPatches (); // ************************************************************************* // Code:
mapFields ../Fluid -case . -sourceTime 0.1 Code:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Source: "/mnt/datasim/OpenFOAM/solvers/test" "Fluid" Target: "/mnt/datasim/OpenFOAM/solvers/test" "Solid" Create databases as time Source time: 0.1 Target time: 0.25 Create meshes Source mesh size: 2400 Target mesh size: 300 Mapping fields for time 0.1 interpolating p End HTML Code:
Note: For testing purpose, I made both cases run until 0.25 which is probably my target is 0.25. It is not my main concern at the moment because eventually, I want to perform this mapping at every (written) timestep. EDIT: I use OpenFOAM-6 on Debian. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
running mapFields in parallel | mkhm | OpenFOAM Pre-Processing | 10 | September 16, 2021 14:12 |
Personalization of mapFields and libsampling - Compilation issues | saimat | OpenFOAM Programming & Development | 3 | June 29, 2016 09:56 |
Strange random behaviour of mapFields | blaise | OpenFOAM Pre-Processing | 0 | November 3, 2014 10:37 |
How to speed up the simulation of a large amount of similar steady state cases | tss | Main CFD Forum | 4 | November 5, 2010 15:36 |
Variable deltaT and functionObjects | henrik | OpenFOAM Bugs | 8 | July 22, 2009 05:11 |