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

mapFields question

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By RodriguezFatz

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 2, 2014, 04:31
Default mapFields question
  #1
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 27
RodriguezFatz will become famous soon enough
Hi all,

I have problems with mapFields. What I want is a fully developed profile at the inlet of my pipe. So in the first case, I run a piece of pipe with cyclic b.c. whose outlet ("PER_PIPE_OUTLET") lies exactly at the inlet ("PIPE_INLET") of my second case.
I created all meshes with ICEM.

Now, the first case runs, everything is fine.
I created a mapFieldsDict in the system directory of my second case that says
Code:
/*--------------------------------*-  C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.1.x                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      mapFieldsDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

patchMap        ( PER_PIPE_OUTLET PIPE_INLET);

cuttingPatches  ( );


// ************************************************************************* //
as proposed here:
http://www.cfd-online.com/Forums/ope...tml#post264825

i run
Code:
mapFields -sourceTime 20630 ../../pipe/k_omega_sst_lowRe/
in the second case directory

and get the error:
Code:
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.3.x                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : 2.3.x-c4208369017e
Exec   : mapFields -sourceTime 20630 ../../pipe/k_omega_sst_lowRe/
Date   : Sep 02 2014
Time   : 09:25:43
Host   : "OptiPlex-990"
PID    : 10141
Case   : /home/mertmann/paddel/ohne_paddel/k_omega_sst_lowRe
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Source: "../../pipe/k_omega_sst_lowRe" ""
Target: "/home/mertmann/paddel/ohne_paddel" "k_omega_sst_lowRe"

Create databases as time
Case   : ../../pipe/k_omega_sst_lowRe
nProcs : 1

Source time: 20630
Target time: 0

Create meshes

Source mesh size: 100320    Target mesh size: 1704096


Creating and mapping fields for time 20630



--> FOAM FATAL ERROR: 
Patch named PIPE_INLET not found.
Available patch names: 
3
(
PER_PIPE_INLET
PER_PIPE_OUTLET
PER_PIPE_WALL
)



    From function polyBoundaryMesh::operator[](const word&) const
    in file meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C at line 1193.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::error::abort() at ??:?
#2  Foam::polyBoundaryMesh::operator[](Foam::word const&) const at ??:?
#3  Foam::meshToMesh::meshToMesh(Foam::polyMesh const&, Foam::polyMesh const&, Foam::meshToMesh::interpolationMethod const&, Foam::HashTable<Foam::word, Foam::word, Foam::string::hash> const&, Foam::List<Foam::word> const&) at ??:?
#4  
 at ??:?
#5  
 at ??:?
#6  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#7  
 at ??:?
Now I thought maybe the inlet and outlet have to be switched at patchMap to
Code:
patchMap        ( PIPE_INLET  PER_PIPE_OUTLET);
Is that true?
Anyway, mapFields runs, but ends with like thousands of errors of

Code:
--> FOAM Warning : 
    From function void Foam::faceAreaWeightAMI<SourcePatch, TargetPatch>::interArea(const label, const label) const
    in file lnInclude/faceAreaWeightAMI.C at line 359
    Invalid normal for source face 4095 points 4((-0.12 0.0063269595 0.0071177674) (-0.12 0.006181312 0.0069427994) (-0.12 0.0066685889 0.0066685869) (-0.12 0.006821461 0.0068214589)) target face 3340 points 4((-0.12 0.0057598517 0.0072441288) (-0.12 0.0062788071 0.0070141595) (-0.12 0.0061003521 0.0067947793) (-0.12 0.0055910177 0.0069954464))
--> FOAM Warning : 
    From function void Foam::faceAreaWeightAMI<SourcePatch, TargetPatch>::interArea(const label, const label) const
    in file lnInclude/faceAreaWeightAMI.C at line 359
    Invalid normal for source face 4095 points 4((-0.12 0.0063269595 0.0071177674) (-0.12 0.006181312 0.0069427994) (-0.12 0.0066685889 0.0066685869) (-0.12 0.006821461 0.0068214589)) target face 3379 points 4((-0.12 0.0062788071 0.0070141595) (-0.12 0.0067880424 0.0067880426) (-0.12 0.0066026062 0.0066026065) (-0.12 0.0061003521 0.0067947793))
    AMI: Patch source sum(weights) min/max/average = 0, 4.5175445, 0.76139568
    AMI: Patch target sum(weights) min/max/average = 0, 4.5097782, 0.71904745
    interpolating k


--> FOAM FATAL ERROR: 
Attempt to cast type patch to type lduInterface

    From function refCast<To>(From&)
    in file /home/mertmann/OpenFOAM/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude/typeInfo.H at line 114.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::error::abort() at ??:?
#2  Foam::lduInterface const& Foam::refCast<Foam::lduInterface const, Foam::fvPatch const>(Foam::fvPatch const&) at ??:?
#3  Foam::cyclicFvPatchField<double>::cyclicFvPatchField(Foam::cyclicFvPatchField<double> const&, Foam::fvPatch const&, Foam::DimensionedField<double, Foam::volMesh> const&, Foam::fvPatchFieldMapper const&) at ??:?
#4  Foam::fvPatchField<double>::addpatchMapperConstructorToTable<Foam::cyclicFvPatchField<double> >::New(Foam::fvPatchField<double> const&, Foam::fvPatch const&, Foam::DimensionedField<double, Foam::volMesh> const&, Foam::fvPatchFieldMapper const&) at ??:?
#5  Foam::fvPatchField<double>::New(Foam::fvPatchField<double> const&, Foam::fvPatch const&, Foam::DimensionedField<double, Foam::volMesh> const&, Foam::fvPatchFieldMapper const&) at ??:?
#6  
 at ??:?
#7  
 at ??:?
#8  
 at ??:?
#9  
 at ??:?
#10  
 at ??:?
#11  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#12  
 at ??:?
Can anyone help me?
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   September 2, 2014, 05:25
Default
  #2
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 27
RodriguezFatz will become famous soon enough
Ok, finally I could get it running, it was some mistake in the /0 folder of the target case. I don't get the final "FOAM FATAL ERROR" any longer, but the warnings remain:

Code:
--> FOAM Warning : 
    From function void Foam::faceAreaWeightAMI<SourcePatch, TargetPatch>::interArea(const label, const label) const
    in file lnInclude/faceAreaWeightAMI.C at line 359
    Invalid normal for source face 4095 points 4((-0.12 0.0063269595 0.0071177674) (-0.12 0.006181312 0.0069427994) (-0.12 0.0066685889 0.0066685869) (-0.12 0.006821461 0.0068214589)) target face 3378 points 4((-0.12 0.0064409587 0.0072134975) (-0.12 0.0069565374 0.0069565377) (-0.12 0.0067880424 0.0067880426) (-0.12 0.0062788071 0.0070141595))
--> FOAM Warning : 
    From function void Foam::faceAreaWeightAMI<SourcePatch, TargetPatch>::interArea(const label, const label) const
    in file lnInclude/faceAreaWeightAMI.C at line 359
    Invalid normal for source face 4095 points 4((-0.12 0.0063269595 0.0071177674) (-0.12 0.006181312 0.0069427994) (-0.12 0.0066685889 0.0066685869) (-0.12 0.006821461 0.0068214589)) target face 3340 points 4((-0.12 0.0057598517 0.0072441288) (-0.12 0.0062788071 0.0070141595) (-0.12 0.0061003521 0.0067947793) (-0.12 0.0055910177 0.0069954464))
--> FOAM Warning : 
    From function void Foam::faceAreaWeightAMI<SourcePatch, TargetPatch>::interArea(const label, const label) const
    in file lnInclude/faceAreaWeightAMI.C at line 359
    Invalid normal for source face 4095 points 4((-0.12 0.0063269595 0.0071177674) (-0.12 0.006181312 0.0069427994) (-0.12 0.0066685889 0.0066685869) (-0.12 0.006821461 0.0068214589)) target face 3379 points 4((-0.12 0.0062788071 0.0070141595) (-0.12 0.0067880424 0.0067880426) (-0.12 0.0066026062 0.0066026065) (-0.12 0.0061003521 0.0067947793))
    AMI: Patch source sum(weights) min/max/average = 0, 4.5175445, 0.76139568
    AMI: Patch target sum(weights) min/max/average = 0, 4.5097782, 0.71904745
    interpolating k
    interpolating omega
    interpolating U

End
Having a look at the result in paraFOam shows the mess:
k_mess.jpg

Does anyone know, what all these "--->FOAM Warning" with "Invalid normal for source face..." means?
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   September 2, 2014, 11:19
Default
  #3
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 27
RodriguezFatz will become famous soon enough
cfd_online_pic.png

I made a sketch of the setup. Maybe that helps.
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   September 3, 2014, 06:10
Default
  #4
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 27
RodriguezFatz will become famous soon enough
Ok, to anyone who get's problems with mapFields: Check whether you installed openFoam 2.3.x. It has a new implementation of mapFields with tons of bugs. I installed 2.2.2 just for mapping. Now it works.
FerdiFuchs likes this.
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   November 20, 2014, 14:07
Default
  #5
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 849
Rep Power: 18
sharonyue is on a distinguished road
Quote:
Originally Posted by RodriguezFatz View Post
Ok, to anyone who get's problems with mapFields: Check whether you installed openFoam 2.3.x. It has a new implementation of mapFields with tons of bugs. I installed 2.2.2 just for mapping. Now it works.
Hello,

I ues ICEM to generate the mesh, and I got the same error with yours. Then I tried with 22x, error again.

Im sure this is not about the field, its about the mesh. Then I tried neglect "-consistent", it works. I dont know why.~

Best,
sharonyue is offline   Reply With Quote

Old   March 24, 2015, 13:17
Default
  #6
New Member
 
Michael
Join Date: Feb 2015
Posts: 18
Rep Power: 11
allett02015 is on a distinguished road
Hello Rodrigez. I try the same thing as you: first I run a simulation with cyclic boundary condiitons and than I want to map the solution to a new simultion. I got the error:

--> FOAM FATAL ERROR:
Attempt to cast type patch to type lduInterface

What did you do to solve your problem?
allett02015 is offline   Reply With Quote

Old   March 25, 2015, 05:52
Default
  #7
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 27
RodriguezFatz will become famous soon enough
Michael, you probably forgot to change the cyclic face in the boundary file of from wall to patch after converting the mesh to openFoam...
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   March 27, 2015, 10:29
Default
  #8
New Member
 
Michael
Join Date: Feb 2015
Posts: 18
Rep Power: 11
allett02015 is on a distinguished road
Hello Phillpp

ok. now I got it almost running if I change the boundary conditions in the cyclic case to e.g. zero gradient. but in the mapped case the zeroGradient bounardy conditions still rimains. Instead I want a noniniform List.

Have you a hint to achieve this?
allett02015 is offline   Reply With Quote

Old   March 30, 2015, 03:29
Default
  #9
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 27
RodriguezFatz will become famous soon enough
Quote:
Originally Posted by allett02015 View Post
but in the mapped case the zeroGradient bounardy conditions still rimains. Instead I want a noniniform List.
Actually I don't understand what you are trying to do.
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   March 30, 2015, 06:41
Default
  #10
New Member
 
Michael
Join Date: Feb 2015
Posts: 18
Rep Power: 11
allett02015 is on a distinguished road
Actually, I have a 2D channel where I impose a constant pressure gradient as source term. In order to get the homogeous solution, I have cyclic boundary conditions in streamwise direction.

After i get a converged solution for this problem, I have a second channel with the same inlet mesh as my periodic problem. For the second channel I want to apply a zero Gradient boundary condition at the outlet.

Now I try the map somehow the solution of the periodic problem to the inlet of my channel where I want to apply the zeroGradient condition at the outlet.

I think it is quite the same problem as you had.
allett02015 is offline   Reply With Quote

Old   March 30, 2015, 07:11
Default
  #11
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 27
RodriguezFatz will become famous soon enough
Ok, now I got it.
Did you do what I wrote in the first posts?
What goes wrong?
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   March 31, 2015, 04:53
Default
  #12
New Member
 
Michael
Join Date: Feb 2015
Posts: 18
Rep Power: 11
allett02015 is on a distinguished road
I don't know exactly what is going wrong.

I had to change the cyclic condition in the blockMeshdict to type patch and also the boundary conditions in the fields (U, p, T etc. ) of my periodic simulation from cyclic to somethion to for example to zeroGradient.

Then the mapField application worked. But unfortunately the application did not write a nonuniform list in my inflow condition.

Now I solved it by using the results of the sample application as inflow condition
allett02015 is offline   Reply With Quote

Old   March 31, 2015, 05:10
Default
  #13
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 27
RodriguezFatz will become famous soon enough
If mappedField run successfully, it overwrites the files in the \0 folder. If you want, you can post the terminal output of your commands and we can try to find the error.
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   March 31, 2015, 06:04
Default
  #14
New Member
 
Michael
Join Date: Feb 2015
Posts: 18
Rep Power: 11
allett02015 is on a distinguished road
Create databases as time
Case : ../kepsilon_periodic_q10_map
nProcs : 1
Source time: 200000
Target time: 200000
Create meshes
Source mesh size: 120 Target mesh size: 1200

Creating and mapping fields for time 200000
Creating mesh-to-mesh addressing for region0 and region0 regions using cellVolumeWeight
Overlap volume: 400000
Creating AMI between source patch IN and target patch IN using faceAreaWeightAMI
AMI: Creating addressing and weights between 40 source faces and 40 target faces
AMI: Patch source sum(weights) min/max/average = 1, 1, 1
AMI: Patch target sum(weights) min/max/average = 1, 1, 1
interpolating alphat
interpolating nut
interpolating Pk
interpolating p_rgh
interpolating p
interpolating T
interpolating k
interpolating epsilon
interpolating B
interpolating U
interpolating GradT
End
allett02015 is offline   Reply With Quote

Old   March 31, 2015, 06:12
Default
  #15
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 27
RodriguezFatz will become famous soon enough
So this did non change the boundary values in your 200000 folder? How did you check that?
What kind of boundary is this inlet? Interpolating both pressure and velocity makes mostly no sense... you need to delete all files from the source folder except the ones you want to interpolate...
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   May 20, 2015, 13:17
Default
  #16
Member
 
Ferdinand Pfender
Join Date: May 2013
Location: Berlin, Germany
Posts: 40
Rep Power: 13
FerdiFuchs is on a distinguished road
I had similar problems.

using mapFields of 2.2.2 instead of 2.3.x works wonderfull!!!
FerdiFuchs is offline   Reply With Quote

Old   July 13, 2019, 21:42
Default
  #17
Member
 
Join Date: Oct 2015
Posts: 63
Rep Power: 11
Scram_1 is on a distinguished road
Hi Phillip,
I'm facing a similar problem with trying to get the outlet of the first part as my inlet for the second part. The mapFields utility works. The problem is that the pressure field remains 0 because the bc for pressure is uniform zero at the outlet of the first part. This creates a problem while running the second part as I don't get a smooth transition of flow from the first to the second part. What Bcs for u and p did you use at the outlet of the first part?

Thanks!

Best,
Scram
Scram_1 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
Question Re Engineering Data Source imnull ANSYS 0 March 5, 2012 14:51
Question about decomposePar RDanks OpenFOAM Pre-Processing 2 May 20, 2011 10:24
internal field question - PitzDaily Case atareen64 OpenFOAM Running, Solving & CFD 2 January 26, 2011 16:26
transientSimpleDyMFoam, mapFields and decomposePar pad OpenFOAM Running, Solving & CFD 0 December 3, 2010 06:22
Poisson Solver question Suresh Main CFD Forum 3 August 12, 2005 05:37


All times are GMT -4. The time now is 05:50.