CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

Is it possible to use MapFields while keeping original target field

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 15, 2018, 02:40
Default Is it possible to use MapFields while keeping original target field
  #1
Member
 
Join Date: Oct 2015
Location: Finland
Posts: 39
Rep Power: 11
blttkgl is on a distinguished road
Hey,

Say I have this cube with dimensions 10m in each direction. I create another small box with 1m length and resolve 3D TG vortices with some added random noise so it gives me a pseudo-random turbulence field.

Now I want to map this small box recursively into the big box, starting from bottom corner all the way to the top. Since the small box boundary conditions are cyclic in theory it should give me a fully resolved turbulence field.

In this example I want to put 10*10*10 = 1000 small boxes into the big box, so I wrote a shell script to do that only realize once mapFields is run, it clears the target fields and fully overwrites the source fields.

Code:
# This parameter defines how many boxes you will put in each direction
Lratio=4

n=1
boxSize=1

while [ $n -le $Lratio ]
do
    cd ../boxTurb16
    tranformPoints -translate "($boxSize 0 0)"
    cd ../boxTurb64
    mapFields ../boxTurb16 -consistent

    n=$(( n+1 ))    
done
Is there a way to use this idea by keeping the mapped field from previous iteration safe from getting overwritten? I thought about creating a big box of turbulence from the small ones first and then mapping that field, but I have around 3M cells in the small box, which would add up to 3 BN cells if I want to create the turbulence with a utility like stitchMesh. I don't have the computational resources to handle that sort of data.


Best,

Bulut


EDIT : Well this is embarrassing but I couldn't figure out to delete this thread. I have a typo in "transformPoints" line of my shell script. It actually does not overwrite anything, I was just not careful enough to catch it didn't execute that line in the log files. Just gonna leave this post here so if someone needs to use the same idea they'd see it works.
blttkgl is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
New Solver error Foam::error::printStack upuli OpenFOAM Running, Solving & CFD 4 May 11, 2018 02:43
OpenFOAM floating point Error upuli OpenFOAM Programming & Development 5 June 20, 2016 04:19
mapFields Error with snappyHexMesh Source Added Layers sherif35 OpenFOAM Pre-Processing 0 September 29, 2014 18:01
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 07:20
Problem with rhoSimpleFoam matteo_gautero OpenFOAM Running, Solving & CFD 0 February 28, 2008 07:51


All times are GMT -4. The time now is 13:47.